OSDN Git Service

add none terminate IK tail.
authorousttrue <ousttrue@gmail.com>
Thu, 27 May 2010 11:03:17 +0000 (20:03 +0900)
committerousttrue <ousttrue@gmail.com>
Thu, 27 May 2010 11:03:17 +0000 (20:03 +0900)
include/text.h [changed mode: 0755->0644]
include/vmd.h [changed mode: 0755->0644]
swig/blender24/pmd_export.py

old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index d70361b..68fbc7c 100644 (file)
@@ -427,7 +427,14 @@ class BoneBuilder(object):
         if armatureObj:
             armature=armatureObj.getData()
             for b in armature.bones.values():
-                if not b.parent:
+                if b.name=='center':
+                    # root bone
+                    bone=Bone(b.name, b.head['ARMATURESPACE'])
+                    self.__addBone(bone)
+                    self.__getBone(bone, b)
+
+            for b in armature.bones.values():
+                if not b.parent and b.name!='center':
                     # root bone
                     bone=Bone(b.name, b.head['ARMATURESPACE'])
                     self.__addBone(bone)
@@ -467,6 +474,16 @@ class BoneBuilder(object):
                     self.ik_list.append(
                             IKSolver(target, link_tail, chainLength, 
                                 c[cSetting.ITERATIONS], c.influence))
+                    # 非末端IK
+                    target_tail=self.bones[target.tail_index]
+                    if target_tail.type!=7:
+                        target_bone=armature.bones[target.name]
+                        bone=Bone(target.name+'_t', 
+                                target_bone.tail['ARMATURESPACE'])
+                        bone.type=7
+                        self.__addBone(bone)
+                        bone.parent_index=target.index
+                        target.tail_index=bone.index
 
     def getIndex(self, bone):
         for i, b in enumerate(self.bones):
@@ -660,11 +677,11 @@ class PmdExporter(object):
                 io.addBoneDisplay(i, displayIndex)
 
         # English
-        io.english_name="blender export model"
+        io.english_name="blender export"
         io.english_coment="blender export"
 
         for i in range(10):
-            io.getToonTexture(i).name="toon%02d.bmp" % i
+            io.getToonTexture(i).name="toon%02d.bmp\n" % i
 
         # 書き込み
         return io.write(path.encode(FS_ENCODING))