Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_outliner.py
| Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| ) | ) | ||||
| elif display_mode in {'LIBRARIES', 'ORPHAN_DATA'}: | elif display_mode in {'LIBRARIES', 'ORPHAN_DATA'}: | ||||
| row.prop(space, "use_filter_id_type", text="", icon='FILTER') | row.prop(space, "use_filter_id_type", text="", icon='FILTER') | ||||
| sub = row.row(align=True) | sub = row.row(align=True) | ||||
| sub.active = space.use_filter_id_type | sub.active = space.use_filter_id_type | ||||
| sub.prop(space, "filter_id_type", text="", icon_only=True) | sub.prop(space, "filter_id_type", text="", icon_only=True) | ||||
| if display_mode == 'VIEW_LAYER': | if display_mode == 'VIEW_LAYER': | ||||
| layout.operator("outliner.collection_new", text="", icon='COLLECTION_NEW').nested = True | layout.operator("outliner.collection_new", text="", icon='COLLECTION_NEW').method = 'SELECTION' | ||||
| elif display_mode == 'ORPHAN_DATA': | elif display_mode == 'ORPHAN_DATA': | ||||
| layout.operator("outliner.orphans_purge", text="Purge") | layout.operator("outliner.orphans_purge", text="Purge") | ||||
| elif space.display_mode == 'DATA_API': | elif space.display_mode == 'DATA_API': | ||||
| layout.separator() | layout.separator() | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| ▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | |||||
| class OUTLINER_MT_collection(Menu): | class OUTLINER_MT_collection(Menu): | ||||
| bl_label = "Collection" | bl_label = "Collection" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| space = context.space_data | space = context.space_data | ||||
| layout.operator("outliner.collection_new", text="New").nested = True | layout.operator_menu_enum("outliner.collection_new", "method", text="New") | ||||
| layout.operator("outliner.collection_duplicate", text="Duplicate Collection") | layout.operator("outliner.collection_duplicate", text="Duplicate Collection") | ||||
| layout.operator("outliner.collection_duplicate_linked", text="Duplicate Linked") | layout.operator("outliner.collection_duplicate_linked", text="Duplicate Linked") | ||||
| layout.operator("outliner.id_copy", text="Copy", icon='COPYDOWN') | layout.operator("outliner.id_copy", text="Copy", icon='COPYDOWN') | ||||
| layout.operator("outliner.id_paste", text="Paste", icon='PASTEDOWN') | layout.operator("outliner.id_paste", text="Paste", icon='PASTEDOWN') | ||||
| layout.separator() | layout.separator() | ||||
| layout.operator("outliner.delete", text="Delete", icon='X') | layout.operator("outliner.delete", text="Delete", icon='X') | ||||
| Show All 33 Lines | def draw(self, context): | ||||
| OUTLINER_MT_context_menu.draw_common_operators(layout) | OUTLINER_MT_context_menu.draw_common_operators(layout) | ||||
| class OUTLINER_MT_collection_new(Menu): | class OUTLINER_MT_collection_new(Menu): | ||||
| bl_label = "Collection" | bl_label = "Collection" | ||||
| @staticmethod | @staticmethod | ||||
| def draw_without_context_menu(context, layout): | def draw_without_context_menu(context, layout): | ||||
| layout.operator("outliner.collection_new", text="New Collection").nested = True | layout.operator_menu_enum("outliner.collection_new", "method", text="New Collection") | ||||
| layout.operator("outliner.id_paste", text="Paste Data-Blocks", icon='PASTEDOWN') | layout.operator("outliner.id_paste", text="Paste Data-Blocks", icon='PASTEDOWN') | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| self.draw_without_context_menu(context, layout) | self.draw_without_context_menu(context, layout) | ||||
| layout.separator() | layout.separator() | ||||
| Show All 25 Lines | def draw(self, context): | ||||
| layout.operator("outliner.object_operation", text="Deselect").type = 'DESELECT' | layout.operator("outliner.object_operation", text="Deselect").type = 'DESELECT' | ||||
| layout.separator() | layout.separator() | ||||
| if not (space.display_mode == 'VIEW_LAYER' and not space.use_filter_collection): | if not (space.display_mode == 'VIEW_LAYER' and not space.use_filter_collection): | ||||
| layout.operator("outliner.id_operation", text="Unlink").type = 'UNLINK' | layout.operator("outliner.id_operation", text="Unlink").type = 'UNLINK' | ||||
| layout.separator() | layout.separator() | ||||
| layout.operator("outliner.collection_new", text="New Collection").nested = True | layout.operator_menu_enum("outliner.collection_new", "method", text="New Collection") | ||||
| layout.separator() | layout.separator() | ||||
| layout.operator_menu_enum("outliner.id_operation", "type", text="ID Data") | layout.operator_menu_enum("outliner.id_operation", "type", text="ID Data") | ||||
| layout.separator() | layout.separator() | ||||
| OUTLINER_MT_context_menu.draw_common_operators(layout) | OUTLINER_MT_context_menu.draw_common_operators(layout) | ||||
| ▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines | |||||