Переглянути джерело

Merge pull request #209 from Jason0214/support_non_inheirt_bone

perform baking on armature with non-inheirt bones
Lu Jiacheng 6 роки тому
батько
коміт
6accb46d61

+ 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


Деякі файли не було показано, через те що забагато файлів було змінено