Command-line (headless) .obj -> .c3d conversion tool

Moderators: Uros, OXO, JBr

Post Reply
vnks
Posts: 41
Joined: Wed Mar 27, 2019 5:12 pm

Command-line (headless) .obj -> .c3d conversion tool

Post by vnks » Mon Apr 13, 2020 7:17 pm

Hi Condor Team,

Would it be possible to update the Object Editor to support headless conversion of files, without using the GUI? I'm experimenting with generating buildings from Open Street Map data, and doing it on a large scale is pretty much impossible without a non-GUI way to convert the objects. Can you please update the tool to support unattended conversion of files? I realize there's a way to automate it using UI events and whatnot, but I'd much rather spend the time on something else :)

If there's already a way to do this that I've somehow missed I'd love to hear about it as well. Thanks!

vnks
Posts: 41
Joined: Wed Mar 27, 2019 5:12 pm

Re: Command-line (headless) .obj -> .c3d conversion tool

Post by vnks » Wed Apr 15, 2020 3:10 pm

Just keeping this on top, I'm pretty much blocked without this at the moment.

vnks
Posts: 41
Joined: Wed Mar 27, 2019 5:12 pm

Re: Command-line (headless) .obj -> .c3d conversion tool

Post by vnks » Mon Apr 20, 2020 3:43 pm

Ping... Can someone answer this please? Here's a screenshot of what it looks like now, textures are coming as well:
Shot81.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
wickid
Posts: 2442
Joined: Mon Dec 04, 2006 7:32 pm
Location: Venlo, NL
Contact:

Re: Command-line (headless) .obj -> .c3d conversion tool

Post by wickid » Mon Apr 20, 2020 3:57 pm

How are the framerates with so many objects?
PH-1504, KOE

vnks
Posts: 41
Joined: Wed Mar 27, 2019 5:12 pm

Re: Command-line (headless) .obj -> .c3d conversion tool

Post by vnks » Mon Apr 20, 2020 4:41 pm

No noticeable difference, this is a single object made up of many buildings. This is roughly the size of a small tile (1/16th of a landscape tile), but I could go smaller as long as there's a way to do batch .obj -> .c3d conversion. There's probably some sweet spot between object size and draw distance performance...

User avatar
wickid
Posts: 2442
Joined: Mon Dec 04, 2006 7:32 pm
Location: Venlo, NL
Contact:

Re: Command-line (headless) .obj -> .c3d conversion tool

Post by wickid » Mon Apr 20, 2020 6:00 pm

The textures is what causes most performance loss. I presume these are untextured objects at the moment. Best would be if they all shared the same largish texture. Maybe test for performance loss with them textured before you pursue this further?

This is what Uros said about it: viewtopic.php?f=38&t=18629#p160876
PH-1504, KOE

User avatar
wickid
Posts: 2442
Joined: Mon Dec 04, 2006 7:32 pm
Location: Venlo, NL
Contact:

Re: Command-line (headless) .obj -> .c3d conversion tool

Post by wickid » Mon Apr 20, 2020 6:28 pm

Reading back the above tread:

I suspect you export the objects as .obj or something similar. Performance wise it would be best to first group all the objects and make sure they have the same texture. Only then export the very large grouped object to .c3d.

Maybe a make the object tile sized. That means much less conversions to C3D that need to be done. That reduces the number of draw calls and memory consumption.

Best for performance reasons is a single object in the C3D file with a single texture. That single object has many vertices but that is much less labour intensive to draw on modern hardware.

There are a couple of DLLs that come with the landscape toolkit. Maybe you can program something that uses those DLLs to do the conversion? I'm not good at programming but I suspect one of those does the conversion.
PH-1504, KOE

vnks
Posts: 41
Joined: Wed Mar 27, 2019 5:12 pm

Re: Command-line (headless) .obj -> .c3d conversion tool

Post by vnks » Mon Apr 20, 2020 6:54 pm

Thanks, this is all great and I'll be experimenting with all of that, if headless conversion is possible. Basically it's a an hour worth of work to add some command-flags driven logic to the existing tool, versus hours on my end spent reverse-engineering whatever it's doing....

User avatar
wickid
Posts: 2442
Joined: Mon Dec 04, 2006 7:32 pm
Location: Venlo, NL
Contact:

Re: Command-line (headless) .obj -> .c3d conversion tool

Post by wickid » Mon Apr 20, 2020 7:28 pm

Condor is made in OXO and Uros' spare time. I wouldn't count on them making it. I'm just thinking, most of the work is in the texturing and grouping of the .obj file and getting it ready for conversion. If you automate the production of tile sized .obj files it is 16 conversions from .obj to .c3d per terragen tile. That is 1120 .c3d objects for a scenery of Slovenia size (objects of 5.76 km x 5.76 km). If you go terragen tile size .obj (23.4 x 23.4 km), it is only 70 conversions.

Can you automate the extraction from OSM data and grouping the resulting .obj and texturing them?
PH-1504, KOE

vnks
Posts: 41
Joined: Wed Mar 27, 2019 5:12 pm

Re: Command-line (headless) .obj -> .c3d conversion tool

Post by vnks » Mon Apr 20, 2020 9:24 pm

I realize that Condor is made by a very small team, however the object converter is already written, it would just be a matter of adding a few command-line flags to it. Sure, I get that there may be no time for that, no matter how small the tweak is, and that's fine if that's the answer I get. In that case I'll either give up entirely, or spend some time trying to automate the conversion with some AutoHotKey-like approach.

To be clear, automating model generation from OSM is exactly what I'm working on. Even if it works on terragen-sized tiles, that's 168 objects for just one of my sceneries - though I doubt that an object per tile would work, so it's likely a much larger number. I'm not interested in doing even 168 conversions via mindless clicking, not to mention that re-generating them after some tweaks is a non-starter in that scenario.

Post Reply