From e1d3913e01c576da95cbf8e45f5504a2ba70f935 Mon Sep 17 00:00:00 2001 From: Ryan Inch Date: Tue, 23 Jul 2024 23:21:47 -0400 Subject: [PATCH] Fix the import for the Loop Animation component's startOffset property. Convert the glTF property from seconds to frames before attempting to assign it to the Blender property. Attempting to use the seconds directly led to python errors because the Blender property only accepts integers while the glTF property was usually a float. --- addons/io_hubs_addon/components/definitions/loop_animation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/io_hubs_addon/components/definitions/loop_animation.py b/addons/io_hubs_addon/components/definitions/loop_animation.py index 4166f344..7533f611 100644 --- a/addons/io_hubs_addon/components/definitions/loop_animation.py +++ b/addons/io_hubs_addon/components/definitions/loop_animation.py @@ -878,6 +878,10 @@ def gather_import(cls, gltf, blender_host, component_name, component_value, impo tracks = property_value.split(",") import_tracks(tracks, blender_ob, blender_component) else: + if property_name == 'startOffset': + fps = bpy.context.scene.render.fps / bpy.context.scene.render.fps_base + property_value = round(property_value * fps) + assign_property(gltf.vnodes, blender_component, property_name, property_value)