OSDN Git Service

terminate string with '\n'.
authorousttrue <ousttrue@gmail.com>
Mon, 24 May 2010 11:47:10 +0000 (20:47 +0900)
committerousttrue <ousttrue@gmail.com>
Mon, 24 May 2010 11:47:10 +0000 (20:47 +0900)
src/pmd.cpp
swig/blender24/pmd_export.py

index 1f1eed5..2a1c0c0 100644 (file)
@@ -637,7 +637,7 @@ bool IO::write(binary::IWriter &w)
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                };
-               sprintf(buf, "%s\r", bone_display_name_list[i].c_str());
+               sprintf(buf, "%s", bone_display_name_list[i].c_str());
                w.writeArray<char>(buf, 50);
        }
 
index bf01d56..bc7192c 100644 (file)
@@ -484,7 +484,7 @@ class BoneBuilder(object):
 
         if len(b.children)==0:
             # 末端の非表示ボーン
-            bone=Bone(b.name+'_tail', b.tail['ARMATURESPACE'])
+            bone=Bone(b.name+'_t', b.tail['ARMATURESPACE'])
             bone.type=7
             self.__addBone(bone)
             assert(parent)
@@ -589,7 +589,9 @@ class PmdExporter(object):
         # bones
         for b in builder.bones:
             bone=io.addBone()
-            bone.name=b.name
+            bone_name="%s\n" % b.name
+            assert(len(bone_name)<20)
+            bone.name=bone_name
             bone.type=b.type
             bone.parent_index=b.parent_index if b.parent_index!=None else 0xFFFF
             bone.tail_index=b.tail_index if b.tail_index!=None else 0
@@ -617,7 +619,7 @@ class PmdExporter(object):
         for i, m in enumerate(self.oneSkinMesh.morphList):
             # morph
             morph=io.addMorph()
-            morph.name=m.name
+            morph.name="%s\n" % m.name
             morph.type=m.type
             for index, offset in zip(m.indices, m.offsets):
                 # convert right-handed z-up to left-handed y-up
@@ -629,7 +631,7 @@ class PmdExporter(object):
                 io.face_list.append(i)
 
         # ボーン枠
-        io.addBoneNameList("bones")
+        io.addBoneNameList("bones\n")
         display=1
         for i, b in enumerate(builder.bones):
             if b.type in [6, 7]: