diff options
author | Michael Fox <mfoxdogg@gmail.com> | 2010-06-13 09:48:21 +0400 |
---|---|---|
committer | Michael Fox <mfoxdogg@gmail.com> | 2010-06-13 09:48:21 +0400 |
commit | e7dd562095f2c313b0101ab4c398c4c79fdc0a3d (patch) | |
tree | d22ef5287f4d7a567f82844f0a953cc7378f3f24 /release | |
parent | b26a23786d513e78d246421bd031d6fbf616e214 (diff) |
Made Add Surface Operator more atomic, now each primitive has own operator, but calling the same function with different flags.
So they can me used in macros, and addons can use the menu now, hope to see some very nice surface plugins
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/ui/space_info.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/release/scripts/ui/space_info.py b/release/scripts/ui/space_info.py index d37190eb5eb..702dc97f3fc 100644 --- a/release/scripts/ui/space_info.py +++ b/release/scripts/ui/space_info.py @@ -212,6 +212,19 @@ class INFO_MT_curve_add(bpy.types.Menu): layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text="Nurbs Circle") layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path") +class INFO_MT_surface_add(bpy.types.Menu): + bl_idname = "INFO_MT_surface_add" + bl_label = "Surface" + + def draw(self, context): + layout = self.layout + layout.operator_context = 'INVOKE_REGION_WIN' + layout.operator("surface.primitive_nurbs_surface_curve_add", icon='SURFACE_NCURVE', text="NURBS Curve") + layout.operator("surface.primitive_nurbs_surface_circle_add", icon='SURFACE_NCIRCLE', text="NURBS Circle") + layout.operator("surface.primitive_nurbs_surface_surface_add", icon='SURFACE_NSURFACE', text="NURBS Surface") + layout.operator("surface.primitive_nurbs_surface_tube_add", icon='SURFACE_NTUBE', text="NURBS Tube") + layout.operator("surface.primitive_nurbs_surface_sphere_add", icon='SURFACE_NSPHERE', text="NURBS Sphere") + layout.operator("surface.primitive_nurbs_surface_donut_add", icon='SURFACE_NDONUT', text="NURBS Torus") class INFO_MT_armature_add(bpy.types.Menu): bl_idname = "INFO_MT_armature_add" @@ -236,7 +249,8 @@ class INFO_MT_add(bpy.types.Menu): #layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE') layout.menu("INFO_MT_curve_add", icon='OUTLINER_OB_CURVE') - layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE') + #layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE') + layout.menu("INFO_MT_surface_add", icon='OUTLINER_OB_SURFACE') layout.operator_menu_enum("object.metaball_add", "type", text="Metaball", icon='OUTLINER_OB_META') layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT') layout.separator() @@ -367,6 +381,7 @@ classes = [ INFO_MT_add, INFO_MT_mesh_add, INFO_MT_curve_add, + INFO_MT_surface_add, INFO_MT_armature_add, INFO_MT_game, INFO_MT_render, |