2011-04-27 11:58:34 +00:00
|
|
|
#
|
|
|
|
# Copyright 2011, Blender Foundation.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
#
|
|
|
|
|
|
|
|
import bpy
|
|
|
|
|
|
|
|
from cycles import enums
|
|
|
|
from cycles import engine
|
|
|
|
|
|
|
|
class CyclesButtonsPanel():
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
rd = context.scene.render
|
|
|
|
return rd.engine == 'CYCLES'
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
class CyclesRender_PT_integrator(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Integrator"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
scene = context.scene
|
|
|
|
cscene = scene.cycles
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
split = layout.split()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
col = split.column()
|
2011-08-29 10:21:10 +00:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(cscene, "passes", text="Render Passes")
|
|
|
|
sub.prop(cscene, "preview_passes")
|
2011-08-28 13:55:59 +00:00
|
|
|
col.prop(cscene, "no_caustics")
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
col = split.column()
|
2011-08-29 10:21:10 +00:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(cscene, "max_bounces")
|
|
|
|
sub.prop(cscene, "min_bounces")
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
#row = col.row()
|
|
|
|
#row.prop(cscene, "blur_caustics")
|
|
|
|
#row.active = not cscene.no_caustics
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
class CyclesRender_PT_film(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Film"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
scene = context.scene
|
|
|
|
cscene = scene.cycles
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
split = layout.split()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
col = split.column();
|
|
|
|
col.prop(cscene, "exposure")
|
|
|
|
col.prop(cscene, "transparent")
|
|
|
|
|
|
|
|
col = split.column()
|
2011-08-29 10:21:10 +00:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(cscene, "filter_type", text="")
|
2011-08-28 13:55:59 +00:00
|
|
|
if cscene.filter_type != 'BOX':
|
2011-08-29 10:21:10 +00:00
|
|
|
sub.prop(cscene, "filter_width", text="Width")
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-24 10:44:04 +00:00
|
|
|
class CyclesRender_PT_performance(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Performance"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
scene = context.scene
|
|
|
|
rd = scene.render
|
|
|
|
cscene = scene.cycles
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
split = layout.split()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
col = split.column(align=True)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
col.label(text="Threads:")
|
|
|
|
col.row().prop(rd, "threads_mode", expand=True)
|
|
|
|
sub = col.column()
|
|
|
|
sub.enabled = rd.threads_mode == 'FIXED'
|
|
|
|
sub.prop(rd, "threads")
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.label(text="Tiles:")
|
|
|
|
sub.prop(cscene, "debug_tile_size")
|
|
|
|
sub.prop(cscene, "debug_min_size")
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
col = split.column()
|
2011-08-24 10:44:04 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.label(text="Acceleration structure:")
|
|
|
|
sub.prop(cscene, "debug_bvh_type", text="")
|
|
|
|
sub.prop(cscene, "debug_use_spatial_splits")
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
class Cycles_PT_post_processing(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Post Processing"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
rd = context.scene.render
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
split = layout.split()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
col = split.column()
|
|
|
|
col.prop(rd, "use_compositing")
|
|
|
|
col.prop(rd, "use_sequencer")
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
col = split.column()
|
|
|
|
col.prop(rd, "dither_intensity", text="Dither", slider=True)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
class Cycles_PT_camera(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Cycles"
|
|
|
|
bl_context = "data"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return context.camera
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
camera = context.camera
|
|
|
|
ccamera = camera.cycles
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
layout.prop(ccamera, "lens_radius")
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
class Cycles_PT_context_material(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Surface"
|
|
|
|
bl_context = "material"
|
|
|
|
bl_options = {'HIDE_HEADER'}
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return (context.material or context.object) and CyclesButtonsPanel.poll(context)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
mat = context.material
|
|
|
|
ob = context.object
|
|
|
|
slot = context.material_slot
|
|
|
|
space = context.space_data
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
if ob:
|
|
|
|
row = layout.row()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
row.template_list(ob, "material_slots", ob, "active_material_index", rows=2)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
col = row.column(align=True)
|
|
|
|
col.operator("object.material_slot_add", icon='ZOOMIN', text="")
|
|
|
|
col.operator("object.material_slot_remove", icon='ZOOMOUT', text="")
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
col.menu("MATERIAL_MT_specials", icon='DOWNARROW_HLT', text="")
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
if ob.mode == 'EDIT':
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.operator("object.material_slot_assign", text="Assign")
|
|
|
|
row.operator("object.material_slot_select", text="Select")
|
|
|
|
row.operator("object.material_slot_deselect", text="Deselect")
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
split = layout.split(percentage=0.65)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
if ob:
|
|
|
|
split.template_ID(ob, "active_material", new="material.new")
|
|
|
|
row = split.row()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
if slot:
|
|
|
|
row.prop(slot, "link", text="")
|
|
|
|
else:
|
|
|
|
row.label()
|
|
|
|
elif mat:
|
|
|
|
split.template_ID(space, "pin_id")
|
|
|
|
split.separator()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
class Cycles_PT_mesh_displacement(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Displacement"
|
|
|
|
bl_context = "data"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return context.mesh or context.curve or context.meta_ball
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
mesh = context.mesh
|
|
|
|
curve = context.curve
|
|
|
|
mball = context.meta_ball
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
if mesh:
|
|
|
|
cdata = mesh.cycles
|
|
|
|
elif curve:
|
|
|
|
cdata = curve.cycles
|
|
|
|
elif mball:
|
|
|
|
cdata = mball.cycles
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
layout.prop(cdata, "displacement_method", text="Method")
|
|
|
|
layout.prop(cdata, "use_subdivision");
|
|
|
|
layout.prop(cdata, "dicing_rate");
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
def find_node(material, nodetype):
|
2011-08-28 13:55:59 +00:00
|
|
|
if material and material.node_tree:
|
|
|
|
ntree = material.node_tree
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
for node in ntree.nodes:
|
|
|
|
if type(node) is not bpy.types.NodeGroup and node.type == nodetype:
|
|
|
|
return node
|
|
|
|
|
|
|
|
return None
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
def find_node_input(node, name):
|
2011-08-28 13:55:59 +00:00
|
|
|
for input in node.inputs:
|
|
|
|
if input.name == name:
|
|
|
|
return input
|
|
|
|
|
|
|
|
return None
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
def panel_node_draw(layout, id, output_type, input_name):
|
2011-08-28 13:55:59 +00:00
|
|
|
if not id.node_tree:
|
|
|
|
layout.prop(id, "use_nodes")
|
|
|
|
return
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
ntree = id.node_tree
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
node = find_node(id, output_type)
|
|
|
|
if not node:
|
|
|
|
layout.label(text="No output node.")
|
|
|
|
else:
|
|
|
|
input = find_node_input(node, input_name)
|
|
|
|
layout.template_node_view(ntree, node, input);
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
class CyclesLamp_PT_lamp(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Surface"
|
|
|
|
bl_context = "data"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return context.lamp and CyclesButtonsPanel.poll(context)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
mat = context.lamp
|
|
|
|
panel_node_draw(layout, mat, 'OUTPUT_LAMP', 'Surface')
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
class CyclesWorld_PT_surface(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Surface"
|
|
|
|
bl_context = "world"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return context.world and CyclesButtonsPanel.poll(context)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
mat = context.world
|
|
|
|
panel_node_draw(layout, mat, 'OUTPUT_WORLD', 'Surface')
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
class CyclesWorld_PT_volume(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Volume"
|
|
|
|
bl_context = "world"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return context.world and CyclesButtonsPanel.poll(context)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.active = False
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
mat = context.world
|
|
|
|
panel_node_draw(layout, mat, 'OUTPUT_WORLD', 'Volume')
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
class CyclesMaterial_PT_surface(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Surface"
|
|
|
|
bl_context = "material"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return context.material and CyclesButtonsPanel.poll(context)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
mat = context.material
|
|
|
|
panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Surface')
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
class CyclesMaterial_PT_volume(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Volume"
|
|
|
|
bl_context = "material"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return context.material and CyclesButtonsPanel.poll(context)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.active = False
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
mat = context.material
|
|
|
|
panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Volume')
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
class CyclesMaterial_PT_displacement(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Displacement"
|
|
|
|
bl_context = "material"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return context.material and CyclesButtonsPanel.poll(context)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
mat = context.material
|
|
|
|
panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Displacement')
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
class CyclesMaterial_PT_settings(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Settings"
|
|
|
|
bl_context = "material"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
# return context.material and CyclesButtonsPanel.poll(context)
|
|
|
|
return False
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
mat = context.material
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.label(text="Light Group:")
|
|
|
|
row.prop(mat, "light_group", text="")
|
2011-06-08 23:36:06 +00:00
|
|
|
|
|
|
|
class CyclesTexture_PT_context(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = ""
|
|
|
|
bl_context = "texture"
|
|
|
|
bl_options = {'HIDE_HEADER'}
|
|
|
|
COMPAT_ENGINES = {'CYCLES'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
tex = context.texture
|
|
|
|
space = context.space_data
|
|
|
|
pin_id = space.pin_id
|
|
|
|
use_pin_id = space.use_pin_id;
|
|
|
|
user = context.texture_user
|
|
|
|
node = context.texture_node
|
|
|
|
|
|
|
|
if not use_pin_id or not isinstance(pin_id, bpy.types.Texture):
|
|
|
|
pin_id = None
|
|
|
|
|
|
|
|
if not pin_id:
|
|
|
|
layout.template_texture_user()
|
|
|
|
|
|
|
|
if user:
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
split = layout.split(percentage=0.65)
|
|
|
|
col = split.column()
|
|
|
|
|
|
|
|
if pin_id:
|
|
|
|
col.template_ID(space, "pin_id")
|
|
|
|
elif user:
|
|
|
|
col.template_ID(user, "texture", new="texture.new")
|
|
|
|
|
|
|
|
if tex:
|
|
|
|
row = split.row()
|
|
|
|
row.prop(tex, "use_nodes", icon="NODETREE", text="")
|
|
|
|
row.label()
|
|
|
|
|
|
|
|
if not tex.use_nodes:
|
|
|
|
split = layout.split(percentage=0.2)
|
|
|
|
split.label(text="Type:")
|
|
|
|
split.prop(tex, "type", text="")
|
2011-06-14 16:05:21 +00:00
|
|
|
|
|
|
|
class CyclesTexture_PT_nodes(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Nodes"
|
|
|
|
bl_context = "texture"
|
2011-06-14 16:05:21 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
tex = context.texture
|
|
|
|
return (tex and tex.use_nodes) and CyclesButtonsPanel.poll(context)
|
2011-06-14 16:05:21 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-06-14 16:05:21 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
tex = context.texture
|
|
|
|
panel_node_draw(layout, tex, 'OUTPUT_TEXTURE', 'Color')
|
2011-06-14 16:05:21 +00:00
|
|
|
|
2011-06-27 17:10:50 +00:00
|
|
|
class CyclesTexture_PT_node(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Node"
|
|
|
|
bl_context = "texture"
|
2011-06-27 17:10:50 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
node = context.texture_node
|
|
|
|
return node and CyclesButtonsPanel.poll(context)
|
2011-06-27 17:10:50 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-06-27 17:10:50 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
node = context.texture_node
|
|
|
|
ntree = node.id_data
|
|
|
|
layout.template_node_view(ntree, node, None)
|
2011-06-27 17:10:50 +00:00
|
|
|
|
2011-06-14 16:05:21 +00:00
|
|
|
class CyclesTexture_PT_mapping(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Mapping"
|
|
|
|
bl_context = "texture"
|
2011-06-14 16:05:21 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
tex = context.texture
|
|
|
|
node = context.texture_node
|
|
|
|
return (node or (tex and tex.use_nodes)) and CyclesButtonsPanel.poll(context)
|
2011-06-14 16:05:21 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.label("Texture coordinate mapping goes here.");
|
|
|
|
layout.label("Translate, rotate, scale, projection, XYZ.")
|
2011-06-14 16:05:21 +00:00
|
|
|
|
|
|
|
class CyclesTexture_PT_color(CyclesButtonsPanel, bpy.types.Panel):
|
2011-08-28 13:55:59 +00:00
|
|
|
bl_label = "Color"
|
|
|
|
bl_context = "texture"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
tex = context.texture
|
|
|
|
node = context.texture_node
|
|
|
|
return (node or (tex and tex.use_nodes)) and CyclesButtonsPanel.poll(context)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.label("Color modification options go here.");
|
|
|
|
layout.label("Ramp, brightness, contrast, saturation.")
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
def draw_device(self, context):
|
2011-08-28 13:55:59 +00:00
|
|
|
scene = context.scene
|
|
|
|
layout = self.layout
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
if scene.render.engine == "CYCLES":
|
|
|
|
cscene = scene.cycles
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
if 'cuda' in engine.available_devices():
|
|
|
|
layout.prop(cscene, "device")
|
|
|
|
if cscene.device == 'CPU' and engine.with_osl():
|
|
|
|
layout.prop(cscene, "shading_system")
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
def get_panels():
|
2011-08-28 13:55:59 +00:00
|
|
|
return [
|
|
|
|
bpy.types.RENDER_PT_render,
|
|
|
|
bpy.types.RENDER_PT_output,
|
|
|
|
bpy.types.RENDER_PT_encoding,
|
|
|
|
bpy.types.RENDER_PT_dimensions,
|
|
|
|
bpy.types.RENDER_PT_stamp,
|
|
|
|
bpy.types.WORLD_PT_context_world,
|
|
|
|
bpy.types.DATA_PT_context_mesh,
|
|
|
|
bpy.types.DATA_PT_context_camera,
|
|
|
|
bpy.types.DATA_PT_context_lamp,
|
|
|
|
bpy.types.DATA_PT_texture_space,
|
|
|
|
bpy.types.DATA_PT_curve_texture_space,
|
|
|
|
bpy.types.DATA_PT_mball_texture_space,
|
|
|
|
bpy.types.DATA_PT_vertex_groups,
|
|
|
|
bpy.types.DATA_PT_shape_keys,
|
|
|
|
bpy.types.DATA_PT_uv_texture,
|
|
|
|
bpy.types.DATA_PT_vertex_colors,
|
|
|
|
bpy.types.DATA_PT_camera,
|
|
|
|
bpy.types.DATA_PT_camera_display,
|
|
|
|
bpy.types.DATA_PT_custom_props_mesh,
|
|
|
|
bpy.types.DATA_PT_custom_props_camera,
|
|
|
|
bpy.types.DATA_PT_custom_props_lamp,
|
|
|
|
bpy.types.TEXTURE_PT_clouds,
|
|
|
|
bpy.types.TEXTURE_PT_wood,
|
|
|
|
bpy.types.TEXTURE_PT_marble,
|
|
|
|
bpy.types.TEXTURE_PT_magic,
|
|
|
|
bpy.types.TEXTURE_PT_blend,
|
|
|
|
bpy.types.TEXTURE_PT_stucci,
|
|
|
|
bpy.types.TEXTURE_PT_image,
|
|
|
|
bpy.types.TEXTURE_PT_image_sampling,
|
|
|
|
bpy.types.TEXTURE_PT_image_mapping,
|
|
|
|
bpy.types.TEXTURE_PT_musgrave,
|
|
|
|
bpy.types.TEXTURE_PT_voronoi,
|
|
|
|
bpy.types.TEXTURE_PT_distortednoise,
|
|
|
|
bpy.types.TEXTURE_PT_voxeldata,
|
|
|
|
bpy.types.TEXTURE_PT_pointdensity,
|
|
|
|
bpy.types.TEXTURE_PT_pointdensity_turbulence]
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
def register():
|
2011-08-28 13:55:59 +00:00
|
|
|
bpy.types.RENDER_PT_render.append(draw_device)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
for panel in get_panels():
|
|
|
|
panel.COMPAT_ENGINES.add('CYCLES')
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
def unregister():
|
2011-08-28 13:55:59 +00:00
|
|
|
bpy.types.RENDER_PT_render.remove(draw_device)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-08-28 13:55:59 +00:00
|
|
|
for panel in get_panels():
|
|
|
|
panel.COMPAT_ENGINES.remove('CYCLES')
|
2011-04-27 11:58:34 +00:00
|
|
|
|