diff options
Diffstat (limited to 'release/scripts/startup')
-rw-r--r-- | release/scripts/startup/bl_operators/file.py | 20 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/__init__.py | 1 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_collection.py | 69 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_object.py | 45 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_dopesheet.py | 8 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_outliner.py | 122 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 30 |
7 files changed, 119 insertions, 176 deletions
diff --git a/release/scripts/startup/bl_operators/file.py b/release/scripts/startup/bl_operators/file.py index 4ab8d59f263..8d947d19a82 100644 --- a/release/scripts/startup/bl_operators/file.py +++ b/release/scripts/startup/bl_operators/file.py @@ -65,10 +65,10 @@ class WM_OT_previews_batch_generate(Operator): name="Scenes", description="Generate scenes' previews", ) - use_groups = BoolProperty( + use_collections = BoolProperty( default=True, - name="Groups", - description="Generate groups' previews", + name="Collections", + description="Generate collections' previews", ) use_objects = BoolProperty( default=True, @@ -121,8 +121,8 @@ class WM_OT_previews_batch_generate(Operator): ]) if not self.use_scenes: cmd.append('--no_scenes') - if not self.use_groups: - cmd.append('--no_groups') + if not self.use_collections: + cmd.append('--no_collections') if not self.use_objects: cmd.append('--no_objects') if not self.use_intern_data: @@ -175,9 +175,9 @@ class WM_OT_previews_batch_clear(Operator): name="Scenes", description="Clear scenes' previews", ) - use_groups = BoolProperty(default=True, - name="Groups", - description="Clear groups' previews", + use_collections = BoolProperty(default=True, + name="Collections", + description="Clear collections' previews", ) use_objects = BoolProperty( default=True, @@ -231,8 +231,8 @@ class WM_OT_previews_batch_clear(Operator): ]) if not self.use_scenes: cmd.append('--no_scenes') - if not self.use_groups: - cmd.append('--no_groups') + if not self.use_collections: + cmd.append('--no_collections') if not self.use_objects: cmd.append('--no_objects') if not self.use_intern_data: diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 2c0b1ab12be..0de0e8ad72d 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -28,7 +28,6 @@ if "bpy" in locals(): _modules = [ "properties_animviz", - "properties_collection", "properties_constraint", "properties_data_armature", "properties_data_bone", diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py deleted file mode 100644 index 0721ad19f2d..00000000000 --- a/release/scripts/startup/bl_ui/properties_collection.py +++ /dev/null @@ -1,69 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# <pep8 compliant> -import bpy -from bpy.types import Panel - - -class CollectionButtonsPanel: - bl_space_type = 'PROPERTIES' - bl_region_type = 'WINDOW' - bl_context = "collection" - - -def get_collection_from_context(context): - active_object = context.active_object - - if active_object and active_object.dupli_group and context.space_data.collection_context == 'GROUP': - group = active_object.dupli_group - return group.view_layer.collections.active - else: - return context.layer_collection - - -class COLLECTION_PT_context_collection(CollectionButtonsPanel, Panel): - bl_label = "" - bl_options = {'HIDE_HEADER'} - - def draw(self, context): - layout = self.layout - space = context.space_data - active_object = context.active_object - - if active_object and active_object.dupli_group: - split = layout.split(percentage=0.2) - split.row().prop(space, "collection_context", expand=True) - layout = split - - collection = get_collection_from_context(context) - name = collection.name - if name == 'Master Collection': - layout.label(text=name, icon='COLLAPSEMENU') - else: - layout.prop(collection, "name", text="", icon='COLLAPSEMENU') - - -classes = ( - COLLECTION_PT_context_collection, -) - -if __name__ == "__main__": # only for live edit. - from bpy.utils import register_class - for cls in classes: - register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index 95193b68945..f0526fc0271 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -173,19 +173,20 @@ class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel): row.prop(ob, "slow_parent_offset", text="Offset") -class GROUP_MT_specials(Menu): - bl_label = "Group Specials" +class COLLECTION_MT_specials(Menu): + bl_label = "Collection Specials" def draw(self, context): layout = self.layout - layout.operator("object.group_unlink", icon='X') - layout.operator("object.grouped_select") + layout.operator("object.collection_unlink", icon='X') + layout.operator("object.collection_objects_select") layout.operator("object.dupli_offset_from_cursor") -class OBJECT_PT_groups(ObjectButtonsPanel, Panel): - bl_label = "Groups" +class OBJECT_PT_collections(ObjectButtonsPanel, Panel): + bl_label = "Collections" + bl_options = {'DEFAULT_CLOSED'} def draw(self, context): layout = self.layout @@ -193,30 +194,30 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel): obj = context.object row = layout.row(align=True) - if bpy.data.groups: - row.operator("object.group_link", text="Add to Group") + if bpy.data.collections: + row.operator("object.collection_link", text="Add to Collection") else: - row.operator("object.group_add", text="Add to Group") - row.operator("object.group_add", text="", icon='ZOOMIN') + row.operator("object.collection_add", text="Add to Collection") + row.operator("object.collection_add", text="", icon='ZOOMIN') obj_name = obj.name - for group in bpy.data.groups: + for collection in bpy.data.collections: # XXX this is slow and stupid!, we need 2 checks, one thats fast # and another that we can be sure its not a name collision # from linked library data - group_objects = group.objects - if obj_name in group.objects and obj in group_objects[:]: + collection_objects = collection.objects + if obj_name in collection.objects and obj in collection_objects[:]: col = layout.column(align=True) - col.context_pointer_set("group", group) + col.context_pointer_set("collection", collection) row = col.box().row() - row.prop(group, "name", text="") - row.operator("object.group_remove", text="", icon='X', emboss=False) - row.menu("GROUP_MT_specials", icon='DOWNARROW_HLT', text="") + row.prop(collection, "name", text="") + row.operator("object.collection_remove", text="", icon='X', emboss=False) + row.menu("COLLECTION_MT_specials", icon='DOWNARROW_HLT', text="") row = col.box().row() - row.prop(group, "dupli_offset", text="") + row.prop(collection, "dupli_offset", text="") class OBJECT_PT_display(ObjectButtonsPanel, Panel): @@ -317,8 +318,8 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel): sub.active = ob.use_dupli_faces_scale sub.prop(ob, "dupli_faces_scale", text="Inherit Scale") - elif ob.dupli_type == 'GROUP': - layout.prop(ob, "dupli_group", text="Group") + elif ob.dupli_type == 'COLLECTION': + layout.prop(ob, "dupli_group", text="Collection") from .properties_animviz import ( @@ -372,8 +373,8 @@ classes = ( OBJECT_PT_transform_locks, OBJECT_PT_relations, OBJECT_PT_relations_extras, - GROUP_MT_specials, - OBJECT_PT_groups, + COLLECTION_MT_specials, + OBJECT_PT_collections, OBJECT_PT_display, OBJECT_PT_duplication, OBJECT_PT_motion_paths, diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 1b8582ba8f2..c4b867ab647 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -41,11 +41,11 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False): row.prop(dopesheet, "show_only_errors", text="") if not genericFiltersOnly: - if bpy.data.groups: + if bpy.data.collections: row = layout.row(align=True) - row.prop(dopesheet, "show_only_group_objects", text="") - if dopesheet.show_only_group_objects: - row.prop(dopesheet, "filter_group", text="") + row.prop(dopesheet, "show_only_collection_objects", text="") + if dopesheet.show_only_collection_objects: + row.prop(dopesheet, "filter_collection", text="") if not is_nla: row = layout.row(align=True) 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, ) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 53dea7ad2e8..f20e9021e28 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1335,14 +1335,14 @@ class INFO_MT_add(Menu): layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_FORCE_FIELD') layout.separator() - if len(bpy.data.groups) > 10: + if len(bpy.data.collections) > 10: layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("object.group_instance_add", text="Group Instance...", icon='OUTLINER_OB_GROUP_INSTANCE') + layout.operator("object.collection_instance_add", text="Collection Instance...", icon='OUTLINER_OB_GROUP_INSTANCE') else: layout.operator_menu_enum( - "object.group_instance_add", - "group", - text="Group Instance", + "object.collection_instance_add", + "collection", + text="Collection Instance", icon='OUTLINER_OB_GROUP_INSTANCE', ) @@ -1407,7 +1407,7 @@ class VIEW3D_MT_object(Menu): layout.separator() layout.menu("VIEW3D_MT_object_parent") - layout.menu("VIEW3D_MT_object_group") + layout.menu("VIEW3D_MT_object_collection") layout.menu("VIEW3D_MT_snap") layout.separator() @@ -1714,21 +1714,21 @@ class VIEW3D_MT_object_track(Menu): layout.operator_enum("object.track_clear", "type") -class VIEW3D_MT_object_group(Menu): - bl_label = "Group" +class VIEW3D_MT_object_collection(Menu): + bl_label = "Collection" def draw(self, context): layout = self.layout - layout.operator("group.create") - # layout.operator_menu_enum("group.objects_remove", "group") # BUGGY - layout.operator("group.objects_remove") - layout.operator("group.objects_remove_all") + layout.operator("collection.create") + # layout.operator_menu_enum("collection.objects_remove", "collection") # BUGGY + layout.operator("collection.objects_remove") + layout.operator("collection.objects_remove_all") layout.separator() - layout.operator("group.objects_add_active") - layout.operator("group.objects_remove_active") + layout.operator("collection.objects_add_active") + layout.operator("collection.objects_remove_active") class VIEW3D_MT_object_constraints(Menu): @@ -3974,7 +3974,7 @@ classes = ( VIEW3D_MT_object_apply, VIEW3D_MT_object_parent, VIEW3D_MT_object_track, - VIEW3D_MT_object_group, + VIEW3D_MT_object_collection, VIEW3D_MT_object_constraints, VIEW3D_MT_object_quick_effects, VIEW3D_MT_make_single_user, |