Make Links (Ctrl+L) back

- split into 2 operators: object.make_links_data() & object.make_links_scene since they are quite different.
- added reusable functions RNA_group_itemf & RNA_scene_itemf which can be used for any operator that takes ID data (easy to add more types Mesh, Text etc)
- DummyRNA_NULL_items for dynamic items so each operator need not define its own empty enum.
This commit is contained in:
2009-11-04 10:25:57 +00:00
parent b221e57fd2
commit 46c8bfe151
8 changed files with 192 additions and 168 deletions

View File

@@ -479,8 +479,10 @@ class VIEW3D_MT_object(bpy.types.Menu):
layout.item_booleanO("object.duplicate", "linked", True, text="Duplicate Linked")
layout.itemO("object.delete", text="Delete...")
layout.itemO("object.proxy_make", text="Make Proxy...")
layout.itemM("VIEW3D_MT_make_links", text="Make Links...")
layout.item_menu_enumO("object.make_local", "type", text="Make Local...")
layout.itemM("VIEW3D_MT_make_single_user")
layout.itemM("VIEW3D_MT_make_links")
layout.itemS()
@@ -604,6 +606,18 @@ class VIEW3D_MT_make_single_user(bpy.types.Menu):
props = layout.itemO("object.make_single_user", properties=True, text="Animation")
props.animation = True
class VIEW3D_MT_make_links(bpy.types.Menu):
bl_label = "Make Links"
def draw(self, context):
layout = self.layout
layout.item_menu_enumO("object.make_links_scene", "type", text="Objects to Scene...")
layout.items_enumO("object.make_links_data", property="type") # inline
# ********** Vertex paint menu **********
@@ -1600,6 +1614,7 @@ bpy.types.register(VIEW3D_MT_object_group)
bpy.types.register(VIEW3D_MT_object_constraints)
bpy.types.register(VIEW3D_MT_object_showhide)
bpy.types.register(VIEW3D_MT_make_single_user)
bpy.types.register(VIEW3D_MT_make_links)
bpy.types.register(VIEW3D_MT_sculpt) # Sculpt Menu