Эх сурвалжийг харах

perform baking on armature with non-inheirt bones

Jason0214 6 жил өмнө
parent
commit
3c1df89581

+ 12 - 5
io_scene_godot/converters/animation/animation_data.py

@@ -53,11 +53,18 @@ class ObjectAnimationExporter:
     def check_baking_condition(self, action_type):
     def check_baking_condition(self, action_type):
         """Check whether the animated object has any constraint and
         """Check whether the animated object has any constraint and
         thus need to do baking, if needs, some states would be set"""
         thus need to do baking, if needs, some states would be set"""
-        has_obj_cst = check_object_constraint(self.blender_object)
-        has_pose_cst = check_pose_constraint(self.blender_object)
-        self.need_baking = (
-            action_type == 'transform' and (has_obj_cst or has_pose_cst)
-        )
+        if action_type == 'transform':
+            has_obj_cst = check_object_constraint(self.blender_object)
+            has_pose_cst = check_pose_constraint(self.blender_object)
+            has_non_inherit_bone = False
+            if isinstance(self.blender_object.data, bpy.types.Armature):
+                for rbone in self.blender_object.data.bones:
+                    if (rbone.use_inherit_rotation is False or
+                            rbone.use_inherit_scale is False):
+                        has_non_inherit_bone = True
+                        break
+            self.need_baking = (
+                has_obj_cst or has_pose_cst or has_non_inherit_bone)
 
 
     def preprocess_nla_tracks(self, blender_object):
     def preprocess_nla_tracks(self, blender_object):
         """Iterative through nla tracks, separately store mute and unmuted
         """Iterative through nla tracks, separately store mute and unmuted

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 15 - 0
tests/reference_exports/armature/non-inherit-bone.escn


BIN
tests/test_scenes/armature/non-inherit-bone.blend


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно