Replies: 4 comments 1 reply
-
Would it be possible for you to share a gltf which have these custom extensions? |
Beta Was this translation helpful? Give feedback.
-
Here is the exported JSON of my original test export when I was writing the plugin (not including the binary, but that data is irrelevant. I can post a zip if needed). The important bits are At the moment, I'm just trying to figure out the best way to hook into the gltf parser in a generalized way, not specifically a way to support my specific custom extension in the library.
|
Beta Was this translation helpful? Give feedback.
-
The most obvious/easy solution at first glance would be to expose the entire gltfParser in the API. That way you or anyone else could just override the needed parse-functions. I'm not too keen on doing this as this would probably mean that the entire gltf-folder needs to be exposed as well - and I have to support it as an external API. One "hook" already exists in the gltf-parser, and that is the materialFactory. One solution could be to do something similar with the other parts (animation, mesh, textures). Generally it's easier to design the API when you have a set of specific use-cases, otherwise the API may end up supporting stuff that no one really wants/needs. That is why I asked for an example file, it's a specific use case :) As a side note: in your specific case I think you can do it without any hook at all. You actually already have all the data you need in that json. Below is just some test code - it probably doesn't work as is (just trying to show what I mean).
|
Beta Was this translation helpful? Give feedback.
-
My game needed to be able to play different sounds at certain frames of each animation, so I wrote a Blender plugin that exported all pose markers inside of each animation into the GLTF file as a GLTF Extension. Since pixi3d obviously doesn't support my custom extension, I needed to fork the library and add it here:
lunarraid@f4e1f97
This is not a great solution for the engine at large, though, and got me thinking. Would there be a way to hook into the default GLFT loader to process different extensions after the JSON data has been parsed? Possibly export overridden classes? I don't yet have any concrete ideas on the best structure for this, but was unable to come up with a clean way to simply override the classes and use my own with the current loader architecture.
Beta Was this translation helpful? Give feedback.
All reactions