diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2022-08-06 13:11:15 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2022-08-06 13:11:15 +0300 |
commit | ef0027e72d295f5bbae1905c6260878851131eef (patch) | |
tree | 332450a5c63df82f711aae005c8c1fb85a5f5280 /io_scene_gltf2/blender | |
parent | c58c8f3c3525247c6f584684260eae4ea87a57a3 (diff) |
glTF exporter: add bufferView Target at export
Diffstat (limited to 'io_scene_gltf2/blender')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py | 4 | ||||
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py | 2 |
2 files changed, 3 insertions, 3 deletions
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 f28a1f10..8572d185 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 @@ -44,7 +44,7 @@ def array_to_accessor(array, component_type, data_type, include_max_and_min=Fals amin = np.amin(array, axis=0).tolist() return gltf2_io.Accessor( - buffer_view=gltf2_io_binary_data.BinaryData(array.tobytes()), + buffer_view=gltf2_io_binary_data.BinaryData(array.tobytes(), gltf2_io_constants.BufferViewTarget.ARRAY_BUFFER), byte_offset=None, component_type=component_type, count=len(array), @@ -142,7 +142,7 @@ def __gather_colors(blender_primitive, export_settings): comp_type = gltf2_io_constants.ComponentType.Float attributes[color_id] = gltf2_io.Accessor( - buffer_view=gltf2_io_binary_data.BinaryData(colors.tobytes()), + buffer_view=gltf2_io_binary_data.BinaryData(colors.tobytes(), gltf2_io_constants.BufferViewTarget.ARRAY_BUFFER), byte_offset=None, component_type=comp_type, count=len(colors), diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py index b2ffb6b3..576a1418 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py @@ -150,7 +150,7 @@ def __gather_indices(blender_primitive, blender_mesh, modifiers, export_settings return None element_type = gltf2_io_constants.DataType.Scalar - binary_data = gltf2_io_binary_data.BinaryData(indices.tobytes()) + binary_data = gltf2_io_binary_data.BinaryData(indices.tobytes(), bufferViewTarget=gltf2_io_constants.BufferViewTarget.ELEMENT_ARRAY_BUFFER) return gltf2_blender_gather_accessors.gather_accessor( binary_data, component_type, |