X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=blender26-meshio%2Fbl.py;h=c668fa01bb9d81b4acab3709b71bbd3659d170ac;hb=36d9293a117d66fa5820d9ea4066e96dfd179815;hp=c7353ec7c7c3c70fc6fb24d5f7ffe7d3d6d2dcd5;hpb=56e8906d87aa792e34cd819396e4970f4aac7372;p=meshio%2Fpymeshio.git diff --git a/blender26-meshio/bl.py b/blender26-meshio/bl.py old mode 100755 new mode 100644 index c7353ec..c668fa0 --- a/blender26-meshio/bl.py +++ b/blender26-meshio/bl.py @@ -242,6 +242,8 @@ class object: @staticmethod def assignVertexGroup(o, name, index, weight): + if name not in o.vertex_groups: + o.vertex_groups.new(name) o.vertex_groups[name].add([index], weight, 'ADD') @staticmethod @@ -255,6 +257,7 @@ class object: g=pose.bone_groups.active g.name=name g.color_set=color_set + return g @staticmethod def boneGroups(o): @@ -595,15 +598,17 @@ class armature: bpy.ops.object.mode_set(mode='EDIT', toggle=False) @staticmethod - def createIkConstraint(armature_object, p_bone, effector_name, ik): + def createIkConstraint(armature_object, p_bone, effector_name, + chain, weight, iterations): constraint = p_bone.constraints.new('IK') - constraint.chain_count=len(ik.children) + constraint.chain_count=len(chain) constraint.target=armature_object constraint.subtarget=effector_name constraint.use_tail=False + # ToDo # not used. place folder when export. - constraint.weight=ik.weight - constraint.iterations=ik.iterations * 10 + #constraint.weight=weight + #constraint.iterations=iterations * 10 return constraint @staticmethod