Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/addon/ui.py
| Show First 20 Lines • Show All 1,835 Lines • ▼ Show 20 Lines | def draw_shared(self, context, mat): | ||||
| sub.active = not cmat.homogeneous_volume | sub.active = not cmat.homogeneous_volume | ||||
| sub.prop(cmat, "volume_step_rate") | sub.prop(cmat, "volume_step_rate") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| self.draw_shared(self, context, context.material) | self.draw_shared(self, context, context.material) | ||||
| class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel): | class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel): | ||||
| bl_label = "Bake" | bl_label = "Cycles Baking" | ||||
| bl_context = "render" | bl_context = "object" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_parent_id = "OBJECT_PT_bake_passes" | ||||
| COMPAT_ENGINES = {'CYCLES'} | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| return CyclesButtonsPanel.poll(context) and not use_optix(context) | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False # No animation. | |||||
| scene = context.scene | |||||
| cscene = scene.cycles | |||||
| cbk = scene.render.bake | |||||
| rd = scene.render | |||||
| if rd.use_bake_multires: | |||||
| layout.operator("object.bake_image", icon='RENDER_STILL') | |||||
| layout.prop(rd, "use_bake_multires") | |||||
| layout.prop(rd, "bake_type") | |||||
| else: | |||||
| layout.operator("object.bake", icon='RENDER_STILL').type = cscene.bake_type | |||||
| layout.prop(rd, "use_bake_multires") | |||||
| layout.prop(cscene, "bake_type") | |||||
| class CYCLES_RENDER_PT_bake_influence(CyclesButtonsPanel, Panel): | |||||
| bl_label = "Influence" | |||||
| bl_context = "render" | |||||
| bl_parent_id = "CYCLES_RENDER_PT_bake" | |||||
| COMPAT_ENGINES = {'CYCLES'} | COMPAT_ENGINES = {'CYCLES'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| scene = context.scene | scene = context.scene | ||||
| cscene = scene.cycles | |||||
| rd = scene.render | rd = scene.render | ||||
| if rd.use_bake_multires == False and cscene.bake_type in { | bp = context.object.bake_passes.active | ||||
| 'NORMAL', 'COMBINED', 'DIFFUSE', 'GLOSSY', 'TRANSMISSION'}: | return context.engine in cls.COMPAT_ENGINES \ | ||||
| return True | and not rd.use_bake_multires and bp \ | ||||
| and not use_optix(context) | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False # No animation. | layout.use_property_decorate = False # No animation. | ||||
| scene = context.scene | bp = context.object.bake_passes.active | ||||
| cscene = scene.cycles | cbp = bp.cycles | ||||
| cbk = scene.render.bake | |||||
| rd = scene.render | layout.prop(cbp, "bake_type") | ||||
| layout.prop(cbp, "samples") | |||||
| col = layout.column() | col = layout.column() | ||||
| if cscene.bake_type == 'NORMAL': | if cbp.bake_type == 'NORMAL': | ||||
| col.prop(cbk, "normal_space", text="Space") | col.prop(bp, "normal_space", text="Space") | ||||
| sub = col.column(align=True) | sub = col.column(align=True) | ||||
| sub.prop(cbk, "normal_r", text="Swizzle R") | sub.prop(bp, "normal_r", text="Swizzle R") | ||||
| sub.prop(cbk, "normal_g", text="G") | sub.prop(bp, "normal_g", text="G") | ||||
| sub.prop(cbk, "normal_b", text="B") | sub.prop(bp, "normal_b", text="B") | ||||
| elif cscene.bake_type == 'COMBINED': | elif cbp.bake_type == 'COMBINED': | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.use_property_split = False | row.use_property_split = False | ||||
| row.prop(cbk, "use_pass_direct", toggle=True) | row.prop(cbp, "use_pass_direct", toggle=True) | ||||
| row.prop(cbk, "use_pass_indirect", toggle=True) | row.prop(cbp, "use_pass_indirect", toggle=True) | ||||
| flow = col.grid_flow(row_major=False, columns=0, even_columns=False, even_rows=False, align=True) | flow = col.grid_flow(row_major=False, columns=0, even_columns=False, even_rows=False, align=True) | ||||
| flow.active = cbk.use_pass_direct or cbk.use_pass_indirect | flow.active = cbp.use_pass_direct or cbp.use_pass_indirect | ||||
| flow.prop(cbk, "use_pass_diffuse") | flow.prop(cbp, "use_pass_diffuse") | ||||
| flow.prop(cbk, "use_pass_glossy") | flow.prop(cbp, "use_pass_glossy") | ||||
| flow.prop(cbk, "use_pass_transmission") | flow.prop(cbp, "use_pass_transmission") | ||||
| flow.prop(cbk, "use_pass_ambient_occlusion") | flow.prop(cbp, "use_pass_ambient_occlusion") | ||||
| flow.prop(cbk, "use_pass_emit") | flow.prop(cbp, "use_pass_emit") | ||||
| elif cscene.bake_type in {'DIFFUSE', 'GLOSSY', 'TRANSMISSION'}: | elif cbp.bake_type in {'DIFFUSE', 'GLOSSY', 'TRANSMISSION'}: | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.use_property_split = False | row.use_property_split = False | ||||
| row.prop(cbk, "use_pass_direct", toggle=True) | row.prop(cbp, "use_pass_direct", toggle=True) | ||||
| row.prop(cbk, "use_pass_indirect", toggle=True) | row.prop(cbp, "use_pass_indirect", toggle=True) | ||||
| row.prop(cbk, "use_pass_color", toggle=True) | row.prop(cbp, "use_pass_color", toggle=True) | ||||
| class CYCLES_RENDER_PT_bake_selected_to_active(CyclesButtonsPanel, Panel): | |||||
| bl_label = "Selected to Active" | |||||
| bl_context = "render" | |||||
| bl_parent_id = "CYCLES_RENDER_PT_bake" | |||||
| bl_options = {'DEFAULT_CLOSED'} | |||||
| COMPAT_ENGINES = {'CYCLES'} | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| scene = context.scene | |||||
| rd = scene.render | |||||
| return rd.use_bake_multires == False | |||||
| def draw_header(self, context): | |||||
| scene = context.scene | |||||
| cbk = scene.render.bake | |||||
| self.layout.prop(cbk, "use_selected_to_active", text="") | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False # No animation. | |||||
| scene = context.scene | |||||
| cscene = scene.cycles | |||||
| cbk = scene.render.bake | |||||
| rd = scene.render | |||||
| layout.active = cbk.use_selected_to_active | |||||
| col = layout.column() | |||||
| col.prop(cbk, "use_cage", text="Cage") | |||||
| if cbk.use_cage: | |||||
| col.prop(cbk, "cage_extrusion", text="Extrusion") | |||||
| col.prop(cbk, "cage_object", text="Cage Object") | |||||
| else: | |||||
| col.prop(cbk, "cage_extrusion", text="Ray Distance") | |||||
| class CYCLES_RENDER_PT_bake_output(CyclesButtonsPanel, Panel): | |||||
| bl_label = "Output" | |||||
| bl_context = "render" | |||||
| bl_parent_id = "CYCLES_RENDER_PT_bake" | |||||
| COMPAT_ENGINES = {'CYCLES'} | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False # No animation. | |||||
| scene = context.scene | |||||
| cscene = scene.cycles | |||||
| cbk = scene.render.bake | |||||
| rd = scene.render | |||||
| if rd.use_bake_multires: | |||||
| layout.prop(rd, "bake_margin") | |||||
| layout.prop(rd, "use_bake_clear", text="Clear Image") | |||||
| if rd.bake_type == 'DISPLACEMENT': | |||||
| layout.prop(rd, "use_bake_lores_mesh") | |||||
| else: | |||||
| layout.prop(cbk, "margin") | |||||
| layout.prop(cbk, "use_clear", text="Clear Image") | |||||
| elif cbp.bake_type in {'AOV_COLOR', 'AOV_VALUE'}: | |||||
| col.prop(cbp, "aov_name") | |||||
| class CYCLES_RENDER_PT_debug(CyclesButtonsPanel, Panel): | class CYCLES_RENDER_PT_debug(CyclesButtonsPanel, Panel): | ||||
| bl_label = "Debug" | bl_label = "Debug" | ||||
| bl_context = "render" | bl_context = "render" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'CYCLES'} | COMPAT_ENGINES = {'CYCLES'} | ||||
| @classmethod | @classmethod | ||||
| ▲ Show 20 Lines • Show All 331 Lines • ▼ Show 20 Lines | classes = ( | ||||
| CYCLES_MATERIAL_PT_preview, | CYCLES_MATERIAL_PT_preview, | ||||
| CYCLES_MATERIAL_PT_surface, | CYCLES_MATERIAL_PT_surface, | ||||
| CYCLES_MATERIAL_PT_volume, | CYCLES_MATERIAL_PT_volume, | ||||
| CYCLES_MATERIAL_PT_displacement, | CYCLES_MATERIAL_PT_displacement, | ||||
| CYCLES_MATERIAL_PT_settings, | CYCLES_MATERIAL_PT_settings, | ||||
| CYCLES_MATERIAL_PT_settings_surface, | CYCLES_MATERIAL_PT_settings_surface, | ||||
| CYCLES_MATERIAL_PT_settings_volume, | CYCLES_MATERIAL_PT_settings_volume, | ||||
| CYCLES_RENDER_PT_bake, | CYCLES_RENDER_PT_bake, | ||||
| CYCLES_RENDER_PT_bake_influence, | |||||
| CYCLES_RENDER_PT_bake_selected_to_active, | |||||
| CYCLES_RENDER_PT_bake_output, | |||||
| CYCLES_RENDER_PT_debug, | CYCLES_RENDER_PT_debug, | ||||
| node_panel(CYCLES_MATERIAL_PT_settings), | node_panel(CYCLES_MATERIAL_PT_settings), | ||||
| node_panel(CYCLES_MATERIAL_PT_settings_surface), | node_panel(CYCLES_MATERIAL_PT_settings_surface), | ||||
| node_panel(CYCLES_MATERIAL_PT_settings_volume), | node_panel(CYCLES_MATERIAL_PT_settings_volume), | ||||
| node_panel(CYCLES_WORLD_PT_ray_visibility), | node_panel(CYCLES_WORLD_PT_ray_visibility), | ||||
| node_panel(CYCLES_WORLD_PT_settings), | node_panel(CYCLES_WORLD_PT_settings), | ||||
| node_panel(CYCLES_WORLD_PT_settings_surface), | node_panel(CYCLES_WORLD_PT_settings_surface), | ||||
| node_panel(CYCLES_WORLD_PT_settings_volume), | node_panel(CYCLES_WORLD_PT_settings_volume), | ||||
| Show All 30 Lines | |||||