diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2020-08-08 15:47:49 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2020-08-08 15:47:49 +0300 |
commit | 7aa6363ee1fd1efb4f58419cbd6f916e10a2d109 (patch) | |
tree | 13cb32b2d96b7cd6e4813c96fc7cecbf6176f98f | |
parent | 727b176f68129376bd268f71a726a616abbd6690 (diff) |
glTF exporter: Export joint indices as uint8 when possible
-rwxr-xr-x | io_scene_gltf2/__init__.py | 2 | ||||
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py index bafd7501..4b65741c 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, 4, 2), + "version": (1, 4, 3), 'blender': (2, 90, 0), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py index 8912d921..61adea89 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py @@ -161,9 +161,12 @@ def __gather_skins(blender_primitive, export_settings): # joints internal_joint = blender_primitive["attributes"][joint_id] + component_type = gltf2_io_constants.ComponentType.UnsignedShort + if max(internal_joint) < 256: + component_type = gltf2_io_constants.ComponentType.UnsignedByte joint = array_to_accessor( internal_joint, - component_type=gltf2_io_constants.ComponentType.UnsignedShort, + component_type, data_type=gltf2_io_constants.DataType.Vec4, ) attributes[joint_id] = joint |