Skip to content

Instantly share code, notes, and snippets.

@adhihargo
Created July 9, 2013 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adhihargo/5962151 to your computer and use it in GitHub Desktop.
Save adhihargo/5962151 to your computer and use it in GitHub Desktop.
Blender script to add primitive object with low initial vertex count. Uncomment `bl_info` block to turn into an addon.
import bpy
# bl_info = {
# "name": "Low Vertex Count Objects",
# "author": "",
# "version": (1, 0),
# "blender": (2, 63, 0),
# "location": "View3D > Add",
# "description": "Add primitive object with low initial vertex count",
# "warning": "",
# "wiki_url": "",
# "tracker_url": "",
# "category": "Add Mesh"}
def custom_object_add(self, context):
layout = self.layout
layout.menu("INFO_MT_low_vertex_mesh_add", icon='PLUGIN')
class INFO_MT_low_vertex_mesh_add(bpy.types.Menu):
bl_idname = "INFO_MT_low_vertex_mesh_add"
bl_label = "Low Vertex Mesh"
def draw(self, context):
layout = self.layout
prop = layout.operator("mesh.primitive_circle_add", icon='MESH_CIRCLE', text="Circle (12)")
prop.vertices = 12
prop = layout.operator("mesh.primitive_cone_add", icon='MESH_CONE', text="Cone (12)")
prop.vertices = 12
prop = layout.operator("mesh.primitive_cylinder_add", icon='MESH_CYLINDER', text="Cylinder (12)")
prop.vertices = 12
prop = layout.operator("mesh.primitive_uv_sphere_add", icon='MESH_UVSPHERE', text="UV Sphere (8x4)")
prop.segments = 8
prop.ring_count = 4
def register():
bpy.utils.register_module(__name__)
bpy.types.INFO_MT_add.append(custom_object_add)
def unregister():
bpy.utils.unregister_module(__name__)
bpy.types.INFO_MT_add.remove(custom_object_add)
if __name__ == '__main__':
register()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment