Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_object.py
| Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col = split.column() | col = split.column() | ||||
| col.prop(ob, "use_slow_parent") | col.prop(ob, "use_slow_parent") | ||||
| row = col.row() | row = col.row() | ||||
| row.active = ((ob.parent is not None) and (ob.use_slow_parent)) | row.active = ((ob.parent is not None) and (ob.use_slow_parent)) | ||||
| row.prop(ob, "slow_parent_offset", text="Offset") | row.prop(ob, "slow_parent_offset", text="Offset") | ||||
| class GROUP_MT_specials(Menu): | class COLLECTION_MT_specials(Menu): | ||||
| bl_label = "Group Specials" | bl_label = "Collection Specials" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.operator("object.group_unlink", icon='X') | layout.operator("object.collection_unlink", icon='X') | ||||
| layout.operator("object.grouped_select") | layout.operator("object.collection_objects_select") | ||||
| layout.operator("object.dupli_offset_from_cursor") | layout.operator("object.dupli_offset_from_cursor") | ||||
| class OBJECT_PT_groups(ObjectButtonsPanel, Panel): | class OBJECT_PT_collections(ObjectButtonsPanel, Panel): | ||||
| bl_label = "Groups" | bl_label = "Collections" | ||||
| bl_options = {'DEFAULT_CLOSED'} | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| obj = context.object | obj = context.object | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| if bpy.data.groups: | if bpy.data.collections: | ||||
| row.operator("object.group_link", text="Add to Group") | row.operator("object.collection_link", text="Add to Collection") | ||||
| else: | else: | ||||
| row.operator("object.group_add", text="Add to Group") | row.operator("object.collection_add", text="Add to Collection") | ||||
| row.operator("object.group_add", text="", icon='ZOOMIN') | row.operator("object.collection_add", text="", icon='ZOOMIN') | ||||
| obj_name = obj.name | 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 | # 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 | # and another that we can be sure its not a name collision | ||||
| # from linked library data | # from linked library data | ||||
| group_objects = group.objects | collection_objects = collection.objects | ||||
| if obj_name in group.objects and obj in group_objects[:]: | if obj_name in collection.objects and obj in collection_objects[:]: | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.context_pointer_set("group", group) | col.context_pointer_set("collection", collection) | ||||
| row = col.box().row() | row = col.box().row() | ||||
| row.prop(group, "name", text="") | row.prop(collection, "name", text="") | ||||
| row.operator("object.group_remove", text="", icon='X', emboss=False) | row.operator("object.collection_remove", text="", icon='X', emboss=False) | ||||
| row.menu("GROUP_MT_specials", icon='DOWNARROW_HLT', text="") | row.menu("COLLECTION_MT_specials", icon='DOWNARROW_HLT', text="") | ||||
| row = col.box().row() | row = col.box().row() | ||||
| row.prop(group, "dupli_offset", text="") | row.prop(collection, "dupli_offset", text="") | ||||
| class OBJECT_PT_display(ObjectButtonsPanel, Panel): | class OBJECT_PT_display(ObjectButtonsPanel, Panel): | ||||
| bl_label = "Display" | bl_label = "Display" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | |||||
| classes = ( | classes = ( | ||||
| OBJECT_PT_context_object, | OBJECT_PT_context_object, | ||||
| OBJECT_PT_transform, | OBJECT_PT_transform, | ||||
| OBJECT_PT_delta_transform, | OBJECT_PT_delta_transform, | ||||
| OBJECT_PT_transform_locks, | OBJECT_PT_transform_locks, | ||||
| OBJECT_PT_relations, | OBJECT_PT_relations, | ||||
| OBJECT_PT_relations_extras, | OBJECT_PT_relations_extras, | ||||
| GROUP_MT_specials, | COLLECTION_MT_specials, | ||||
| OBJECT_PT_groups, | OBJECT_PT_collections, | ||||
| OBJECT_PT_display, | OBJECT_PT_display, | ||||
| OBJECT_PT_duplication, | OBJECT_PT_duplication, | ||||
| OBJECT_PT_motion_paths, | OBJECT_PT_motion_paths, | ||||
| OBJECT_PT_custom_props, | OBJECT_PT_custom_props, | ||||
| ) | ) | ||||
| if __name__ == "__main__": # only for live edit. | if __name__ == "__main__": # only for live edit. | ||||
| from bpy.utils import register_class | from bpy.utils import register_class | ||||
| for cls in classes: | for cls in classes: | ||||
| register_class(cls) | register_class(cls) | ||||