Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-20 14:42:16 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-20 14:47:42 +0300
commit0b47d08ef665898c84ca30a1ba2ecc0076a757d1 (patch)
tree76853e5d6430637e1f7259495baadca590a170e4 /intern
parent785ff8e1d2e973e10c1a3aea3a986c7e1d3cf1db (diff)
UI: integrate Cycles ray visibility and culling in new Visibility panel
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/blender/addon/ui.py68
1 files changed, 46 insertions, 22 deletions
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 5a7c798f7e3..a49efb3567f 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1172,27 +1172,53 @@ class CYCLES_OBJECT_PT_motion_blur(CyclesButtonsPanel, Panel):
row.prop(cob, "motion_steps", text="Steps")
-class CYCLES_OBJECT_PT_cycles_settings(CyclesButtonsPanel, Panel):
- bl_label = "Cycles Settings"
+def has_geometry_visibility(ob):
+ return ob and ((ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'LIGHT'}) or
+ (ob.instance_type == 'COLLECTION' and ob.instance_collection))
+
+
+class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel):
+ bl_label = "Visibility"
bl_context = "object"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
- ob = context.object
- return (CyclesButtonsPanel.poll(context) and
- ob and ((ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'LIGHT'}) or
- (ob.instance_type == 'COLLECTION' and ob.instance_collection)))
+ return CyclesButtonsPanel.poll(context) and (context.object)
def draw(self, context):
- pass
+ layout = self.layout
+ layout.use_property_split = True
+
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
+ layout = self.layout
+ ob = context.object
+
+ col = flow.column()
+ col.prop(ob, "hide_viewport", text="Show in Viewports", invert_checkbox=True)
+ col = flow.column()
+ col.prop(ob, "hide_render", text="Show in Renders", invert_checkbox=True)
+ col = flow.column()
+ col.prop(ob, "hide_select", text="Selectable", invert_checkbox=True)
+
+ if has_geometry_visibility(ob):
+ cob = ob.cycles
+ col = flow.column()
+ col.prop(cob, "is_shadow_catcher")
+ col = flow.column()
+ col.prop(cob, "is_holdout")
-class CYCLES_OBJECT_PT_cycles_settings_ray_visibility(CyclesButtonsPanel, Panel):
+class CYCLES_OBJECT_PT_visibility_ray_visibility(CyclesButtonsPanel, Panel):
bl_label = "Ray Visibility"
- bl_parent_id = "CYCLES_OBJECT_PT_cycles_settings"
+ bl_parent_id = "CYCLES_OBJECT_PT_visibility"
bl_context = "object"
+ @classmethod
+ def poll(cls, context):
+ ob = context.object
+ return CyclesButtonsPanel.poll(context) and has_geometry_visibility(ob)
+
def draw(self, context):
layout = self.layout
layout.use_property_split = True
@@ -1222,19 +1248,16 @@ class CYCLES_OBJECT_PT_cycles_settings_ray_visibility(CyclesButtonsPanel, Panel)
layout.separator()
- flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
- col = flow.column()
- col.prop(cob, "is_shadow_catcher")
- col = flow.column()
- col.prop(cob, "is_holdout")
-
-
-class CYCLES_OBJECT_PT_cycles_settings_performance(CyclesButtonsPanel, Panel):
- bl_label = "Performance"
- bl_parent_id = "CYCLES_OBJECT_PT_cycles_settings"
+class CYCLES_OBJECT_PT_visibility_culling(CyclesButtonsPanel, Panel):
+ bl_label = "Culling"
+ bl_parent_id = "CYCLES_OBJECT_PT_visibility"
bl_context = "object"
+ @classmethod
+ def poll(cls, context):
+ ob = context.object
+ return CyclesButtonsPanel.poll(context) and has_geometry_visibility(ob)
def draw(self, context):
layout = self.layout
@@ -2073,6 +2096,7 @@ def get_panels():
'MATERIAL_PT_preview',
'NODE_DATA_PT_light',
'NODE_DATA_PT_spot',
+ 'OBJECT_PT_visibility',
'VIEWLAYER_PT_filter',
'VIEWLAYER_PT_layer_passes',
'RENDER_PT_post_processing',
@@ -2129,9 +2153,9 @@ classes = (
CYCLES_CAMERA_PT_dof_aperture,
CYCLES_PT_context_material,
CYCLES_OBJECT_PT_motion_blur,
- CYCLES_OBJECT_PT_cycles_settings,
- CYCLES_OBJECT_PT_cycles_settings_ray_visibility,
- CYCLES_OBJECT_PT_cycles_settings_performance,
+ CYCLES_OBJECT_PT_visibility,
+ CYCLES_OBJECT_PT_visibility_ray_visibility,
+ CYCLES_OBJECT_PT_visibility_culling,
CYCLES_LIGHT_PT_preview,
CYCLES_LIGHT_PT_light,
CYCLES_LIGHT_PT_nodes,