UnityGLTF
UnityGLTF copied to clipboard
Option to deserialize "Extras"
It seems that it hasn't been an issue yet, so I'd like to adress this one:
There are these "extra" nodes in the gltf scheme: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#extras
Now it would be great if there was an option to deserialize any extra node to a self defined type and then attach it to the according GameObject as an MonoBehaviour.
I already thought about putting serialized objects as json string inside extras nodes and adding an additional json object to it, that has some information about the type of this object. Then, on importing, use reflection to see if you could deserialize this type and attach it as an MonoBehaviour to the representing GameObject.
Summed up, there should be some kind of event triggered whenever the importer comes across an extras node so that you can subscribe your own deserializing handling methods to it for interpreting the metadata.
What do you think?
I was also looking for a way to import metadata (per sceme, node or mesh...) along with GLB files. Any thoughts?
(The link above seems broken, the link to the spec: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#gltf )
I think the feature @MxShepherd mentions is very interesting.
When you need to store extra data to nodes, you could write your own Extensions (IExtension interface).