FBX: reformat props.
[blender-addons.git] / add_mesh_extra_objects / __init__.py
blob47bb1c1f856dba16debcb0e8527e22dea20095e8
1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
18 # Contributed to by
19 # Pontiac, Fourmadmen, varkenvarken, tuga3d, meta-androcto, metalliandy, dreampainter & cotejrp1#
21 bl_info = {
22 "name": "Extra Objects",
23 "author": "Multiple Authors",
24 "version": (0, 3),
25 "blender": (2, 63, 0),
26 "location": "View3D > Add > Mesh > Extra Objects",
27 "description": "Add extra object types",
28 "warning": "",
29 "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
30 "Scripts/Add_Mesh/Add_Extra",
31 "category": "Add Mesh",
35 if "bpy" in locals():
36 import imp
37 imp.reload(add_mesh_extra_objects)
38 imp.reload(add_mesh_twisted_torus)
39 imp.reload(add_mesh_gemstones)
40 imp.reload(add_mesh_gears)
41 imp.reload(add_mesh_3d_function_surface)
42 imp.reload(add_mesh_polysphere)
43 imp.reload(add_mesh_supertoroid)
44 imp.reload(add_mesh_pyramid)
45 imp.reload(add_mesh_torusknot)
46 imp.reload(add_mesh_honeycomb)
47 imp.reload(add_mesh_teapot)
48 else:
49 from . import add_mesh_extra_objects
50 from . import add_mesh_twisted_torus
51 from . import add_mesh_gemstones
52 from . import add_mesh_gears
53 from . import add_mesh_3d_function_surface
54 from . import add_mesh_polysphere
55 from . import add_mesh_supertoroid
56 from . import add_mesh_pyramid
57 from . import add_mesh_torusknot
58 from . import add_mesh_honeycomb
59 from . import add_mesh_teapot
60 import bpy
63 class INFO_MT_mesh_extras_add(bpy.types.Menu):
64 # Define the "Extras" menu
65 bl_idname = "INFO_MT_mesh_extra_objects_add"
66 bl_label = "Extra Objects"
68 def draw(self, context):
69 layout = self.layout
70 layout.operator_context = 'INVOKE_REGION_WIN'
71 layout.menu("INFO_MT_mesh_gemstones_add", text="Gemstones")
72 layout.menu("INFO_MT_mesh_gears_add", text="Gears")
73 layout.menu("INFO_MT_mesh_math_add", text="Math Function")
74 layout.menu("INFO_MT_mesh_basic_add", text="Basic Objects")
75 layout.menu("INFO_MT_mesh_torus_add", text="Torus Objects")
76 layout.menu("INFO_MT_mesh_misc_add", text="Misc Objects")
78 class INFO_MT_mesh_gemstones_add(bpy.types.Menu):
79 # Define the "Gemstones" menu
80 bl_idname = "INFO_MT_mesh_gemstones_add"
81 bl_label = "Gemstones"
83 def draw(self, context):
84 layout = self.layout
85 layout.operator_context = 'INVOKE_REGION_WIN'
86 layout.operator("mesh.primitive_diamond_add",
87 text="Diamond")
88 layout.operator("mesh.primitive_gem_add",
89 text="Gem")
92 class INFO_MT_mesh_gears_add(bpy.types.Menu):
93 # Define the "Gears" menu
94 bl_idname = "INFO_MT_mesh_gears_add"
95 bl_label = "Gears"
97 def draw(self, context):
98 layout = self.layout
99 layout.operator_context = 'INVOKE_REGION_WIN'
100 layout.operator("mesh.primitive_gear",
101 text="Gear")
102 layout.operator("mesh.primitive_worm_gear",
103 text="Worm")
105 class INFO_MT_mesh_math_add(bpy.types.Menu):
106 # Define the "Math Function" menu
107 bl_idname = "INFO_MT_mesh_math_add"
108 bl_label = "Math Functions"
110 def draw(self, context):
111 layout = self.layout
112 layout.operator_context = 'INVOKE_REGION_WIN'
113 layout.operator("mesh.primitive_z_function_surface",
114 text="Z Math Surface")
115 layout.operator("mesh.primitive_xyz_function_surface",
116 text="XYZ Math Surface")
118 class INFO_MT_mesh_basic_add(bpy.types.Menu):
119 # Define the "Simple Objects" menu
120 bl_idname = "INFO_MT_mesh_basic_add"
121 bl_label = "Simple Objects"
123 def draw(self, context):
124 layout = self.layout
125 layout.operator_context = 'INVOKE_REGION_WIN'
126 layout.operator("mesh.primitive_sqorus_add",
127 text="Sqorus")
128 layout.operator("mesh.primitive_wedge_add")
129 layout.operator("mesh.primitive_star_add",
130 text="Star")
131 layout.operator("mesh.primitive_trapezohedron_add",
132 text="Trapezohedron")
133 layout.operator("mesh.primitive_polysphere_add",
134 text="Polysphere")
136 class INFO_MT_mesh_torus_add(bpy.types.Menu):
137 # Define the "Simple Objects" menu
138 bl_idname = "INFO_MT_mesh_torus_add"
139 bl_label = "Torus Objects"
141 def draw(self, context):
142 layout = self.layout
143 layout.operator_context = 'INVOKE_REGION_WIN'
144 layout.operator("mesh.primitive_twisted_torus_add",
145 text="Twisted Torus")
146 layout.operator("mesh.primitive_supertoroid_add",
147 text="Supertoroid")
148 layout.operator("mesh.primitive_torusknot_add",
149 text="Torus Knot")
151 class INFO_MT_mesh_misc_add(bpy.types.Menu):
152 # Define the "Simple Objects" menu
153 bl_idname = "INFO_MT_mesh_misc_add"
154 bl_label = "Misc Objects"
156 def draw(self, context):
157 layout = self.layout
158 layout.operator_context = 'INVOKE_REGION_WIN'
159 layout.operator("mesh.primitive_steppyramid_add",
160 text="Step Pyramid")
161 layout.operator("mesh.honeycomb_add",
162 text="Honeycomb")
163 layout.operator("mesh.primitive_teapot_add",
164 text="Teapot+")
165 # Register all operators and panels
167 # Define "Extras" menu
168 def menu_func(self, context):
169 self.layout.menu("INFO_MT_mesh_extra_objects_add", icon="PLUGIN")
172 def register():
173 bpy.utils.register_module(__name__)
175 # Add "Extras" menu to the "Add Mesh" menu
176 bpy.types.INFO_MT_mesh_add.append(menu_func)
179 def unregister():
180 bpy.utils.unregister_module(__name__)
182 # Remove "Extras" menu from the "Add Mesh" menu.
183 bpy.types.INFO_MT_mesh_add.remove(menu_func)
185 if __name__ == "__main__":
186 register()