From 7aa6363ee1fd1efb4f58419cbd6f916e10a2d109 Mon Sep 17 00:00:00 2001 From: Julien Duroure Date: Sat, 8 Aug 2020 14:47:49 +0200 Subject: glTF exporter: Export joint indices as uint8 when possible --- io_scene_gltf2/__init__.py | 2 +- .../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 -- cgit v1.2.3