OSDN Git Service

fix mqo hierarchy. fix pmd constraint name.
[meshio/meshio.git] / swig / blender / pmd_export.py
index 1d863cc..73d71f1 100644 (file)
@@ -35,6 +35,7 @@ RIGID_LINEAR_DAMPING='rigid_linear_damping'
 RIGID_ANGULAR_DAMPING='rigid_angular_damping'
 RIGID_RESTITUTION='rigid_restitution'
 RIGID_FRICTION='rigid_friction'
+CONSTRAINT_NAME='constraint_name'
 CONSTRAINT_A='const_a'
 CONSTRAINT_B='const_b'
 CONSTRAINT_POS_MIN='const_pos_min'
@@ -974,7 +975,7 @@ class PmdExporter(object):
         # constraint
         for obj in self.oneSkinMesh.constraints:
             constraint=io.addConstraint()
-            constraint.setName(obj.name[1:].encode('cp932'))
+            constraint.setName(obj[CONSTRAINT_NAME].encode('cp932'))
             constraint.rigidA=rigidNameMap[obj[CONSTRAINT_A]]
             constraint.rigidB=rigidNameMap[obj[CONSTRAINT_B]]
             constraint.pos.x=obj.location[0]