diff options
author | meta-androcto <meta.androcto1@gmail.com> | 2016-08-05 11:38:21 +0300 |
---|---|---|
committer | meta-androcto <meta.androcto1@gmail.com> | 2016-08-05 11:38:21 +0300 |
commit | 9178b6b22389333d19c12bd4d8b253fa9e3aa661 (patch) | |
tree | ee0c400aaf9fc7cad6e0d66f3b108ff2d4bcd494 /add_curve_extra_objects/__init__.py | |
parent | 4bfde2f6d76d88d14af8fedfc0641d639268bf61 (diff) |
curve extra objects: clean up imports, add surface objects
Diffstat (limited to 'add_curve_extra_objects/__init__.py')
-rw-r--r-- | add_curve_extra_objects/__init__.py | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/add_curve_extra_objects/__init__.py b/add_curve_extra_objects/__init__.py index 945a8ac5..ec45c1c1 100644 --- a/add_curve_extra_objects/__init__.py +++ b/add_curve_extra_objects/__init__.py @@ -28,22 +28,26 @@ bl_info = { "warning": "", "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/" "Scripts/Curve/Curve_Objects", - "category": "Add Curve"} + "category": "Add Curve" + } if "bpy" in locals(): - import imp - imp.reload(add_curve_aceous_galore) - imp.reload(add_curve_spirals) - imp.reload(add_curve_torus_knots) + import importlib + importlib.reload(add_curve_aceous_galore) + importlib.reload(add_curve_spirals) + importlib.reload(add_curve_torus_knots) + importlib.reload(add_surface_plane_cone) else: from . import add_curve_aceous_galore from . import add_curve_spirals from . import add_curve_torus_knots + from . import add_surface_plane_cone import bpy +from bpy.types import Menu -class INFO_MT_curve_extras_add(bpy.types.Menu): +class INFO_MT_curve_extras_add(Menu): # Define the "Extras" menu bl_idname = "curve_extra_objects_add" bl_label = "Extra Objects" @@ -57,8 +61,10 @@ class INFO_MT_curve_extras_add(bpy.types.Menu): text="Spirals") layout.operator("curve.torus_knot_plus", text="Torus Knot Plus") -# Define "Extras" menu + +# Define "Extras" menus def menu_func(self, context): + self.layout.separator() self.layout.operator("mesh.curveaceous_galore", text="Curve Profiles") self.layout.operator("curve.torus_knot_plus", @@ -66,17 +72,30 @@ def menu_func(self, context): self.layout.operator("curve.spirals", text="Spirals") +def menu_surface(self, context): + layout = self.layout + self.layout.separator() + self.layout.operator("object.add_surface_wedge", text="Wedge", icon="MOD_CURVE") + self.layout.operator("object.add_surface_cone", text="Cone", icon="MOD_CURVE") + self.layout.operator("object.add_surface_star", text="Star", icon="MOD_CURVE") + self.layout.operator("object.add_surface_plane", text="Plane", icon="MOD_CURVE") + self.layout.operator("curve.smooth_x_times", text="Special Smooth", icon="MOD_CURVE") + def register(): bpy.utils.register_module(__name__) # Add "Extras" menu to the "Add Curve" menu bpy.types.INFO_MT_curve_add.append(menu_func) + # Add "Extras" menu to the "Add Surface" menu + bpy.types.INFO_MT_surface_add.append(menu_surface) def unregister(): bpy.utils.unregister_module(__name__) # Remove "Extras" menu from the "Add Curve" menu. bpy.types.INFO_MT_curve_add.remove(menu_func) + # Remove "Extras" menu from the "Add Surface" menu. + bpy.types.INFO_MT_surface_add.remove(menu_surface) if __name__ == "__main__": register() |