gltf-extensions
gltf-extensions copied to clipboard
Add Blender Exporter Version to Generator String or Asset Extras
We should put the version of the Blender Exporter in the exported glTF file so we can debug issues with the exporter.
Feel like I have a pretty good idea of how to add this in. Just curious where it should go.
Here is existing json from an exported glb. Where would we want to add the property?
JSON{"asset":{"generator":"Khronos glTF Blender I/O v1.6.16","version":"2.0"},"extensionsUsed":["OMI_audio_emitter"],"scene":0,"scenes":...
Currently it exports for extensionsUsed as OMI_audio_emitter
I could see us adding a property for version in there, but I feel like I'm missing something that may already support that.
I've been reading up here: https://github.com/KhronosGroup/glTF-Blender-IO/tree/master/example-addons/example_gltf_extension
And found in the example there was a version defined for an extension (unused in the final glb): https://github.com/KhronosGroup/glTF-Blender-IO/blob/master/example-addons/example_gltf_extension/init.py#L6
I assume gather_asset_hook
would allow us to add the version there too.
Still digging but thought I'd seed the question on where version should be. I looked into adding it at the individual instance level but that didn't make sense. I think it should be somehow related to the extensionsUsed
property and as global as possible.
Side question, Should extensionsUsed be OMI Blender Exporter
or an underscored variation of that?
Technically extensionsUsed
can include any unique set of string [1-*]
values, but the de facto standard seems to be using PREFIX_ALL_CAPS_UNDERSCORED
identifiers. At one point the idea of including a version number surfaced -- like OMI_audio_emitter_1_0
.
I believe the most recent consensus re: revisioning the spec itself was that this initial release represents conceptual 1.0, and any successor version would require its own standalone spec.
Re: versioning the Blender OMI Add-On -- that still seems to be an open question. Personally I think appending ; OMI Add-On v0.01
to generator
could make sense (given some tools already seem to report on the generator
value), or adding our own dedicated version property under asset
.
Yeah, what @humbletim said. Either appending it to the generator property so that it shows up in other tools that already use it, or adding it to a new extras field. I'm not certain which is best yet though.
Starting work here: https://github.com/humbletim/omi-blender-gltf/pull/1
Currently that PR will allow us to create GLTF that look like this
JSON{"asset":{"extras":{"OMI_Blender_GLTF_Version":"0.0.1"},"generator":"Khronos glTF Blender I/O v1.6.16","version":"2.0"},"extensionsUsed":["OMI_audio_emitter"],"extensions":{"OMI_audio_emitter":{"audioSources":[{"name":"","uri":"https://xp3d.io/wp-content/uploads/2021/12/OutdoorFestival_audio3.mp3","mimeType":"audio/mpeg"}],"audioEmitters":[{"type":"global","gain":0,"loop":true,"autoPlay":true,"source":0,"coneInnerAngle":0,"coneOuterAngle":0,"coneOuterGain":0,"distanceModel":"inverse","maxDistance":0,"refDistance":0,"rolloffFactor":0,"name":""},
Is this issue still relevant? The PR in the last comment has been merged.