OSDN Git Service

fix bone tail.
[meshio/meshio.git] / swig / blender / pmd_import.py
index 192e995..206a614 100755 (executable)
@@ -55,6 +55,7 @@ CONSTRAINT_ROT_MIN='const_rot_min'
 CONSTRAINT_ROT_MAX='const_rot_max'
 CONSTRAINT_SPRING_POS='const_spring_pos'
 CONSTRAINT_SPRING_ROT='const_spring_rot'
+TOON_TEXTURE_OBJECT='ToonTextures'
 
 
 ###############################################################################
@@ -207,8 +208,8 @@ def get_group_name(g):
 
 
 def __importToonTextures(io, tex_dir):
-    mesh, meshObject=bl.mesh.create('ToonTextures')
-    material=bl.material.create('ToonTextures')
+    mesh, meshObject=bl.mesh.create(TOON_TEXTURE_OBJECT)
+    material=bl.material.create(TOON_TEXTURE_OBJECT)
     bl.mesh.addMaterial(mesh, material)
     for i in range(10):
         t=io.getToonTexture(i)
@@ -326,6 +327,7 @@ def __build(armature, b, p, parent):
     bone=bl.armature.createBone(armature, name)
 
     if parent and (b.tail_index==0 or b.type==6 or b.type==7 or b.type==9):
+        # 先端ボーン
         bone.head = bl.createVector(*convert_coord(b.pos))
         bone.tail=bone.head+bl.createVector(0, 1, 0)
         bone.parent=parent