OSDN Git Service

fix pmd_export.
authorousttrue <ousttrue@gmail.com>
Tue, 29 Jun 2010 15:04:05 +0000 (00:04 +0900)
committerousttrue <ousttrue@gmail.com>
Tue, 29 Jun 2010 15:04:05 +0000 (00:04 +0900)
swig/blender/pmd_export.py
swig/blender/pmd_import.py

index d3a9a1e..d473d7a 100644 (file)
@@ -21,6 +21,7 @@ This script exports a pmd model.
 1.2 20100616: implement rigid body.
 1.3 20100619: fix rigid body, bone weight.
 1.4 20100626: refactoring.
+1.5 20100629: sphere map.
 """
 
 MMD_SHAPE_GROUP_NAME='_MMD_SHAPE'
@@ -534,6 +535,7 @@ class OneSkinMesh(object):
                 if v[0]==morph.name:
                     return i
             print(morph)
+            return len(englishmap.skinMap)
         if isBlender24():
             self.morphList.sort(lambda l, r: getIndex(l)-getIndex(r))
         else:
@@ -687,6 +689,7 @@ class BoneBuilder(object):
                 if k_v[0]==bone.name:
                     return i
             print(bone)
+            return len(boneMap)
 
         if isBlender24():
             self.bones.sort(lambda l, r: getIndex(l)-getIndex(r))
@@ -863,6 +866,8 @@ class PmdExporter(object):
             # name
             boneNameMap[b.name]=i
             v=englishmap.getUnicodeBoneName(b.name)
+            if not v:
+                v=[b.name, b.name]
             assert(v)
             cp932=v[1].encode('cp932')
             assert(len(cp932)<20)
@@ -909,6 +914,8 @@ class PmdExporter(object):
             morph=io.addMorph()
 
             v=englishmap.getUnicodeSkinName(m.name)
+            if not v:
+                v=[m.name, m.name, 0]
             assert(v)
             cp932=v[1].encode('cp932')
             morph.setName(cp932)
@@ -1095,7 +1102,7 @@ def getBoneDisplayGroup(bone):
             return index
         index+=1
     print(bone)
-    return -1
+    return 0
 
 
 def __execute(filename, scene):
index 7332b53..2b2c056 100755 (executable)
@@ -14,20 +14,21 @@ pmd Importer
 
 This script imports a pmd into Blender for editing.
 
-0.1: 20091126: first implement.
-0.2: 20091209: implement IK.
-0.3: 20091210: implement morph target.
-0.4: 20100305: use english name.
-0.5: 20100408: cleanup not used vertices.
-0.6: 20100416: fix fornt face. texture load fail safe. add progress.
-0.7: 20100506: C extension.
-0.8: 20100521: add shape_key group.
-1.0: 20100530: add invisilbe bone tail(armature layer 2).
-1.1: 20100608: integrate 2.4 and 2.5.
-1.2: 20100616: implement rigid body.
-1.3: 20100619: fix for various models.
-1.4: 20100623: fix constraint name.
-1.5: 20100626: refactoring.
+0.1 20091126: first implement.
+0.2 20091209: implement IK.
+0.3 20091210: implement morph target.
+0.4 20100305: use english name.
+0.5 20100408: cleanup not used vertices.
+0.6 20100416: fix fornt face. texture load fail safe. add progress.
+0.7 20100506: C extension.
+0.8 20100521: add shape_key group.
+1.0 20100530: add invisilbe bone tail(armature layer 2).
+1.1 20100608: integrate 2.4 and 2.5.
+1.2 20100616: implement rigid body.
+1.3 20100619: fix for various models.
+1.4 20100623: fix constraint name.
+1.5 20100626: refactoring.
+1.6 20100629: sphere map.
 """
 
 MMD_SHAPE_GROUP_NAME='_MMD_SHAPE'