Skip to content

Instantly share code, notes, and snippets.

@zerosign
Created April 25, 2013 12:24
Show Gist options
  • Save zerosign/5459312 to your computer and use it in GitHub Desktop.
Save zerosign/5459312 to your computer and use it in GitHub Desktop.
import bpy
from bpy.types import (
Operator
)
from bpy.props import (
FloatProperty,
IntProperty,
StringProperty,
BoolProperty
)
class ONIMATUR_CreateArmatureFromMesh(Operator):
bl_idname = "onimatur.create_armature_from_mesh"
bl_label = "Create Armature From Mesh"
bl_options = {'REGISTER', 'UNDO', 'PRESET'}
@classmethod
def poll(self, context):
return True
def execute(self, context):
return {'FINISHED'}
def draw(self, context):
layout = self.layout
box = layout.box()
class ONIMATUR_CreateHandArmature(Operator):
bl_idname = "onimatur.crete_hand_armature"
bl_label = "Create Hand Armature"
bl_options = {'REGISTER', 'UNDO', 'PRESET'}
use_IK_enable_armature = BoolProperty(name = 'Use IK enable Armature',
default=False)
def draw(self, context):
layout = self.layout
box = layout.box()
def execute(self, context):
return {'FINISHED'}
class ONIMATUR_CreateHumanArmature(Operator):
bl_idname = "onimatur.create_human_armature"
bl_label = "Create Human Armature"
bl_options = {'REGISTER', 'UNDO', 'PRESET'}
use_IK_enable_armature = BoolProperty(name = 'Use IK enable Armature',
default=False)
def execute(self, context):
return {'FINISHED'}
def draw(self, context):
layout = self.layout
box = layout.box()
#box.prop(self, 'automatic_create_armature')
box.prop(self, 'use_IK_enable_armature')
@classmethod
def poll(self, context):
if context.object == None:
return False
elif context/object.select and context.object.type == 'MESH':
return True
def menu_create_hand_armature(self, context):
self.layout.operator(ONIMATUR_CreateHandArmature.bl_idname,
icon='ARMATURE')
return
def menu_create_human_armature(self, context):
self.layout.operator(ONIMATUR_CreateHumanArmature.bl_idname,
icon='ARMATURE')
return
def register():
bpy.utils.register_class(ONIMATUR_CreateHandArmature)
bpy.utils.register_class(ONIMATUR_CreateHumanArmature)
bpy.types.INFO_MT_armature_add.append(menu_create_human_armature)
bpy.utils.register_module(__name__)
def unregister():
bpy.utils.INFO_MT_armature_add.remove(menu_create_human_armature)
bpy.utils.unregister_module(__name__)
if __name__ == '__main__':
register()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment