Archive 17/01/2023.

Urho3D::Scene export to Collada, STL etc

DavidHT

Hi all. I’m making the jump from Irrlicht to Urho3D. So far it’s wonderful, and I’m very impressed with the library.

In my application, I need to be able to export the data currently in my ‘Scene’ to external formats such as Collada, STL, etc.

In Irrlicht, there are export functions for this, but it seems there’s no such thing in Urho3D.
I’ve studied the AssetImporter, but that’s the wrong way around.

Has anyone done this before, or are there any hints you could provide?

Eugene

There is Export to OBJ. However, Scene is a bit too complex for 1-to-1 exporing it to Collada or any other 3D format.
Writing true exporter would require huge amount of effort.
I wonder why do you ever need it at all. If your pipeline requires conversion some assets there and back, it’s better to change such pipeline.

DavidHT

Hi Eugene, thanks for the quick reply.

I need it because my application is a design program with 3D options. So once people are done, they’d like to export the design to process it further in Sketchup or other 3D tools.
Some want the result to be 3D printed.

Of course there are other routes to do this, but as Irrlicht had it, I hoped Urho3D would have a similar functionality.

This export to OBJ, is this the Wavefront obj format? Perhaps I can combine this with Assimp to go to the other formats.

Eugene

The question is: how much information do you want to export? Do you have fixed geometry format?
It’s not very hard to write exporter for some specific case.

DavidHT

I want to export the meshes, and perhaps the materials and the lights. It’s all fixed, so no animations etc.

The required formats are at least stl, dae, ply and obj. Perhaps more. So I preferably go to Assimp first, so, if I understand correctly, an ‘aiScene’, and export from there if that’s possible at all.

Eugene

So much things are hidden under these words…
If you want to export simple position+texture+normal models, it’s one thing.
If you want to export arbitrary meshes, it’s another.

That’s the best way, I suppose. Construct aiScene and export things via AssImp.
Never tried AssImp exporter on myself tho.

DavidHT

What do you mean by arbitrary meshes?

In my case, the meshes are created from within my application, so they’re dynamically built.

I’ll study the AssImp exporter a but further. Thanks.

Eugene

I mean that mesh is just a container. So it could store literally anything as long as you have shader that could process it. If you have fixed set of vertex formats, exporting is fine.
If you have arbitrary format of vertex data, you are in troubles.

DavidHT

At the moment, I’m using the mesh generator described here by Victor: