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
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2019-05-20 13:14:48 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-20 14:47:37 +0300
commit785ff8e1d2e973e10c1a3aea3a986c7e1d3cf1db (patch)
tree086ac1ae7f7fcf8b49f12d6d904cb2590a1c00b6 /release/scripts/startup/bl_ui/properties_object.py
parent81320ce7f7c699d832edf8ba0f609bb246389a33 (diff)
UI: add Visibility panel for objects
The outliner should not be the only way for users to change these settings. The Python API was extended to keep these properties positive and keyframable. Differential Revision: https://developer.blender.org/D4889
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_object.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_object.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 6a938b40c2e..aeda8d8648a 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -378,6 +378,31 @@ class OBJECT_PT_motion_paths_display(MotionPathButtonsPanel_display, Panel):
self.draw_settings(context, avs, mpath)
+class OBJECT_PT_visibility(ObjectButtonsPanel, Panel):
+ bl_label = "Visibility"
+ bl_options = {'DEFAULT_CLOSED'}
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
+
+ @classmethod
+ def poll(cls, context):
+ return (context.object) and (context.engine in cls.COMPAT_ENGINES)
+
+ def draw(self, context):
+ 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)
+
+
class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
_context_path = "object"
@@ -397,6 +422,7 @@ classes = (
OBJECT_PT_motion_paths_display,
OBJECT_PT_display,
OBJECT_PT_display_bounds,
+ OBJECT_PT_visibility,
OBJECT_PT_custom_props,
)