Skip to content
Snippets Groups Projects
Commit bacbe518 authored by Brendon Murphy's avatar Brendon Murphy
Browse files

remove from shift/a, add to "Create" tab. panel use fixes editmode context issues.

parent 33655612
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ bl_info = { ...@@ -20,7 +20,7 @@ bl_info = {
"name": "Add Chain", "name": "Add Chain",
"author": "Brian Hinton (Nichod)", "author": "Brian Hinton (Nichod)",
"version": (0, 1, 1), "version": (0, 1, 1),
"blender": (2, 68, 0), "blender": (2, 71, 0),
"location": "View3D > Add > Mesh", "location": "View3D > Add > Mesh",
"description": "Adds Chain with curve guide for easy creation", "description": "Adds Chain with curve guide for easy creation",
"warning": "", "warning": "",
...@@ -30,7 +30,7 @@ bl_info = { ...@@ -30,7 +30,7 @@ bl_info = {
} }
import bpy import bpy
from bpy.types import Operator, Panel
def Add_Chain(): def Add_Chain():
##Adds Empty to scene ##Adds Empty to scene
...@@ -137,36 +137,36 @@ def Add_Chain(): ...@@ -137,36 +137,36 @@ def Add_Chain():
##Change Curve Modifier Parameters ##Change Curve Modifier Parameters
cur.object = curv cur.object = curv
#makes AddChain an operator
class AddChain(bpy.types.Operator): class AddChain(bpy.types.Operator):
"""Add a Chain""" """Add a Chain"""
bl_idname = "mesh.primitive_chain_add" bl_idname = "mesh.primitive_chain_add"
bl_label = "Add Chain" bl_label = "Add Chain"
bl_options = {'REGISTER', 'UNDO'} bl_options = {'REGISTER', 'UNDO'}
def execute(self, context): def execute(self, context):
Add_Chain() Add_Chain()
return {'FINISHED'} return {'FINISHED'}
# Register the operator class add_chain(Panel):
def menu_func(self, context): bl_space_type = 'VIEW_3D'
self.layout.operator(AddChain.bl_idname, text="Chain", icon='PLUGIN') bl_region_type = 'TOOLS'
bl_category = 'Create'
bl_label = "Add Chain"
bl_context = "objectmode"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
layout.operator(AddChain.bl_idname, text="Chain")
def register(): def register():
bpy.utils.register_module(__name__) bpy.utils.register_module(__name__)
pass
# Add "Chain" menu to the "Add Mesh" menu.
bpy.types.INFO_MT_mesh_add.append(menu_func)
def unregister(): def unregister():
bpy.utils.unregister_module(__name__) bpy.utils.unregister_module(__name__)
pass
# Remove "Chain" menu from the "Add Mesh" menu.
bpy.types.INFO_MT_mesh_add.remove(menu_func)
if __name__ == "__main__": if __name__ == "__main__":
register() register()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment