[Bf-extensions-cvs] [a0d16478] blender-v3.0-release: glTF exporter: avoid issue with setting frame with python v >= 3.10

Julien Duroure noreply at git.blender.org
Fri Nov 12 09:35:20 CET 2021


Commit: a0d1647839180388805be150794a812c44e59053
Author: Julien Duroure
Date:   Fri Nov 12 09:35:07 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rBAa0d1647839180388805be150794a812c44e59053

glTF exporter: avoid issue with setting frame with python v >= 3.10

===================================================================

M	io_scene_gltf2/__init__.py
M	io_scene_gltf2/blender/exp/gltf2_blender_export.py
M	io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py

===================================================================

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 3c4022d5..babf37fb 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -15,7 +15,7 @@
 bl_info = {
     'name': 'glTF 2.0 format',
     'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
-    "version": (1, 7, 32),
+    "version": (1, 7, 33),
     'blender': (3, 0, 0),
     'location': 'File > Import-Export',
     'description': 'Import-Export as glTF 2.0',
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_export.py b/io_scene_gltf2/blender/exp/gltf2_blender_export.py
index 522f13de..fc78e9b5 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_export.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_export.py
@@ -54,7 +54,7 @@ def save(context, export_settings):
     __notify_end(context, end_time - start_time)
 
     if not export_settings['gltf_current_frame']:
-        bpy.context.scene.frame_set(original_frame)
+        bpy.context.scene.frame_set(int(original_frame))
     return {'FINISHED'}
 
 
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py
index d70f4de2..f1e94d9e 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py
@@ -157,7 +157,7 @@ def get_bone_matrix(blender_object_if_armature: typing.Optional[bpy.types.Object
     while frame <= end_frame:
         data[frame] = {}
         # we need to bake in the constraints
-        bpy.context.scene.frame_set(frame)
+        bpy.context.scene.frame_set(int(frame))
         for pbone in blender_object_if_armature.pose.bones:
             if bake_bone is None:
                 matrix = pbone.matrix_basis.copy()



More information about the Bf-extensions-cvs mailing list