diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-26 01:16:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-26 01:16:19 +0300 |
commit | 5afd084513f799a8d5e725e12a756a9464e711ba (patch) | |
tree | ecf51e5f7c986879909d74c13cde4be8cbe0c0de /release/scripts/op | |
parent | 695677914a0de9dbc1dbc202fc228b724473c9e3 (diff) |
replace dynamic_menu.py with Menu classmethods much less complicated.
access append/prepend eg.
bpy.types.INFO_MT_file_import.append(lambda self, context: self.layout.operator("import_some.format"))
Diffstat (limited to 'release/scripts/op')
-rw-r--r-- | release/scripts/op/add_armature_human.py | 4 | ||||
-rw-r--r-- | release/scripts/op/add_mesh_torus.py | 6 | ||||
-rw-r--r-- | release/scripts/op/mesh_skin.py | 3 | ||||
-rw-r--r-- | release/scripts/op/uvcalc_follow_active.py | 5 | ||||
-rw-r--r-- | release/scripts/op/uvcalc_smart_project.py | 5 |
5 files changed, 6 insertions, 17 deletions
diff --git a/release/scripts/op/add_armature_human.py b/release/scripts/op/add_armature_human.py index 8696312eae0..e618ed51ee5 100644 --- a/release/scripts/op/add_armature_human.py +++ b/release/scripts/op/add_armature_human.py @@ -613,11 +613,9 @@ class AddHuman(bpy.types.Operator): bpy.types.register(AddHuman) # Add to a menu -import dynamic_menu - menu_func = (lambda self, context: self.layout.operator(AddHuman.bl_idname, icon='OUTLINER_OB_ARMATURE', text="Human (Meta-Rig)")) -menu_item = dynamic_menu.add(bpy.types.INFO_MT_armature_add, menu_func) +bpy.types.INFO_MT_armature_add.append(menu_func) if __name__ == "__main__": bpy.ops.mesh.armature_human_advanced_add() diff --git a/release/scripts/op/add_mesh_torus.py b/release/scripts/op/add_mesh_torus.py index 685f1cae8a4..372afb3654f 100644 --- a/release/scripts/op/add_mesh_torus.py +++ b/release/scripts/op/add_mesh_torus.py @@ -127,13 +127,11 @@ class AddTorus(bpy.types.Operator): # Register the operator bpy.types.register(AddTorus) -# Add to a menu -import dynamic_menu - +# Add to the menu menu_func = (lambda self, context: self.layout.operator(AddTorus.bl_idname, text="Torus", icon='MESH_DONUT')) -menu_item = dynamic_menu.add(bpy.types.INFO_MT_mesh_add, menu_func) +bpy.types.INFO_MT_mesh_add.append(menu_func) if __name__ == "__main__": bpy.ops.mesh.primitive_torus_add() diff --git a/release/scripts/op/mesh_skin.py b/release/scripts/op/mesh_skin.py index 251cfb32b93..d442717afbf 100644 --- a/release/scripts/op/mesh_skin.py +++ b/release/scripts/op/mesh_skin.py @@ -650,8 +650,7 @@ class MESH_OT_skin(bpy.types.Operator): bpy.types.register(MESH_OT_skin) # Add to a menu -import dynamic_menu -menu_item = dynamic_menu.add(bpy.types.VIEW3D_MT_edit_mesh_faces, (lambda self, context: self.layout.operator("mesh.skin", text="Bridge Faces")) ) +bpy.types.VIEW3D_MT_edit_mesh_faces.append((lambda self, context: self.layout.operator("mesh.skin", text="Bridge Faces"))) if __name__ == "__main__": bpy.ops.mesh.skin() diff --git a/release/scripts/op/uvcalc_follow_active.py b/release/scripts/op/uvcalc_follow_active.py index 8ab5b8ec454..41f97f9cca5 100644 --- a/release/scripts/op/uvcalc_follow_active.py +++ b/release/scripts/op/uvcalc_follow_active.py @@ -262,11 +262,8 @@ class FollowActiveQuads(bpy.types.Operator): bpy.types.register(FollowActiveQuads) # Add to a menu -import dynamic_menu - menu_func = (lambda self, context: self.layout.operator(FollowActiveQuads.bl_idname)) - -menu_item = dynamic_menu.add(bpy.types.VIEW3D_MT_uv_map, menu_func) +bpy.types.VIEW3D_MT_uv_map.append(menu_func) if __name__ == '__main__': bpy.ops.uv.follow_active_quads() diff --git a/release/scripts/op/uvcalc_smart_project.py b/release/scripts/op/uvcalc_smart_project.py index 25840e04cf8..6da6020f85b 100644 --- a/release/scripts/op/uvcalc_smart_project.py +++ b/release/scripts/op/uvcalc_smart_project.py @@ -1135,13 +1135,10 @@ class SmartProject(bpy.types.Operator): bpy.types.register(SmartProject) # Add to a menu -import dynamic_menu - menu_func = (lambda self, context: self.layout.operator(SmartProject.bl_idname, text="Smart Project")) -menu_item = dynamic_menu.add(bpy.types.VIEW3D_MT_uv_map, menu_func) +bpy.types.VIEW3D_MT_uv_map.append(menu_func) if __name__ == '__main__': bpy.ops.uv.smart_project() - |