Forráskód Böngészése

Fixing PyAssimp misalignment errors with certain structures (#6001)

* Fixed misaligned structures in PyAssimp

* Added documentation on missing aiBone fields
fishguy6564 5 hónapja
szülő
commit
b58afb7b83

+ 9 - 0
port/PyAssimp/pyassimp/postprocess.py

@@ -232,6 +232,15 @@ aiProcess_RemoveRedundantMaterials = 0x1000
 #
 aiProcess_FixInfacingNormals = 0x2000
 
+## This step generically populates aiBone->mArmature and aiBone->mNode generically
+#  The point of these is it saves you later having to calculate these elements
+#  This is useful when handling rest information or skin information
+#  If you have multiple armatures on your models we strongly recommend enabling this
+#  Instead of writing your own multi-root, multi-armature lookups we have done the
+#  hard work for you :)
+
+aiProcess_PopulateArmatureData = 0x4000
+
 ## <hr>This step splits meshes with more than one primitive type in 
 #  homogeneous sub-meshes. 
 #

+ 11 - 0
port/PyAssimp/pyassimp/structs.py

@@ -555,6 +555,14 @@ class Bone(Structure):
             #  The maximum value for this member is
             #AI_MAX_BONE_WEIGHTS.
             ("mNumWeights", c_uint),
+            
+            # The bone armature node - used for skeleton conversion
+            # you must enable aiProcess_PopulateArmatureData to populate this
+            ("mArmature", POINTER(Node)),
+            
+            # The bone node in the scene - used for skeleton conversion
+            # you must enable aiProcess_PopulateArmatureData to populate this
+            ("mNode", POINTER(Node)),
 
             #  The vertices affected by this bone
             ("mWeights", POINTER(VertexWeight)),
@@ -857,6 +865,9 @@ class QuatKey(Structure):
 
             # The value of this key
             ("mValue", Quaternion),
+
+            # The interpolation setting of this key
+            ("mInterpolation", c_uint32)
         ]
 
 class MeshMorphKey(Structure):