Created
April 25, 2013 12:24
-
-
Save zerosign/5459312 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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