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:
Diffstat (limited to 'release/scripts/startup/bl_ui/space_outliner.py')
-rw-r--r--release/scripts/startup/bl_ui/space_outliner.py122
1 files changed, 67 insertions, 55 deletions
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py
index e1a4a6ef16d..2a59c2c5f79 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -38,7 +38,7 @@ class OUTLINER_HT_header(Header):
layout.prop(space, "display_mode", text="")
row = layout.row(align=True)
- if display_mode == 'COLLECTIONS':
+ if display_mode in {'VIEW_LAYER'}:
row.popover(space_type='OUTLINER',
region_type='HEADER',
panel_type="OUTLINER_PT_filter",
@@ -97,9 +97,6 @@ class OUTLINER_MT_editor_menus(Menu):
elif space.display_mode == 'ORPHAN_DATA':
layout.menu("OUTLINER_MT_edit_orphan_data")
- elif space.display_mode == 'VIEW_LAYER':
- layout.menu("OUTLINER_MT_edit_view_layer")
-
class OUTLINER_MT_view(Menu):
bl_label = "View"
@@ -126,16 +123,6 @@ class OUTLINER_MT_view(Menu):
layout.operator("screen.screen_full_area", text="Toggle Fullscreen Area").use_hide_panels = True
-class OUTLINER_MT_edit_view_layer(Menu):
- bl_label = "Edit"
-
- def draw(self, context):
- layout = self.layout
-
- layout.operator("outliner.collection_link", icon='LINKED')
- layout.operator("outliner.collection_new", icon='NEW')
-
-
class OUTLINER_MT_edit_datablocks(Menu):
bl_label = "Edit"
@@ -159,63 +146,85 @@ class OUTLINER_MT_edit_orphan_data(Menu):
layout.operator("outliner.orphans_purge")
-class OUTLINER_MT_context_scene_collection(Menu):
- bl_label = "Collection"
+class OUTLINER_MT_collection_view_layer(Menu):
+ bl_label = "View Layer"
def draw(self, context):
layout = self.layout
- layout.operator("outliner.collection_nested_new", text="New Collection", icon='NEW')
- layout.operator("outliner.collection_duplicate", text="Duplicate Collection")
- layout.operator("outliner.collection_delete_selected", text="Delete Collections", icon='X')
- layout.separator()
- layout.operator("outliner.collection_objects_add", text="Add Selected", icon='ZOOMIN')
- layout.operator("outliner.collection_objects_remove", text="Remove Selected", icon='ZOOMOUT')
+ space = context.space_data
+
+ layout.operator("outliner.collection_exclude_set", text="Exclude")
+ layout.operator("outliner.collection_include_set", text="Include")
-class OUTLINER_MT_context_object_select(Menu):
- bl_label = "Object Operation Select"
+class OUTLINER_MT_collection(Menu):
+ bl_label = "Collection"
def draw(self, context):
layout = self.layout
- layout.operator("outliner.object_operation", text="Select").type='SELECT'
- layout.operator("outliner.object_operation", text="Deselect").type='DESELECT'
- layout.operator("outliner.object_operation", text="Select Hierarchy").type='SELECT_HIERARCHY'
+ space = context.space_data
+ layout.operator("outliner.collection_new", text="New").nested = True
+ layout.operator("outliner.collection_duplicate", text="Duplicate")
+ layout.operator("outliner.collection_delete", text="Delete").hierarchy = False
+ layout.operator("outliner.collection_delete", text="Delete Hierarchy").hierarchy = True
-class OUTLINER_MT_context_object_delete(Menu):
- bl_label = "Object Operation Delete"
+ layout.separator()
- def draw(self, context):
- layout = self.layout
+ layout.operator("outliner.collection_objects_select", text="Select Objects")
+ layout.operator("outliner.collection_objects_deselect", text="Deselect Objects")
- layout.operator("outliner.object_operation", text="Delete").type='DELETE'
- layout.operator("outliner.object_operation", text="Delete Hierarchy").type='DELETE_HIERARCHY'
+ layout.separator()
+
+ layout.operator("outliner.collection_instance", text="Instance to Scene")
+ if space.display_mode != 'VIEW_LAYER':
+ layout.operator("outliner.collection_link", text="Link to Scene")
+ layout.operator("outliner.id_operation", text="Unlink").type='UNLINK'
+
+ if space.display_mode == 'VIEW_LAYER':
+ layout.separator()
+ layout.menu("OUTLINER_MT_collection_view_layer")
+
+ layout.separator()
+ layout.operator_menu_enum("outliner.id_operation", 'type', text="ID Data")
-class OUTLINER_MT_context_object_collection(Menu):
- bl_label = "Object Operation Collection"
+class OUTLINER_MT_collection_new(Menu):
+ bl_label = "Collection"
def draw(self, context):
layout = self.layout
- layout.operator("outliner.object_add_to_new_collection", text="Add to New Collection", icon='ZOOMIN')
- layout.operator("outliner.object_remove_from_collection", text="Remove from Collection", icon='ZOOMOUT')
+ layout.operator("outliner.collection_new", text="New").nested = False
-class OUTLINER_MT_context_object(Menu):
+class OUTLINER_MT_object(Menu):
bl_label = "Object"
def draw(self, context):
layout = self.layout
- layout.menu("OUTLINER_MT_context_object_select", text="Select")
- layout.menu("OUTLINER_MT_context_object_delete", text="Delete")
- layout.menu("OUTLINER_MT_context_object_collection", text="Collection")
+ space = context.space_data
+
+ layout.operator("outliner.object_operation", text="Delete").type='DELETE'
+ if space.display_mode == 'VIEW_LAYER' and not space.use_filter_collection:
+ layout.operator("outliner.object_operation", text="Delete Hierarchy").type='DELETE_HIERARCHY'
+
layout.separator()
- layout.operator("outliner.object_operation", text="Remap Users").type='REMAP'
- layout.operator("outliner.object_operation", text="Rename").type='RENAME'
+
+ layout.operator("outliner.object_operation", text="Select").type='SELECT'
+ layout.operator("outliner.object_operation", text="Select Hierarchy").type='SELECT_HIERARCHY'
+ layout.operator("outliner.object_operation", text="Deselect").type='DESELECT'
+
+ layout.separator()
+
+ if not (space.display_mode == 'VIEW_LAYER' and not space.use_filter_collection):
+ layout.operator("outliner.id_operation", text="Unlink").type='UNLINK'
+ layout.separator()
+
+ layout.operator_menu_enum("outliner.id_operation", 'type', text="ID Data")
class OUTLINER_PT_filter(Panel):
@@ -227,18 +236,26 @@ class OUTLINER_PT_filter(Panel):
layout = self.layout
space = context.space_data
+ display_mode = space.display_mode
+
+ layout.prop(space, "use_filter_collection", text="Collections")
+
+ layout.separator()
col = layout.column()
- col.prop(space, "filter_state", text="")
+ col.prop(space, "use_filter_object", text="Objects")
+ active = space.use_filter_object
+
sub = col.column(align=True)
- sub.active = space.filter_state != 'NONE'
+ sub.active = active
+ sub.prop(space, "filter_state", text="")
sub.prop(space, "use_filter_object_content", text="Object Contents")
sub.prop(space, "use_filter_children", text="Object Children")
layout.separator()
col = layout.column_flow(align=True)
- col.active = space.filter_state != 'NONE'
+ col.active = active
if bpy.data.meshes:
col.prop(space, "use_filter_object_mesh", text="Meshes")
@@ -258,22 +275,17 @@ class OUTLINER_PT_filter(Panel):
bpy.data.fonts or bpy.data.speakers:
col.prop(space, "use_filter_object_others", text="Others")
- layout.separator()
- layout.prop(space, "use_filter_collection", text="Collections")
-
classes = (
OUTLINER_HT_header,
OUTLINER_MT_editor_menus,
OUTLINER_MT_view,
- OUTLINER_MT_edit_view_layer,
OUTLINER_MT_edit_datablocks,
OUTLINER_MT_edit_orphan_data,
- OUTLINER_MT_context_scene_collection,
- OUTLINER_MT_context_object,
- OUTLINER_MT_context_object_delete,
- OUTLINER_MT_context_object_select,
- OUTLINER_MT_context_object_collection,
+ OUTLINER_MT_collection,
+ OUTLINER_MT_collection_new,
+ OUTLINER_MT_collection_view_layer,
+ OUTLINER_MT_object,
OUTLINER_PT_filter,
)