diff options
author | Brendon Murphy <meta.androcto1@gmail.com> | 2014-08-04 18:31:22 +0400 |
---|---|---|
committer | Brendon Murphy <meta.androcto1@gmail.com> | 2014-08-04 18:31:22 +0400 |
commit | 263763f2d120000c9d75777afe299418335b4adb (patch) | |
tree | 378df844b21ec5cd8a154c70454140471ec758ac | |
parent | c2d1f06c06097965abdb00bcda557704d917dd19 (diff) |
updates & cleanup, merged pipe joints & solid objects, cleaner integration into shift/a
-rw-r--r-- | add_mesh_extra_objects/__init__.py | 79 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_3d_function_surface.py | 8 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_extra_objects.py | 1 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_gears.py | 21 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_gemstones.py | 14 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_honeycomb.py | 13 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_pipe_joint.py (renamed from add_mesh_pipe_joint.py) | 64 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_polysphere.py | 8 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_solid.py (renamed from add_mesh_solid.py) | 103 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_supertoroid.py | 22 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_teapot.py | 35 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_torusknot.py | 30 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_twisted_torus.py | 23 |
13 files changed, 61 insertions, 360 deletions
diff --git a/add_mesh_extra_objects/__init__.py b/add_mesh_extra_objects/__init__.py index 47bb1c1f..9c35a1b7 100644 --- a/add_mesh_extra_objects/__init__.py +++ b/add_mesh_extra_objects/__init__.py @@ -21,8 +21,8 @@ bl_info = { "name": "Extra Objects", "author": "Multiple Authors", - "version": (0, 3), - "blender": (2, 63, 0), + "version": (0, 3, 0), + "blender": (2, 71, 0), "location": "View3D > Add > Mesh > Extra Objects", "description": "Add extra object types", "warning": "", @@ -31,7 +31,6 @@ bl_info = { "category": "Add Mesh", } - if "bpy" in locals(): import imp imp.reload(add_mesh_extra_objects) @@ -45,6 +44,10 @@ if "bpy" in locals(): imp.reload(add_mesh_torusknot) imp.reload(add_mesh_honeycomb) imp.reload(add_mesh_teapot) + imp.reload(add_mesh_pipe_joint) + imp.reload(add_mesh_teapot) + imp.reload(add_mesh_solid) + else: from . import add_mesh_extra_objects from . import add_mesh_twisted_torus @@ -57,37 +60,11 @@ else: from . import add_mesh_torusknot from . import add_mesh_honeycomb from . import add_mesh_teapot -import bpy - - -class INFO_MT_mesh_extras_add(bpy.types.Menu): - # Define the "Extras" menu - bl_idname = "INFO_MT_mesh_extra_objects_add" - bl_label = "Extra Objects" - - def draw(self, context): - layout = self.layout - layout.operator_context = 'INVOKE_REGION_WIN' - layout.menu("INFO_MT_mesh_gemstones_add", text="Gemstones") - layout.menu("INFO_MT_mesh_gears_add", text="Gears") - layout.menu("INFO_MT_mesh_math_add", text="Math Function") - layout.menu("INFO_MT_mesh_basic_add", text="Basic Objects") - layout.menu("INFO_MT_mesh_torus_add", text="Torus Objects") - layout.menu("INFO_MT_mesh_misc_add", text="Misc Objects") - -class INFO_MT_mesh_gemstones_add(bpy.types.Menu): - # Define the "Gemstones" menu - bl_idname = "INFO_MT_mesh_gemstones_add" - bl_label = "Gemstones" - - def draw(self, context): - layout = self.layout - layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("mesh.primitive_diamond_add", - text="Diamond") - layout.operator("mesh.primitive_gem_add", - text="Gem") + from . import add_mesh_pipe_joint + from . import add_mesh_teapot + from . import add_mesh_solid +import bpy class INFO_MT_mesh_gears_add(bpy.types.Menu): # Define the "Gears" menu @@ -114,6 +91,7 @@ class INFO_MT_mesh_math_add(bpy.types.Menu): text="Z Math Surface") layout.operator("mesh.primitive_xyz_function_surface", text="XYZ Math Surface") + self.layout.operator("mesh.primitive_solid_add", text="Solid") class INFO_MT_mesh_basic_add(bpy.types.Menu): # Define the "Simple Objects" menu @@ -123,6 +101,10 @@ class INFO_MT_mesh_basic_add(bpy.types.Menu): def draw(self, context): layout = self.layout layout.operator_context = 'INVOKE_REGION_WIN' + layout.operator("mesh.primitive_diamond_add", + text="Diamond") + layout.operator("mesh.primitive_gem_add", + text="Gem") layout.operator("mesh.primitive_sqorus_add", text="Sqorus") layout.operator("mesh.primitive_wedge_add") @@ -130,8 +112,6 @@ class INFO_MT_mesh_basic_add(bpy.types.Menu): text="Star") layout.operator("mesh.primitive_trapezohedron_add", text="Trapezohedron") - layout.operator("mesh.primitive_polysphere_add", - text="Polysphere") class INFO_MT_mesh_torus_add(bpy.types.Menu): # Define the "Simple Objects" menu @@ -162,11 +142,37 @@ class INFO_MT_mesh_misc_add(bpy.types.Menu): text="Honeycomb") layout.operator("mesh.primitive_teapot_add", text="Teapot+") + +class INFO_MT_mesh_pipe_joints_add(bpy.types.Menu): + # Define the "Pipe Joints" menu + bl_idname = "INFO_MT_mesh_pipe_joints_add" + bl_label = "Pipe Joints" + + def draw(self, context): + layout = self.layout + layout.operator_context = 'INVOKE_REGION_WIN' + layout.operator("mesh.primitive_elbow_joint_add", + text="Pipe Elbow") + layout.operator("mesh.primitive_tee_joint_add", + text="Pipe T-Joint") + layout.operator("mesh.primitive_wye_joint_add", + text="Pipe Y-Joint") + layout.operator("mesh.primitive_cross_joint_add", + text="Pipe Cross-Joint") + layout.operator("mesh.primitive_n_joint_add", + text="Pipe N-Joint") + # Register all operators and panels # Define "Extras" menu def menu_func(self, context): - self.layout.menu("INFO_MT_mesh_extra_objects_add", icon="PLUGIN") + self.layout.operator("mesh.primitive_polysphere_add", text="Polysphere") + self.layout.menu("INFO_MT_mesh_pipe_joints_add", text="Pipe Joints") + self.layout.menu("INFO_MT_mesh_gears_add", text="Gears") + self.layout.menu("INFO_MT_mesh_math_add", text="Math Function") + self.layout.menu("INFO_MT_mesh_torus_add", text="Torus Objects") + self.layout.menu("INFO_MT_mesh_basic_add", text="Basic Objects") + self.layout.menu("INFO_MT_mesh_misc_add", text="Misc Objects") def register(): @@ -175,7 +181,6 @@ def register(): # Add "Extras" menu to the "Add Mesh" menu bpy.types.INFO_MT_mesh_add.append(menu_func) - def unregister(): bpy.utils.unregister_module(__name__) diff --git a/add_mesh_extra_objects/add_mesh_3d_function_surface.py b/add_mesh_extra_objects/add_mesh_3d_function_surface.py index ca39d544..00227dd7 100644 --- a/add_mesh_extra_objects/add_mesh_3d_function_surface.py +++ b/add_mesh_extra_objects/add_mesh_3d_function_surface.py @@ -16,17 +16,9 @@ # # ##### END GPL LICENSE BLOCK ##### ''' -bl_info = { "name": "3D Function Surfaces", "author": "Buerbaum Martin (Pontiac), Elod Csirmaz", "version": (0, 3, 8), - "blender": (2, 57, 0), - "location": "View3D > Add > Mesh", - "description": "Create Objects using Math Formulas", - "warning": "", - "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/" - "Scripts/Add_Mesh/Add_3d_Function_Surface", - "category": "Add Mesh"} ''' import bpy diff --git a/add_mesh_extra_objects/add_mesh_extra_objects.py b/add_mesh_extra_objects/add_mesh_extra_objects.py index 1007b157..040e13fe 100644 --- a/add_mesh_extra_objects/add_mesh_extra_objects.py +++ b/add_mesh_extra_objects/add_mesh_extra_objects.py @@ -39,7 +39,6 @@ def create_mesh_object(context, verts, edges, faces, name): from bpy_extras import object_utils return object_utils.object_data_add(context, mesh, operator=None) - # A very simple "bridge" tool. # Connects two equally long vertex rows with faces. # Returns a list of the new faces (list of lists) diff --git a/add_mesh_extra_objects/add_mesh_gears.py b/add_mesh_extra_objects/add_mesh_gears.py index d657fcfb..e7196f69 100644 --- a/add_mesh_extra_objects/add_mesh_gears.py +++ b/add_mesh_extra_objects/add_mesh_gears.py @@ -19,18 +19,9 @@ # # ***** END GPL LICENCE BLOCK ***** ''' -bl_info = { "name": "Gears", "author": "Michel J. Anders (varkenvarken)", "version": (2, 4, 2), - "blender": (2, 57, 0), - "location": "View3D > Add > Mesh > Gears ", - "description": "Adds a mesh Gear to the Add Mesh menu", - "warning": "", - "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/" - "Scripts/Add_Mesh/Add_Gear", - "category": "Add Mesh", -} ''' import bpy @@ -54,7 +45,6 @@ def create_mesh_object(context, verts, edges, faces, name): from bpy_extras import object_utils return object_utils.object_data_add(context, mesh, operator=None) - # A very simple "bridge" tool. # Connects two equally long vertex rows with faces. # Returns a list of the new faces (list of lists) @@ -123,7 +113,6 @@ def createFaces(vertIdx1, vertIdx2, closed=False, flipped=False): return faces - # Calculate the vertex coordinates for a single # section of a gear tooth. # Returns 4 lists of vertex coords (list of tuples): @@ -145,6 +134,7 @@ def createFaces(vertIdx1, vertIdx2, closed=False, flipped=False): # p_angle # rack # crown + def add_tooth(a, t, d, radius, Ad, De, base, p_angle, rack=0, crown=0.0): A = [a, a + t / 4, a + t / 2, a + 3 * t / 4] C = [cos(i) for i in A] @@ -193,7 +183,6 @@ def add_tooth(a, t, d, radius, Ad, De, base, p_angle, rack=0, crown=0.0): return (verts_inner_base, verts_outer_base, verts_middle_tooth, verts_tip_tooth) - # EXPERIMENTAL Calculate the vertex coordinates for a single # section of a gearspoke. # Returns them as a list of tuples. @@ -211,6 +200,7 @@ def add_tooth(a, t, d, radius, Ad, De, base, p_angle, rack=0, crown=0.0): # width # # @todo Finish this. + def add_spoke(a, t, d, radius, De, base, s, w, l, gap=0, width=19): Rd = radius - De Rb = Rd - base @@ -249,7 +239,6 @@ def add_spoke(a, t, d, radius, De, base, s, w, l, gap=0, width=19): return verts, edgefaces, edgefaces2, sf - # Create gear geometry. # Returns: # * A list of vertices (list of tuples) @@ -270,6 +259,7 @@ def add_spoke(a, t, d, radius, De, base, s, w, l, gap=0, width=19): # crown ... Inward pointing extend of crown teeth. # # inner radius = radius - (De + base) + def add_gear(teethNum, radius, Ad, De, base, p_angle, width=1, skew=0, conangle=0, rack=0, crown=0.0): @@ -382,7 +372,6 @@ def add_gear(teethNum, radius, Ad, De, base, p_angle, return verts, faces, vgroup_top, vgroup_valley - # Create spokes geometry. # Returns: # * A list of vertices (list of tuples) @@ -404,6 +393,7 @@ def add_gear(teethNum, radius, Ad, De, base, p_angle, # @todo Finish this # @todo Create a function that takes a "Gear" and creates a # matching "Gear Spokes" object. + def add_spokes(teethNum, radius, De, base, width=1, conangle=0, rack=0, spoke=3, spbevel=0.1, spwidth=0.2, splength=1.0, spresol=9): @@ -466,7 +456,6 @@ def add_spokes(teethNum, radius, De, base, width=1, conangle=0, rack=0, return verts, faces - # Create worm geometry. # Returns: # * A list of vertices @@ -568,7 +557,6 @@ def add_worm(teethNum, rowNum, radius, Ad, De, p_angle, return verts, faces, vgroup_top, vgroup_valley - class AddGear(bpy.types.Operator): """Add a gear mesh""" bl_idname = "mesh.primitive_gear" @@ -685,7 +673,6 @@ class AddGear(bpy.types.Operator): return {'FINISHED'} - class AddWormGear(bpy.types.Operator): """Add a worm gear mesh""" bl_idname = "mesh.primitive_worm_gear" diff --git a/add_mesh_extra_objects/add_mesh_gemstones.py b/add_mesh_extra_objects/add_mesh_gemstones.py index d0e7a375..5d4f83ca 100644 --- a/add_mesh_extra_objects/add_mesh_gemstones.py +++ b/add_mesh_extra_objects/add_mesh_gemstones.py @@ -16,18 +16,9 @@ # # ##### END GPL LICENSE BLOCK ##### ''' -bl_info = { "name": "Gemstones", "author": "Pontiac, Fourmadmen, Dreampainter", "version": (0, 4), - "blender": (2, 57, 0), - "location": "View3D > Add > Mesh > Gemstones", - "description": "Adds various gemstone (Diamond & Gem) meshes.", - "warning": "", - "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/" - "Scripts/Add_Mesh/Add_Gemstones", - "category": "Add Mesh", -} ''' import bpy from mathutils import * @@ -52,7 +43,6 @@ def create_mesh_object(context, verts, edges, faces, name): from bpy_extras import object_utils return object_utils.object_data_add(context, mesh, operator=None) - # A very simple "bridge" tool. # Connects two equally long vertex rows with faces. # Returns a list of the new faces (list of lists) @@ -121,7 +111,6 @@ def createFaces(vertIdx1, vertIdx2, closed=False, flipped=False): return faces - # @todo Clean up vertex&face creation process a bit. def add_gem(r1, r2, seg, h1, h2): """ @@ -181,7 +170,6 @@ def add_gem(r1, r2, seg, h1, h2): return verts, faces - def add_diamond(segments, girdle_radius, table_radius, crown_height, pavilion_height): @@ -235,7 +223,6 @@ def add_diamond(segments, girdle_radius, table_radius, return verts, faces - class AddDiamond(bpy.types.Operator): """Add a diamond mesh""" bl_idname = "mesh.primitive_diamond_add" @@ -279,7 +266,6 @@ class AddDiamond(bpy.types.Operator): return {'FINISHED'} - class AddGem(bpy.types.Operator): """Add a diamond gem""" bl_idname = "mesh.primitive_gem_add" diff --git a/add_mesh_extra_objects/add_mesh_honeycomb.py b/add_mesh_extra_objects/add_mesh_honeycomb.py index 37a93036..53194f28 100644 --- a/add_mesh_extra_objects/add_mesh_honeycomb.py +++ b/add_mesh_extra_objects/add_mesh_honeycomb.py @@ -1,4 +1,4 @@ -'''# ##### BEGIN GPL LICENSE BLOCK ##### +# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -15,19 +15,10 @@ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ##### END GPL LICENSE BLOCK ##### - -bl_info = { +''' "name": "HoneyComb", "author": "Kayo Phoenix <kayo@illumium.org>", "version": (0, 1), - "blender": (2, 57, 0), - "location": "View3D > Add > Mesh > HoneyComb", - "description": "Adds HoneyComb Mesh", - "warning": "", - "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/" - "Scripts/Add_Mesh/HoneyComb", - "category": "Add Mesh", -} ''' from math import pi, sin, cos diff --git a/add_mesh_pipe_joint.py b/add_mesh_extra_objects/add_mesh_pipe_joint.py index 717a0daa..e0dcc3e8 100644 --- a/add_mesh_pipe_joint.py +++ b/add_mesh_extra_objects/add_mesh_pipe_joint.py @@ -15,25 +15,15 @@ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ##### END GPL LICENSE BLOCK ##### - -bl_info = { +''' "name": "Pipe Joints", "author": "Buerbaum Martin (Pontiac)", "version": (0, 10, 7), - "blender": (2, 61, 0), - "location": "View3D > Add > Mesh > Pipe Joints", - "description": "Add different types of pipe joints", - "warning": "", - "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/" - "Scripts/Add_Mesh/Add_Pipe_Joints", - "category": "Add Mesh", -} - +''' import bpy from math import * from bpy.props import * - # Create a new mesh (object) from verts/edges/faces. # verts/edges/faces ... List of vertices/edges/faces for the # new mesh (as used in from_pydata). @@ -119,7 +109,6 @@ def createFaces(vertIdx1, vertIdx2, closed=False, flipped=False): return faces - class AddElbowJoint(bpy.types.Operator): # Create the vertices and polygons for a simple elbow (bent pipe). """Add an Elbow pipe mesh""" @@ -219,7 +208,6 @@ class AddElbowJoint(bpy.types.Operator): return {'FINISHED'} - class AddTeeJoint(bpy.types.Operator): # Create the vertices and polygons for a simple tee (T) joint. # The base arm of the T can be positioned in an angle if needed though. @@ -398,7 +386,6 @@ class AddTeeJoint(bpy.types.Operator): return {'FINISHED'} - class AddWyeJoint(bpy.types.Operator): """Add a Wye-Joint mesh""" bl_idname = "mesh.primitive_wye_joint_add" @@ -592,7 +579,6 @@ class AddWyeJoint(bpy.types.Operator): return {'FINISHED'} - class AddCrossJoint(bpy.types.Operator): """Add a Cross-Joint mesh""" # Create the vertices and polygons for a coss (+ or X) pipe joint. @@ -847,7 +833,6 @@ class AddCrossJoint(bpy.types.Operator): return {'FINISHED'} - class AddNJoint(bpy.types.Operator): """Add a N-Joint mesh""" # Create the vertices and polygons for a regular n-joint. @@ -1004,47 +989,4 @@ class AddNJoint(bpy.types.Operator): return {'FINISHED'} - -class INFO_MT_mesh_pipe_joints_add(bpy.types.Menu): - # Define the "Pipe Joints" menu - bl_idname = "INFO_MT_mesh_pipe_joints_add" - bl_label = "Pipe Joints" - - def draw(self, context): - layout = self.layout - layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("mesh.primitive_elbow_joint_add", - text="Pipe Elbow") - layout.operator("mesh.primitive_tee_joint_add", - text="Pipe T-Joint") - layout.operator("mesh.primitive_wye_joint_add", - text="Pipe Y-Joint") - layout.operator("mesh.primitive_cross_joint_add", - text="Pipe Cross-Joint") - layout.operator("mesh.primitive_n_joint_add", - text="Pipe N-Joint") - -################################ - - -# Define "Pipe Joints" menu -def menu_func(self, context): - self.layout.menu("INFO_MT_mesh_pipe_joints_add", icon="PLUGIN") - - -def register(): - bpy.utils.register_module(__name__) - - # Add "Pipe Joints" menu to the "Add Mesh" menu - bpy.types.INFO_MT_mesh_add.append(menu_func) - - -def unregister(): - bpy.utils.unregister_module(__name__) - - # Remove "Pipe Joints" menu from the "Add Mesh" menu. - bpy.types.INFO_MT_mesh_add.remove(menu_func) - - -if __name__ == "__main__": - register() +################################
\ No newline at end of file diff --git a/add_mesh_extra_objects/add_mesh_polysphere.py b/add_mesh_extra_objects/add_mesh_polysphere.py index b250063f..b01e741a 100644 --- a/add_mesh_extra_objects/add_mesh_polysphere.py +++ b/add_mesh_extra_objects/add_mesh_polysphere.py @@ -16,17 +16,9 @@ # # ##### END GPL LICENSE BLOCK ##### ''' -bl_info = { "name": "Add PolySphere", "author": "Andy Davies (metalliandy)", "version": (0,1,6), - "blender": (2, 62, 0), - "location": "View3D > Add > Mesh > PolySphere", - "description": "Adds a PolySphere (all quads) for sculpting", - "warning": "", - "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/" - "Scripts/Add_Mesh/Add_PolySphere", - "category": "Add Mesh"} ''' import bpy diff --git a/add_mesh_solid.py b/add_mesh_extra_objects/add_mesh_solid.py index a6e0b1bb..20584ea7 100644 --- a/add_mesh_solid.py +++ b/add_mesh_extra_objects/add_mesh_solid.py @@ -16,20 +16,11 @@ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ***** END GPL LICENCE BLOCK ***** - -bl_info = { +''' "name": "Regular Solids", "author": "DreamPainter", "version": (2, 0), - "blender": (2, 59, 0), - "location": "View3D > Add > Mesh > Solids", - "description": "Add a regular solid", - "warning": "", - "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/" - "Scripts/Add_Mesh/Add_Solid", - "category": "Add Mesh", -} - +''' import bpy from bpy.props import FloatProperty,EnumProperty,BoolProperty from math import sqrt @@ -509,93 +500,3 @@ class Solids(bpy.types.Operator): bpy.context.user_preferences.edit.use_global_undo = True return {'FINISHED'} - -class Solids_add_menu(bpy.types.Menu): - """Define the menu with presets""" - bl_idname = "Solids_add_menu" - bl_label = "Solids" - - def draw(self,context): - layout = self.layout - layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator(Solids.bl_idname, text = "Solid") - layout.menu(PlatonicMenu.bl_idname, text = "Platonic") - layout.menu(ArchiMenu.bl_idname, text = "Archimeadean") - layout.menu(CatalanMenu.bl_idname, text = "Catalan") - -class PlatonicMenu(bpy.types.Menu): - """Define Platonic menu""" - bl_idname = "Platonic_calls" - bl_label = "Platonic" - - def draw(self,context): - layout = self.layout - layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator(Solids.bl_idname, text = "Tetrahedron").source = "4" - layout.operator(Solids.bl_idname, text = "Hexahedron").source = "6" - layout.operator(Solids.bl_idname, text = "Octahedron").source = "8" - layout.operator(Solids.bl_idname, text = "Dodecahedron").source = "12" - layout.operator(Solids.bl_idname, text = "Icosahedron").source = "20" - -class ArchiMenu(bpy.types.Menu): - """Defines Achimedean preset menu""" - bl_idname = "Achimedean_calls" - bl_label = "Archimedean" - - def draw(self,context): - layout = self.layout - layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator(Solids.bl_idname, text = "Truncated Tetrahedron").preset = "t4" - layout.operator(Solids.bl_idname, text = "Cuboctahedron").preset = "r4" - layout.operator(Solids.bl_idname, text = "Truncated Cube").preset = "t6" - layout.operator(Solids.bl_idname, text = "Truncated Octahedron").preset = "t8" - layout.operator(Solids.bl_idname, text = "Rhombicuboctahedron").preset = "b6" - layout.operator(Solids.bl_idname, text = "Truncated Cuboctahedron").preset = "c6" - layout.operator(Solids.bl_idname, text = "Snub Cube").preset = "s6" - layout.operator(Solids.bl_idname, text = "Icosidodecahedron").preset = "r12" - layout.operator(Solids.bl_idname, text = "Truncated Dodecahedron").preset = "t12" - layout.operator(Solids.bl_idname, text = "Truncated Icosahedron").preset = "t20" - layout.operator(Solids.bl_idname, text = "Rhombicosidodecahedron").preset = "b12" - layout.operator(Solids.bl_idname, text = "Truncated Icosidodecahedron").preset = "c12" - layout.operator(Solids.bl_idname, text = "Snub Dodecahedron").preset = "s12" - -class CatalanMenu(bpy.types.Menu): - """Defines Catalan preset menu""" - bl_idname = "Catalan_calls" - bl_label = "Catalan" - - def draw(self, context): - layout = self.layout - layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator(Solids.bl_idname, text = "Triakis Tetrahedron").preset = "dt4" - layout.operator(Solids.bl_idname, text = "Rhombic Dodecahedron").preset = "dr4" - layout.operator(Solids.bl_idname, text = "Triakis Octahedron").preset = "dt6" - layout.operator(Solids.bl_idname, text = "Triakis Hexahedron").preset = "dt8" - layout.operator(Solids.bl_idname, text = "Deltoidal Icositetrahedron").preset = "db6" - layout.operator(Solids.bl_idname, text = "Disdyakis Dodecahedron").preset = "dc6" - layout.operator(Solids.bl_idname, text = "Pentagonal Icositetrahedron").preset = "ds6" - layout.operator(Solids.bl_idname, text = "Rhombic Triacontahedron").preset = "dr12" - layout.operator(Solids.bl_idname, text = "Triakis Icosahedron").preset = "dt12" - layout.operator(Solids.bl_idname, text = "Pentakis Dodecahedron").preset = "dt20" - layout.operator(Solids.bl_idname, text = "Deltoidal Hexecontahedron").preset = "db12" - layout.operator(Solids.bl_idname, text = "Disdyakis Triacontahedron").preset = "dc12" - layout.operator(Solids.bl_idname, text = "Pentagonal Hexecontahedron").preset = "ds12" - -def menu_func(self, context): - self.layout.menu(Solids_add_menu.bl_idname, icon="PLUGIN") - - -def register(): - bpy.utils.register_module(__name__) - - bpy.types.INFO_MT_mesh_add.append(menu_func) - - -def unregister(): - bpy.utils.unregister_module(__name__) - - bpy.types.INFO_MT_mesh_add.remove(menu_func) - - -if __name__ == "__main__": - register() diff --git a/add_mesh_extra_objects/add_mesh_supertoroid.py b/add_mesh_extra_objects/add_mesh_supertoroid.py index 425d2bd3..c9fd8f99 100644 --- a/add_mesh_extra_objects/add_mesh_supertoroid.py +++ b/add_mesh_extra_objects/add_mesh_supertoroid.py @@ -1,14 +1,7 @@ ''' -bl_info = { "name": "Add Mesh: SuperToroid", "author": "DreamPainter", "version": (1, 0, 0), - "blender": (2, 53, 0), - "location": "View3D > Add > Mesh > SuperToroid", - "description": "Add a SuperToroid mesh", - "url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/" \ - "Scripts/Add_Mesh/", # no url - "category": "Add Mesh"} ''' import bpy from bpy.props import FloatProperty,BoolProperty,IntProperty @@ -212,18 +205,3 @@ class add_supertoroid(bpy.types.Operator): return {'FINISHED'} -''' -menu_func = lambda self, context: self.layout.operator(add_supertoroid.bl_idname, - text = "SuperToroid", icon = 'PLUGIN') - -def register(): - bpy.types.register(add_supertoroid) - bpy.types.INFO_MT_mesh_add.append(menu_func) - -def unregister(): - bpy.types.unregister(add_supertoroid) - bpy.types.INFO_MT_mesh_add.remove(menu_func) - -if __name__ == "__main__": - register() -''' diff --git a/add_mesh_extra_objects/add_mesh_teapot.py b/add_mesh_extra_objects/add_mesh_teapot.py index cdbdf7ee..d7cdfcd5 100644 --- a/add_mesh_extra_objects/add_mesh_teapot.py +++ b/add_mesh_extra_objects/add_mesh_teapot.py @@ -1,4 +1,4 @@ -'''# +---------------------------------------------------------+ +# +---------------------------------------------------------+ # | Copyright (c) 2005-2010 Anthony D'Agostino | # | http://home.comcast.net/~chronosphere | # | scorpius@netzero.com | @@ -24,18 +24,7 @@ # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # ***** END GPL LICENCE BLOCK ***** - -bl_info = { - "name": "Teapot+", - "author": "Anthony D'Agostino", - "version": (1, 0), - "blender": (2, 57, 0), - "location": "View3D > Add > Mesh ", - "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/" - "Scripts/Add_Teapot", - "category": "Add Mesh", -} -''' +# "version": (1, 0, 0) import bpy from bpy.props import IntProperty @@ -46,7 +35,6 @@ import io import operator import functools - class AddTeapot(bpy.types.Operator): """Add a teapot mesh""" bl_idname = "mesh.primitive_teapot_add" @@ -70,24 +58,6 @@ class AddTeapot(bpy.types.Operator): obj = create_mesh_object(context, verts, [], faces, "Teapot") return {'FINISHED'} - -def menu_func(self, context): - self.layout.operator(AddTeapot.bl_idname, text="Teapot+", icon="MESH_CUBE") - - -def register(): - bpy.utils.register_module(__name__) - bpy.types.INFO_MT_mesh_add.append(menu_func) - - -def unregister(): - bpy.utils.unregister_module(__name__) - bpy.types.INFO_MT_mesh_add.remove(menu_func) - -if __name__ == "__main__": - register() - - def create_mesh_face_hack(faces): # FIXME, faces with duplicate vertices shouldn't be created in the first place. faces_copy = [] @@ -99,7 +69,6 @@ def create_mesh_face_hack(faces): faces_copy.append(f_copy) faces[:] = faces_copy - def create_mesh_object(context, verts, edges, faces, name): create_mesh_face_hack(faces) diff --git a/add_mesh_extra_objects/add_mesh_torusknot.py b/add_mesh_extra_objects/add_mesh_torusknot.py index e932adc8..3803ba62 100644 --- a/add_mesh_extra_objects/add_mesh_torusknot.py +++ b/add_mesh_extra_objects/add_mesh_torusknot.py @@ -1,4 +1,4 @@ -'''# +---------------------------------------------------------+ +# +---------------------------------------------------------+ # | Copyright (c) 2005-2010 Anthony D'Agostino | # | http://home.comcast.net/~chronosphere | # | scorpius@netzero.com | @@ -24,18 +24,7 @@ # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # ***** END GPL LICENCE BLOCK ***** - -bl_info = { - "name": "Torus Knot", - "author": "Anthony D'Agostino", - "version": (1, 0), - "blender": (2, 57, 0), - "location": "View3D > Add > Mesh ", - "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/" - "Scripts/Add_TorusKnot", - "category": "Add Mesh", -} -''' +# "version": (1, 0, 0) import bpy, mathutils, math def create_mesh_object(context, verts, edges, faces, name): @@ -135,18 +124,3 @@ class AddTorusKnot(bpy.types.Operator): self.resolution) obj = create_mesh_object(context, verts, [], faces, "Torus Knot") return {'FINISHED'} -''' -def menu_func(self, context): - self.layout.operator(AddTorusKnot.bl_idname, text="Torus Knot", icon="MESH_CUBE") - -def register(): - bpy.utils.register_module(__name__) - bpy.types.INFO_MT_mesh_add.append(menu_func) - -def unregister(): - bpy.utils.unregister_module(__name__) - bpy.types.INFO_MT_mesh_add.remove(menu_func) - -if __name__ == "__main__": - register() -''' diff --git a/add_mesh_extra_objects/add_mesh_twisted_torus.py b/add_mesh_extra_objects/add_mesh_twisted_torus.py index fd3cb5e8..2392a293 100644 --- a/add_mesh_extra_objects/add_mesh_twisted_torus.py +++ b/add_mesh_extra_objects/add_mesh_twisted_torus.py @@ -19,35 +19,22 @@ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ***** END GPL LICENCE BLOCK ***** -""" -bl_info = { - "name": "Twisted Torus", - "author": "Paulo_Gomes", - "version": (0, 11, 1), - "blender": (2, 57, 0), - "location": "View3D > Add > Mesh ", - "description": "Adds a mesh Twisted Torus to the Add Mesh menu", - "warning": "", - "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/" - "Scripts/Add_Mesh/Add_Twisted_Torus", - "category": "Add Mesh", -} +#twisted torus by Paulo_Gomes +# "version": (0, 11, 1) +""" Usage: * Launch from Add Mesh menu * Modify parameters as desired or keep defaults """ - - import bpy from bpy.props import * from mathutils import * from math import cos, sin, pi - # Create a new mesh (object) from verts/edges/faces. # verts/edges/faces ... List of vertices/edges/faces for the # new mesh (as used in from_pydata). @@ -79,6 +66,7 @@ def create_mesh_object(context, verts, edges, faces, name): # a fan/star of faces. # Note: If both vertex idx list are the same length they have # to have at least 2 vertices. + def createFaces(vertIdx1, vertIdx2, closed=False, flipped=False): faces = [] @@ -134,7 +122,6 @@ def createFaces(vertIdx1, vertIdx2, closed=False, flipped=False): return faces - def add_twisted_torus(major_rad, minor_rad, major_seg, minor_seg, twists): PI_2 = pi * 2.0 z_axis = (0.0, 0.0, 1.0) @@ -179,7 +166,6 @@ def add_twisted_torus(major_rad, minor_rad, major_seg, minor_seg, twists): return verts, faces - class AddTwistedTorus(bpy.types.Operator): """Add a torus mesh""" bl_idname = "mesh.primitive_twisted_torus_add" @@ -245,4 +231,3 @@ class AddTwistedTorus(bpy.types.Operator): obj = create_mesh_object(context, verts, [], faces, "TwistedTorus") return {'FINISHED'} - |