Nearly forgot I wanted to release this one. My contractor recently needed a static fbx loader and allowed me to open source it.
I added some quick example to show off how it works. Can't post full code here as it's too long, but check out those links:
https://github.com/mzeilfelder/irr-play ... er_sdk.cpp
https://github.com/mzeilfelder/irr-play ... ader_sdk.h
As documented in the header you need to also set-up the fbxsdk for this. There is a playground_fbx_vc2022.vcxproj project in the same folder, but that's using my local paths.
If you ever need a static fbx exporter you can also ask me. Too much work right now to clean that up, but in theory I also got one. I'll open source it another time if someone needs it.
Static fbx loader with fbxsdk
Static fbx loader with fbxsdk
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Static fbx loader with fbxsdk
Awesome. I know you said its only for static models but are you still loading the animation data and just not doing anything with it or is it not even loading the animation data at all?
Re: Static fbx loader with fbxsdk
You could change "ios->SetBoolProp(IMP_FBX_ANIMATION, false);" to true to load the animation data.
The problem is that using it is a bit tricky. For my case I needed the data in Irrlicht mesh format. So fbxsdk loaded it's data - then I converted it to Irrlicht meshes and dropped the fbx internal stuff again. One could do that also with animation data, but it's rather complicated converting it to Irrlicht animation structures. And there is likely a better solution for that. I suspect if I'd try doing that, then instead of creating Irrlicht meshes, I'd create a new animated node class which internally lets the fbxsdk do the animation work. And then try to get the resulting mesh-data at render-time. So no Irrlicht meshes at all. Or maybe instead of coding it in the node a new mesh class in Irrlicht wrapping around the sdk. I've not digged deeper into that yet, so at this point this is more of a feeling in which direction I'd try going there based on what I've seen so far of the sdk. The reason is that the sdk seems to have all kind of animation functions already and obviously those would be better than trying to re-implement them all.
Anyway - having static fbx already has some uses itself as there's quite a few models out there in that format ;-)
The problem is that using it is a bit tricky. For my case I needed the data in Irrlicht mesh format. So fbxsdk loaded it's data - then I converted it to Irrlicht meshes and dropped the fbx internal stuff again. One could do that also with animation data, but it's rather complicated converting it to Irrlicht animation structures. And there is likely a better solution for that. I suspect if I'd try doing that, then instead of creating Irrlicht meshes, I'd create a new animated node class which internally lets the fbxsdk do the animation work. And then try to get the resulting mesh-data at render-time. So no Irrlicht meshes at all. Or maybe instead of coding it in the node a new mesh class in Irrlicht wrapping around the sdk. I've not digged deeper into that yet, so at this point this is more of a feeling in which direction I'd try going there based on what I've seen so far of the sdk. The reason is that the sdk seems to have all kind of animation functions already and obviously those would be better than trying to re-implement them all.
Anyway - having static fbx already has some uses itself as there's quite a few models out there in that format ;-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Static fbx loader with fbxsdk
To be honest, it doesn't really make sense for the SDK to have animation functions. I would assume that every animation software would just convert the raw data to there own internal structures.
Also, is the SDK open source or proprietary? Maybe if its open source then I could look at how it implements animation.
Its still great to have static FBX support at all. Thanks for sharing this.
Also, is the SDK open source or proprietary? Maybe if its open source then I could look at how it implements animation.
Its still great to have static FBX support at all. Thanks for sharing this.
Re: Static fbx loader with fbxsdk
Yeah, I was also a bit surprised by it at first. But the format has quite a bit complexity (way more transformation options for example than most formats). And to ensure the results are the same as used in the tool to create it - why not just put the real animation functions in the sdk.
Sadly it is proprietary (https://aps.autodesk.com/developer/overview/fbx-sdk). Thought at least it's free and available on several platforms.
Sadly it is proprietary (https://aps.autodesk.com/developer/overview/fbx-sdk). Thought at least it's free and available on several platforms.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm