Ver código fonte

Support export of looped animations.

Animations with a name ending in _loop will be exported with loop=true.
Fixes #161.
Ryan Roden-Corrent 6 anos atrás
pai
commit
e819179edc
26 arquivos alterados com 63 adições e 0 exclusões
  1. 1 0
      io_scene_godot/converters/animation/serializer.py
  2. 1 0
      tests/reference_exports/action_animation/animation_bone_transform.escn
  3. 30 0
      tests/reference_exports/action_animation/animation_loop.escn
  4. 1 0
      tests/reference_exports/action_animation/animation_object_transform.escn
  5. 1 0
      tests/reference_exports/action_animation/animation_rotation_euler.escn
  6. 2 0
      tests/reference_exports/action_animation/animation_shared_action.escn
  7. 1 0
      tests/reference_exports/action_animation/physics_animation.escn
  8. 1 0
      tests/reference_exports/action_with_constraint/bone_attachment_ik.escn
  9. 2 0
      tests/reference_exports/action_with_constraint/constraint_external_IK.escn
  10. 1 0
      tests/reference_exports/action_with_constraint/constraint_internal_IK.escn
  11. 1 0
      tests/reference_exports/action_with_constraint/constraint_with_undeform_bone.escn
  12. 1 0
      tests/reference_exports/action_with_constraint/stashed_constraint.escn
  13. 1 0
      tests/reference_exports/armature/armature_illegal_bone_name.escn
  14. 2 0
      tests/reference_exports/armature/armature_with_non_deform_bone.escn
  15. 1 0
      tests/reference_exports/camera/animation_camera.escn
  16. 1 0
      tests/reference_exports/light/animation_sun.escn
  17. 5 0
      tests/reference_exports/light/animation_various_lights.escn
  18. 1 0
      tests/reference_exports/nla_animation/animation_multi_strip.escn
  19. 1 0
      tests/reference_exports/nla_animation/animation_with_empty_strip.escn
  20. 1 0
      tests/reference_exports/nla_animation/nla_with_active_action.escn
  21. 1 0
      tests/reference_exports/nla_animation/nla_with_no_active_action.escn
  22. 2 0
      tests/reference_exports/nla_animation/nla_with_stashed_action.escn
  23. 1 0
      tests/reference_exports/scene_animation/animation_parented_objects.escn
  24. 1 0
      tests/reference_exports/shape_key/animation_shapekey.escn
  25. 2 0
      tests/reference_exports/shape_key/animation_shapekey_with_transform.escn
  26. BIN
      tests/test_scenes/action_animation/animation_loop.blend

+ 1 - 0
io_scene_godot/converters/animation/serializer.py

@@ -489,6 +489,7 @@ class AnimationResource(InternalResource):
         super().__init__('Animation', name)
         self['step'] = 0.1
         self['length'] = 0
+        self['loop'] = name.endswith("_loop")
 
         # helper attributes, not exported to ESCN
         self.tracks = collections.OrderedDict()

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

@@ -5,6 +5,7 @@
 resource_name = "ArmatureAction001"
 step = 0.1
 length = 3.29167
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:Bone.002")
 tracks/0/interp = 1

Diferenças do arquivo suprimidas por serem muito extensas
+ 30 - 0
tests/reference_exports/action_animation/animation_loop.escn


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

@@ -24,6 +24,7 @@ surfaces/0 = {
 resource_name = "CubeAction"
 step = 0.1
 length = 5.95833
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:")
 tracks/0/interp = 1

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

@@ -24,6 +24,7 @@ surfaces/0 = {
 resource_name = "CubeAction"
 step = 0.1
 length = 7.04167
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:")
 tracks/0/interp = 1

+ 2 - 0
tests/reference_exports/action_animation/animation_shared_action.escn

@@ -24,6 +24,7 @@ surfaces/0 = {
 resource_name = "Cube001Action"
 step = 0.1
 length = 0.791667
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:")
 tracks/0/interp = 1
@@ -53,6 +54,7 @@ surfaces/0 = {
 resource_name = "Cube001Action"
 step = 0.1
 length = 0.791667
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:")
 tracks/0/interp = 1

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

@@ -34,6 +34,7 @@ points = PoolVector3Array(1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0
 resource_name = "Cube003Action001"
 step = 0.1
 length = 1.0
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:")
 tracks/0/interp = 1

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

@@ -5,6 +5,7 @@
 resource_name = "ArmatureAction"
 step = 0.1
 length = 2.45833
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:Bone")
 tracks/0/interp = 1

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

@@ -5,6 +5,7 @@
 resource_name = "EmptyAction001"
 step = 0.1
 length = 3.75
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:")
 tracks/0/interp = 1
@@ -15,6 +16,7 @@ tracks/0/keys = [0.291667, 1.0, 0.0191494, 2.43195, 0.42693, 0.0, 0.0, 0.0, 1.0,
 resource_name = "ArmatureAction"
 step = 0.1
 length = 7.83333
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:Bone.001")
 tracks/0/interp = 1

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

@@ -5,6 +5,7 @@
 resource_name = "ArmatureAction"
 step = 0.1
 length = 2.45833
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:Bone")
 tracks/0/interp = 1

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

@@ -5,6 +5,7 @@
 resource_name = "ArmatureAction"
 step = 0.1
 length = 3.29167
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:Bone")
 tracks/0/interp = 1

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

@@ -5,6 +5,7 @@
 resource_name = "ArmatureAction"
 step = 0.1
 length = 7.83333
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:Bone")
 tracks/0/interp = 1

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

@@ -5,6 +5,7 @@
 resource_name = "ArmatureAction"
 step = 0.1
 length = 2.45833
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:bone")
 tracks/0/interp = 1

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

@@ -5,6 +5,7 @@
 resource_name = "Armature001Action"
 step = 0.1
 length = 4.125
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:Bone.003")
 tracks/0/interp = 1
@@ -42,6 +43,7 @@ surfaces/0 = {
 resource_name = "ArmatureAction"
 step = 0.1
 length = 4.16667
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:Bone.001")
 tracks/0/interp = 1

+ 1 - 0
tests/reference_exports/camera/animation_camera.escn

@@ -24,6 +24,7 @@ surfaces/0 = {
 resource_name = "CameraAction"
 step = 0.1
 length = 2.875
+loop = false
 tracks/0/type = "value"
 tracks/0/path = NodePath(".:far")
 tracks/0/interp = 1

+ 1 - 0
tests/reference_exports/light/animation_sun.escn

@@ -24,6 +24,7 @@ surfaces/0 = {
 resource_name = "SunAction001"
 step = 0.1
 length = 4.58333
+loop = false
 tracks/0/type = "value"
 tracks/0/path = NodePath(".:light_energy")
 tracks/0/interp = 1

+ 5 - 0
tests/reference_exports/light/animation_various_lights.escn

@@ -5,6 +5,7 @@
 resource_name = "Spot003Action001"
 step = 0.1
 length = 1.66667
+loop = false
 tracks/0/type = "value"
 tracks/0/path = NodePath(".:spot_range")
 tracks/0/interp = 1
@@ -20,6 +21,7 @@ tracks/0/keys = {
 resource_name = "SpotTransformChangeAction"
 step = 0.1
 length = 1.66667
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:")
 tracks/0/interp = 1
@@ -49,6 +51,7 @@ surfaces/0 = {
 resource_name = "Spot001Action001"
 step = 0.1
 length = 1.91667
+loop = false
 tracks/0/type = "value"
 tracks/0/path = NodePath(".:shadow_enabled")
 tracks/0/interp = 0
@@ -92,6 +95,7 @@ surfaces/0 = {
 resource_name = "SpotAction"
 step = 0.1
 length = 1.66667
+loop = false
 tracks/0/type = "value"
 tracks/0/path = NodePath(".:spot_angle")
 tracks/0/interp = 1
@@ -107,6 +111,7 @@ tracks/0/keys = {
 resource_name = "LampAction001"
 step = 0.1
 length = 1.25
+loop = false
 tracks/0/type = "value"
 tracks/0/path = NodePath(".:light_color")
 tracks/0/interp = 1

+ 1 - 0
tests/reference_exports/nla_animation/animation_multi_strip.escn

@@ -24,6 +24,7 @@ surfaces/0 = {
 resource_name = "CubeAction"
 step = 0.1
 length = 3.79167
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:")
 tracks/0/interp = 1

+ 1 - 0
tests/reference_exports/nla_animation/animation_with_empty_strip.escn

@@ -24,6 +24,7 @@ surfaces/0 = {
 resource_name = "CubeAction001"
 step = 0.1
 length = 1.625
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:")
 tracks/0/interp = 1

+ 1 - 0
tests/reference_exports/nla_animation/nla_with_active_action.escn

@@ -24,6 +24,7 @@ surfaces/0 = {
 resource_name = "SuzanneAction001"
 step = 0.1
 length = 1.16667
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:")
 tracks/0/interp = 1

+ 1 - 0
tests/reference_exports/nla_animation/nla_with_no_active_action.escn

@@ -47,6 +47,7 @@ surfaces/0 = {
 resource_name = "KeyAction"
 step = 0.1
 length = 2.04167
+loop = false
 tracks/0/type = "value"
 tracks/0/path = NodePath(".:blend_shapes/Key 1")
 tracks/0/interp = 1

+ 2 - 0
tests/reference_exports/nla_animation/nla_with_stashed_action.escn

@@ -24,6 +24,7 @@ surfaces/0 = {
 resource_name = "SuzanneAction002"
 step = 0.1
 length = 1.20833
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:")
 tracks/0/interp = 1
@@ -34,6 +35,7 @@ tracks/0/keys = [0.0, 1.0, 0.826642, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0
 resource_name = "SuzanneAction"
 step = 0.1
 length = 1.16667
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:")
 tracks/0/interp = 1

+ 1 - 0
tests/reference_exports/scene_animation/animation_parented_objects.escn

@@ -24,6 +24,7 @@ surfaces/0 = {
 resource_name = "CubeAction"
 step = 0.1
 length = 3.29167
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath("Cube:")
 tracks/0/interp = 1

+ 1 - 0
tests/reference_exports/shape_key/animation_shapekey.escn

@@ -36,6 +36,7 @@ surfaces/0 = {
 resource_name = "Key002Action"
 step = 0.1
 length = 2.45833
+loop = false
 tracks/0/type = "value"
 tracks/0/path = NodePath(".:blend_shapes/Key 1")
 tracks/0/interp = 1

+ 2 - 0
tests/reference_exports/shape_key/animation_shapekey_with_transform.escn

@@ -36,6 +36,7 @@ surfaces/0 = {
 resource_name = "KeyAction"
 step = 0.1
 length = 1.20833
+loop = false
 tracks/0/type = "value"
 tracks/0/path = NodePath(".:blend_shapes/Key 1")
 tracks/0/interp = 1
@@ -51,6 +52,7 @@ tracks/0/keys = {
 resource_name = "SuzanneAction"
 step = 0.1
 length = 1.20833
+loop = false
 tracks/0/type = "transform"
 tracks/0/path = NodePath(".:")
 tracks/0/interp = 1

BIN
tests/test_scenes/action_animation/animation_loop.blend


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff