Looking at model exports

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
wizard4
Posts: 181
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Looking at model exports

Post by wizard4 »

Good day everyone.

It's a good thing to want a finished game to show people. I've given myself a whole year to see where I am at when focusing on one game, one language, one engine - although last night was troubling. If I chose any engine available today, I would still run into trouble at some point. I vented in my diary last night and after some sleep browsed the forums for solutions.

It seems there are quite a few ways to get custom models into Irrlicht. I'm not the best planner/manager/most experienced in game development/seasoned dev with a dozen finished games, but I'd like to overcome this hurdle.

I've seen with my own eyes, all it takes is some perseverance. Maybe not instant answers, and completely doable.
wizard4
Posts: 181
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Looking at model exports

Post by wizard4 »

I'm at home now. A good vent, a sleep on it, and looking at what's available.

I see in the SVN trunk has a B3DExport.py file. Also building the MeshConverter project could help.

It may seem "cool" for me to change/switch to another project, but I wouldn't get far if I bail out every time a "big" problem appears :(

I may also save myself hundreds of £££s by not needing Maya. My first attempt at solo game dev aimed towards Unity and Unreal. I thought Maya would fit nicely with them.
wizard4
Posts: 181
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Looking at model exports

Post by wizard4 »

Downloaded Blender 2.59 and Python 2.6 and used the B3DExport.py script. It's sort of working.
In my program as well as MeshViewer the simple cube model doesn't animate.
I've tried both keyframes and also a bone. I haven't baked anything, just trying simple things that I remembered.
Once I loaded the cube (24 frames in Blender) I set these functions up:

Code: Select all

blitz_mesh_node->setPosition(irr::core::vector3df(0.f, 50.f, 0.f));
blitz_mesh_node->setScale(irr::core::vector3df(100.f, 100.f, 100.f));
blitz_mesh_node->setAnimationSpeed(5.f);
blitz_mesh_node->setFrameLoop(0, 24);
I'll keep searching the forums.

I see this dialog in the console:

Code: Select all

-read ChunkNODE: Cube
--read ChunkMESH
---ChunkVRTS
---ChunkTRIS
--read ChunkANIM
FPS: 60.000000
--read ChunkNODE: Bone
---read ChunkBONE
---read ChunkKEYS
Skinned Mesh - finalize
Loaded mesh: media/my_b3d_bone.b3d
wizard4
Posts: 181
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Looking at model exports

Post by wizard4 »

And also the directx .x file export is the same in MeshViewer. Both files load the mesh but no animation is being played.
CuteAlien
Admin
Posts: 9923
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Looking at model exports

Post by CuteAlien »

Noiecity recently made a tutorial video about that, maybe it helps? viewtopic.php?p=307310
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
n00bc0de
Posts: 116
Joined: Tue Oct 04, 2022 1:21 am

Re: Looking at model exports

Post by n00bc0de »

I would also like to mention that you can use other software besides blender for animation.

Here is a list of software that easily exports animation to irrlicht:
  • Milkshape 3D
  • Misfit 3D
  • Maverick Model 3D
  • Truespace* - This is not worth the trouble but if you want to try it, do not download it from its own website. Look for another website that host it.
I also wrote a library that imports skeletal animation from anim8or as skinned meshes. I am planning on improving it but it works just fine if you just want to import your model with skeletal animation (which is currently all I use it for). viewtopic.php?t=52934

Blender does support the ability to export each frame of an animation as *.obj. You can easily create an animated mesh in irrlicht from this.

There is also a gltf importer I came across in a fork of irrlicht. I haven't tried this out myself but it may be worth looking into. https://github.com/jordan4ibanez/irrlic ... s-animated
wizard4
Posts: 181
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Looking at model exports

Post by wizard4 »

Thank you. I have a little urge to pay for Milkshape. It'd be a little nostalgia from my younger days making models for Half-Life.

I also found Asset Importer (assimp) searching forums (may help)
viewtopic.php?t=50751

Blender plugin/SuperTuxCart (CuteAlien's link above helped) and I found version 2.59 worked okay for me

This for X files. I'm not sure if .x can animate in Irrlicht or not. The feature pages says .x is animated.
viewtopic.php?t=52229

p.s. I didn't join the vertices to the bone while parenting which stopped the animation playing properly.
CuteAlien
Admin
Posts: 9923
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Looking at model exports

Post by CuteAlien »

X can animate (there is an animated dwarf.x model in Irrlicht media), but there's hardly any support for that format out there anymore. I have unfortunately no examples for non-working animated .x models, so not sure what problem there was with the one there.
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
wizard4
Posts: 181
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Looking at model exports

Post by wizard4 »

Well I searched for a day and a bit. That's all I could manage. I did see my problem with switching ideas while working on this. As I looked for programs to export, lots of different Irrlicht forks and new names popped up. I was stuck trying to find one called Avalanche(?) that I saw a reference to.

Wine was okay. I think I needed a reboot to get my menu up on the desktop. It could load FragMotion and Anim8or, but Milkshape missed a DLL and I'm not downloading a random system file off a "site", and this made me think... If you have a way to create something, surely you use that way because it works? Why spend days of frustration getting something to work that you hardly know when you already have a preferred method? The Quake qbsp and Radient editor was my problem, so I said to use what works over a new thing.

Misfit has transformed into Maverick. The logo is the same and Maverick is an updated version. SuperTuxCart looked specialised for levels and carts, so as I said above, I dropped that fairly quickly. Assimp looked so confusing. I think it's a bigger library with more documentation, so again, needs special treatment so I didn't look far into it.

Blender 4.0 works on my laptop funnily enough. Although it can only export fbx and _maybe_ glft, but I was out of time. There's also a binary version glb which confused me. I did see the possibility of exporting EGG files that Panda3D uses through an add on.

Irrlicht surprisingly imports older model formats, like MD2 and X and I can see why people are creating their own exporters (n00bcode has worked on Anim8or, and I can appreciate he is a clever man!)

I think FragMotion might be able to animated imported meshes - ran out of time though.

I wanted to at least upload a video of a map with rotating meshes to show you, but that was the idea at the start, and little did I know ideas don't equal what you get.

And that's about it. About 1 day of searching. I'll most likely use Maverick for level models and figure out Anim8or. The B3D.py script was chucked around the net and patched and left alone, so I don't think it's stable.
CuteAlien
Admin
Posts: 9923
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Looking at model exports

Post by CuteAlien »

Sorry, animated pipeline is a mess as there's no developers right now which really care about it. I only work with static models in my current projects, so I only look at it when people report problems (and even that may take months if it catches me at a bad time as can be seen by an open animation interpolation bug which got reported quite a while ago).

If I had to get an animated model working right now, what I would do is likely try to get b3d 2.49 exporter working with newest Blender. It's written in pretty simple Python and then my hope would be that the export api in Blender hasn't changed too radical. And b3d is the simplest animation format to work with which I know about. Even some static formats are more complicated to handle than that one ;-)
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
wizard4
Posts: 181
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Looking at model exports

Post by wizard4 »

From Gemini AI

FBX
An FBX file is not considered open source; it is a proprietary format owned by Autodesk, meaning the specifications of the file format are not publicly available, and the only official way to access data within an FBX file is through their provided SDK, limiting its use in open source applications.
Key points about FBX and open source:
Proprietary format:
The core FBX format is not open source, and full access requires using Autodesk's SDK.
Third-party libraries:
While not officially open source, some open source projects like the Assimp library can read and write FBX files by implementing their own interpretation of the format.
Limitations:
Due to the closed nature, developers using open source software may encounter limitations when working with FBX files, particularly if complex features are needed.

B3D
A "B3D" model file is generally not considered open source; it's a proprietary format often associated with specific software, meaning the file structure and details are not publicly accessible and can only be fully read and edited using the designated program, limiting its compatibility and reusability across different platforms.
Key points about B3D files:
Proprietary nature:
Most B3D files are linked to specific software, like PowerWorld, which controls the format and restricts access to its inner workings.
Limited interoperability:
Due to the proprietary format, opening a B3D file in another software might be difficult or require conversion to a more open standard like OBJ or STL.
Use case:
B3D files are often used in specialized fields like power system analysis where the software associated with the format provides specific functionalities.

Alternatives
Open-source alternatives in 3D modeling:
OBJ: A widely supported, open format that can be read and written by many 3D modeling programs.
STL: Another common open-source format primarily used for 3D printing.
GLTF (glTF 2.0): A modern, open standard designed for web-based 3D graphics, offering efficient data representation and broad compatibility.

What open source animation formats are there
Yes, the most prominent open-source animated model format is glTF (GL Transmission Format), which allows for both static models and animation data within a single file, making it ideal for web applications, AR/VR, and games where real-time rendering is crucial; the binary version of glTF is called glb.
Other open-source formats with animation capabilities include:
COLLADA (DAE):
An XML-based format that supports complex animations and is widely used in the 3D industry.
USD (Universal Scene Description):
Developed by Pixar, this format offers robust animation features and is considered a powerful option for complex scenes.
Key points about open-source animated model formats:
Wide compatibility:
These formats are supported by a variety of 3D software, facilitating easy exchange between different applications.
Efficiency:
Formats like glTF are designed to be lightweight and load quickly, making them suitable for web-based experiences.
Flexibility:
They can store a variety of data including geometry, materials, textures, and animation keyframes.

...
CuteAlien
Admin
Posts: 9923
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Looking at model exports

Post by CuteAlien »

Yeah, pretty good overview. FBX is simply used by a lot of tools, so it's somewhat popular. Even thought these days the lack of PBR support starts to get a bit in the way (but wouldn't matter for Irrlicht right now which also doesn't support this out of the box). The format is proprietary, but sometimes it doesn't matter - for example if you don't plan to open-source your project anyway. Or if you say - adding a foreign lib for import is just fine (and it's at least cost-free to use). I will likely write a loader for static fbx files (so no animation...) in my job this year using the official proprietary library. Maybe it can then serve as a starting point for someone doing the animation stuff.

B3D is proprietary, but it's really trivial. That's why I kinda like it. Simplest format supporting bone animations I know of.

OBJ is even simpler, but is purely for static models (thought there are some extensions these days for animation). It's actually also proprietary, but as it in ascii that's not a real problem. Even thought it caused some tools handling some of it's stuff with slight differences.

GLTF would be great. But means either we use a library for it (good option probably), or we implement some json reader in Irrlicht first. Definitely my favorite format for the future right now. If I had no energy/time worries in my life that would be one I'd work on.

We have a bit Collada support, but not animation. And actually quite a few other problems, so even static models work badly depending on the exporter used. It's a pretty complicated format, already the largest loader in Irrlicht despite not being half as useful as the way smaller b3d loader (when compiled it's actually the biggest obj file in Irrlicht). Reworking the loader would still be worth it - at least to fix the existing troubles (already on my todo list for years).

I haven't seen USD used in gaming so far, but I haven't worked in a game company for quite a few years, so don't know...
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
Noiecity
Posts: 314
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Looking at model exports

Post by Noiecity »

Interesting fact, you can use .obj for animations, it is in fact, a quite viable option considering that you eliminate many limits of the other formats based on bones or a predefined geometry. Blender allows you to export an animated model in .obj, it will export different .obj models with their appearance in each frame, this allows you to get the results of shapekeys for example, or precomputed physics, etc.
You can load those .obj in the memory and go reading them in order inside an array, while you show one in a frame, you hide it until the next animation and show the next one, etc.
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
CuteAlien
Admin
Posts: 9923
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Looking at model exports

Post by CuteAlien »

Yeah, I also only learned about animated .obj files in Blender last week :-)
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
Noiecity
Posts: 314
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Looking at model exports

Post by Noiecity »

It also facilitates the use of normalmaps in irrlicht...
I am currently trying to create a tool that paints a uvmapping of the geometry... I have made some progress, irrlicht is powerful enough to produce a texturing tool....
But it's really, really hard to work with so many geometry conditions....
I want to bring a tutorial on how to get realistic textures using blender internal and bring them to irrlicht...

edit: I give up, my ignorance in image manipulation from code overcomes me in this challenge, I know what patterns to follow and how the image must be modified in different geometries to reach that result, but I don't know how to carry that idea in c++, I lack knowledge of how to automate this task in those conditions.
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
Post Reply