[Bf-blender-cvs] [c950b8f] master: making add>lamp its own menu so it can be extended by addons
Ines Almeida
noreply at git.blender.org
Sun Apr 12 12:38:35 CEST 2015
Commit: c950b8f2892b985c4fa3e70cea572adda9608491
Author: Ines Almeida
Date: Sun Apr 12 11:38:18 2015 +0100
Branches: master
https://developer.blender.org/rBc950b8f2892b985c4fa3e70cea572adda9608491
making add>lamp its own menu so it can be extended by addons
===================================================================
M release/scripts/startup/bl_ui/space_view3d.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index a23ad42..32b8af1 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -1043,6 +1043,17 @@ class INFO_MT_armature_add(Menu):
layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA')
+class INFO_MT_lamp_add(Menu):
+ bl_idname = "INFO_MT_lamp_add"
+ bl_label = "Lamp"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.operator_context = 'INVOKE_REGION_WIN'
+ layout.operator_enum("object.lamp_add", "type")
+
+
class INFO_MT_add(Menu):
bl_label = "Add"
@@ -1075,7 +1086,7 @@ class INFO_MT_add(Menu):
layout.separator()
layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA')
- layout.operator_menu_enum("object.lamp_add", "type", text="Lamp", icon='OUTLINER_OB_LAMP')
+ layout.menu("INFO_MT_lamp_add", icon='OUTLINER_OB_LAMP')
layout.separator()
layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_EMPTY')
More information about the Bf-blender-cvs
mailing list