OSDN Git Service

implement vertex attributes and face attributes.
[meshio/pymeshio.git] / blender26-meshio / import_pmd.py
index ac6323e..c1fc748 100644 (file)
@@ -133,7 +133,7 @@ def to_radian(degree):
 
 
 def get_bone_name(l, index):
-    if index==0xFFFF:
+    if index==-1:
         return l.bones[0].name.decode('cp932')
 
     if index < len(l.bones):
@@ -303,7 +303,8 @@ def __importArmature(l):
             effector_name=l.bones[ik.index].name.decode('cp932')
 
         constraint=bl.armature.createIkConstraint(armature_object,
-                p_bone, effector_name, ik)
+                p_bone, effector_name, 
+                ik.children, ik.weight, ik.iterations)
 
     bl.armature.makeEditable(armature_object)
     bl.armature.update(armature)
@@ -379,7 +380,7 @@ def __import16MaerialAndMesh(meshObject, l,
                 material,
                 bl.material.getTexture(
                     toon_material,
-                    0 if m.toon_index==0xFF else m.toon_index
+                    0 if m.toon_index==-1 else m.toon_index
                     ),
                 False)
 
@@ -643,7 +644,7 @@ def __importRigidBodies(io):
     material=bl.material.create('rigidBody')
     rigidMeshes=[]
     for i, rigid in enumerate(io.rigidbodies):
-        if rigid.bone_index==0xFFFF:
+        if rigid.bone_index==-1:
             # no reference bone
             bone=io.bones[0]
         else: