mirror of
https://github.com/blender/blender-addons.git
synced 2025-08-16 15:35:05 +00:00
glTF exporter: add hook to change attribute
This commit is contained in:
@ -4,7 +4,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": (3, 5, 29),
|
||||
"version": (3, 5, 30),
|
||||
'blender': (3, 5, 0),
|
||||
'location': 'File > Import-Export',
|
||||
'description': 'Import-Export as glTF 2.0',
|
||||
|
@ -8,6 +8,7 @@ from io_scene_gltf2.io.com import gltf2_io
|
||||
from io_scene_gltf2.io.com import gltf2_io_constants
|
||||
from io_scene_gltf2.io.com import gltf2_io_debug
|
||||
from io_scene_gltf2.io.exp import gltf2_io_binary_data
|
||||
from ...io.exp.gltf2_io_user_extensions import export_user_extensions
|
||||
|
||||
|
||||
|
||||
@ -155,6 +156,8 @@ def __gather_attribute(blender_primitive, attribute, export_settings):
|
||||
data['data'] += 0.5 # bias for rounding
|
||||
data['data'] = data['data'].astype(np.uint16)
|
||||
|
||||
export_user_extensions('gather_attribute_change', export_settings, attribute, data, True)
|
||||
|
||||
return { attribute : gltf2_io.Accessor(
|
||||
buffer_view=gltf2_io_binary_data.BinaryData(data['data'].tobytes(), gltf2_io_constants.BufferViewTarget.ARRAY_BUFFER),
|
||||
byte_offset=None,
|
||||
@ -175,6 +178,9 @@ def __gather_attribute(blender_primitive, attribute, export_settings):
|
||||
return __gather_skins(blender_primitive, export_settings)
|
||||
|
||||
else:
|
||||
|
||||
export_user_extensions('gather_attribute_change', export_settings, attribute, data, False)
|
||||
|
||||
return {
|
||||
attribute: array_to_accessor(
|
||||
data['data'],
|
||||
|
Reference in New Issue
Block a user