Explorar o código

explicitly set bones are in world transform

Jason0214 %!s(int64=6) %!d(string=hai) anos
pai
achega
22d2f396d9

+ 3 - 0
io_scene_godot/converters/armature.py

@@ -39,6 +39,7 @@ def find_skeletion_node(node):
 
 class Bone:
     """A Bone has almost same attributes as Godot bones"""
+
     def __init__(self, bone_name, parent_name):
         # id assigned when add to skeleton
         self.id = None
@@ -97,6 +98,8 @@ class SkeletonNode(NodeTemplate):
 
     def __init__(self, name, parent):
         super().__init__(name, "Skeleton", parent)
+        self['bones_in_world_transform'] = True
+
         # Mapping from blender bone name to godot bone id and name
         self.bones = dict()
 

+ 1 - 0
tests/reference_exports/action_animation/animation_bone_transform.escn

@@ -37,6 +37,7 @@ surfaces/0 = {
 
 [node name="Armature" type="Skeleton" parent="."]
 
+bones_in_world_transform = true
 transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0251681, 0.264265, -0.0718237)
 bones/0/name = "Bone"
 bones/0/parent = -1

+ 1 - 0
tests/reference_exports/action_with_constraint/bone_attachment_ik.escn

@@ -56,6 +56,7 @@ surfaces/0 = {
 
 [node name="Armature" type="Skeleton" parent="."]
 
+bones_in_world_transform = true
 transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0)
 bones/0/name = "Bone"
 bones/0/parent = -1

+ 1 - 0
tests/reference_exports/action_with_constraint/constraint_external_IK.escn

@@ -60,6 +60,7 @@ anims/EmptyAction.001 = SubResource(1)
 
 [node name="Armature" type="Skeleton" parent="."]
 
+bones_in_world_transform = true
 transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0)
 bones/0/name = "Bone.001"
 bones/0/parent = -1

+ 1 - 0
tests/reference_exports/action_with_constraint/constraint_internal_IK.escn

@@ -41,6 +41,7 @@ surfaces/0 = {
 
 [node name="Armature" type="Skeleton" parent="."]
 
+bones_in_world_transform = true
 transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.00940586, -0.697982, 0.106085)
 bones/0/name = "Bone"
 bones/0/parent = -1

+ 1 - 0
tests/reference_exports/action_with_constraint/constraint_with_undeform_bone.escn

@@ -43,6 +43,7 @@ surfaces/0 = {
 
 [node name="Armature" type="Skeleton" parent="."]
 
+bones_in_world_transform = true
 transform = Transform(0.999933, -0.0107949, 0.0042215, 0.0107736, 0.999929, 0.0050429, -0.00427564, -0.00499708, 0.999978, 0.017087, 0.00610369, 0.00843611)
 bones/0/name = "Bone"
 bones/0/parent = -1

+ 1 - 0
tests/reference_exports/action_with_constraint/stashed_constraint.escn

@@ -41,6 +41,7 @@ surfaces/0 = {
 
 [node name="Armature" type="Skeleton" parent="."]
 
+bones_in_world_transform = true
 transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.00940586, -0.697982, 0.106085)
 bones/0/name = "Bone"
 bones/0/parent = -1

+ 1 - 0
tests/reference_exports/armature/armature_bone_attachment.escn

@@ -23,6 +23,7 @@ surfaces/0 = {
 
 [node name="Armature" type="Skeleton" parent="."]
 
+bones_in_world_transform = true
 transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, -0.0219986, 0.0125825, 0.0343127)
 bones/0/name = "Bone"
 bones/0/parent = -1

+ 1 - 0
tests/reference_exports/armature/armature_illegal_bone_name.escn

@@ -52,6 +52,7 @@ surfaces/0 = {
 
 [node name="Armature" type="Skeleton" parent="."]
 
+bones_in_world_transform = true
 transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, -0.100641, -0.755338, 0.951702)
 bones/0/name = "Bone"
 bones/0/parent = -1

+ 1 - 0
tests/reference_exports/armature/armature_with_mesh.escn

@@ -23,6 +23,7 @@ surfaces/0 = {
 
 [node name="Armature001" type="Skeleton" parent="."]
 
+bones_in_world_transform = true
 transform = Transform(0.815074, 0.0, 0.0, 0.0, 0.815074, 0.0, 0.0, 0.0, 0.815074, -0.0358698, -0.829927, 0.444204)
 bones/0/name = "Bone.001"
 bones/0/parent = -1

+ 2 - 0
tests/reference_exports/armature/armature_with_non_deform_bone.escn

@@ -74,6 +74,7 @@ surfaces/0 = {
 
 [node name="Armature001" type="Skeleton" parent="."]
 
+bones_in_world_transform = true
 transform = Transform(0.634991, -0.724599, -0.267849, 0.526815, 0.65976, -0.535894, 0.565024, 0.199181, 0.800671, -3.39219, -0.416292, -3.02261)
 bones/0/name = "Bone"
 bones/0/parent = -1
@@ -108,6 +109,7 @@ transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 2.98023e-08, -5.96046e-08, 2.9802
 
 [node name="Armature" type="Skeleton" parent="."]
 
+bones_in_world_transform = true
 transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, -0.826031, 0.0)
 bones/0/name = "Bone.001"
 bones/0/parent = -1

+ 1 - 0
tests/reference_exports/armature/armature_with_other_vertex_groups.escn

@@ -23,6 +23,7 @@ surfaces/0 = {
 
 [node name="Armature" type="Skeleton" parent="."]
 
+bones_in_world_transform = true
 transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.050247, 0.411022, -0.00201135)
 bones/0/name = "Bone"
 bones/0/parent = -1

+ 1 - 0
tests/reference_exports/armature/armature_with_physics.escn

@@ -45,6 +45,7 @@ shape = SubResource(1)
 
 [node name="Rig" type="Skeleton" parent="PhysicsPhysics/PhysicsCollision"]
 
+bones_in_world_transform = true
 transform = Transform(1.0, 0.0, 0.0, 0.0, 7.54979e-08, -1.0, 0.0, 1.0, 7.54979e-08, 0.0, -5.28485e-08, -0.7)
 bones/0/name = "Bone"
 bones/0/parent = -1

+ 1 - 0
tests/reference_exports/armature/armature_with_pose.escn

@@ -23,6 +23,7 @@ surfaces/0 = {
 
 [node name="Armature001" type="Skeleton" parent="."]
 
+bones_in_world_transform = true
 transform = Transform(0.815074, 0.0, 0.0, 0.0, 0.815074, 0.0, 0.0, 0.0, 0.815074, -0.0358698, -0.829927, 0.444204)
 bones/0/name = "Bone.001"
 bones/0/parent = -1

+ 1 - 0
tests/reference_exports/armature/just_armature.escn

@@ -6,6 +6,7 @@
 
 [node name="Armature" type="Skeleton" parent="."]
 
+bones_in_world_transform = true
 transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0)
 bones/0/name = "Bone"
 bones/0/parent = -1