Board index FlightGear Development Aircraft

Do animations work with *.obj models in FGFS?

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Do animations work with *.obj models in FGFS?

Postby Kugelfang » Sun May 27, 2018 2:06 pm

As I try to get back into aircraft development after being gone for a decade, I've noticed that FGFS does import *.obj models fairly well. I tested this as I work to update a script I had written that converts *.obj to *.ac. My conversion script is currently broken and does not produce an *.ac file that FGFS can import. Not surprising since I wrote it in 2007. But I'd be a slightly happier camper if I could entirely cut the conversion process from my workflow.

Everything I find in the forum and the wiki is about converting aircraft models to *.ac (usually using Blender). But I got to wondering if *.obj is a realistic option these days? The geometry and textures come in OK, but I can't seem to get animations in the *-model.xml file to apply to objects in the *.obj file. Is that one of the limitations of *.obj in FGFS? Are *.obj models really only useful for static objects? Any other limitations?

TIA

--jeff

Image
We were set in our ways. We believed in a good God, a bad Devil and a hot Hell, and more than anything else we believed that the same good God did not intend man should ever fly.
--Bill Tate (Crouch, The Bishop's Boys)
Kugelfang
 
Posts: 82
Joined: Sun Dec 24, 2006 12:40 pm
Location: Silver Spring, MD, USA
Version: 2018.2.1
OS: Linux Mint 18 Cinnam

Re: Do animations work with *.obj models in FGFS?

Postby Thorsten » Sun May 27, 2018 2:37 pm

My understanding is that models are loaded by the OSG model loader and internally end up in the same format regardless of what they originally were (at some point, we made tests with binary OSG format models and as far as I remember they worked fine).

Thus, if the OSG model loader finds a format palatable, animations can be expected to work on it - maybe the naming convention for objects/children is different from what you think? But there's nothing special about the *.ac format that would make animations work - internally models are made part of the scenegraph, and format-specific animations (blender has a lot of these) simply do not work.
Thorsten
 
Posts: 10965
Joined: Mon Nov 02, 2009 8:33 am

Re: Do animations work with *.obj models in FGFS?

Postby Kugelfang » Sun May 27, 2018 3:11 pm

In that case, is there a way to see the aircraft model/submodel names in FGFS? Maybe through a debug or logging function? Since both the *-model.xml and *.obj files are ascii, I can ensure that those names match. I guess it comes down to whether the OSG loader recognizes the 'g' (group) or 'o' (object) lines in the *.obj file.

Or, I guess OSG loader doesn't see them at all since on the command line FGFS is telling me that cannot find the objects for animation. Hmmm....
We were set in our ways. We believed in a good God, a bad Devil and a hot Hell, and more than anything else we believed that the same good God did not intend man should ever fly.
--Bill Tate (Crouch, The Bishop's Boys)
Kugelfang
 
Posts: 82
Joined: Sun Dec 24, 2006 12:40 pm
Location: Silver Spring, MD, USA
Version: 2018.2.1
OS: Linux Mint 18 Cinnam

Re: Do animations work with *.obj models in FGFS?

Postby Thorsten » Mon May 28, 2018 5:09 pm

I guess that means that the format isn't really fully supported by the OSG loader, so the answer to the thread would be that animations do not work with *.obj models in FGFS.
Thorsten
 
Posts: 10965
Joined: Mon Nov 02, 2009 8:33 am

Re: Do animations work with *.obj models in FGFS?

Postby VicMar » Tue May 29, 2018 7:13 am

A bit long winded but SketchUp can import .obj and we have exporters which export .ac files from SketchUp.
Time flies like an arrow
Fruit flies like a banana
User avatar
VicMar
 
Posts: 2056
Joined: Sun Apr 06, 2008 5:53 pm
Location: Lancing. UK (EGKA)
Callsign: VicMar
Version: 2018.3.1
OS: OS X 10.12.6

Re: Do animations work with *.obj models in FGFS?

Postby Kugelfang » Tue May 29, 2018 11:17 pm

Thanks for the follow ups, Thorsten and Vicmar. I spent a couple of hours debugging my conversion script and found the issue. So now I can convert my *.obj to *.ac in 4 clicks of a mouse botton. It's an extra step but animations are worth it.
We were set in our ways. We believed in a good God, a bad Devil and a hot Hell, and more than anything else we believed that the same good God did not intend man should ever fly.
--Bill Tate (Crouch, The Bishop's Boys)
Kugelfang
 
Posts: 82
Joined: Sun Dec 24, 2006 12:40 pm
Location: Silver Spring, MD, USA
Version: 2018.2.1
OS: Linux Mint 18 Cinnam


Return to Aircraft

Who is online

Users browsing this forum: Applebot [Bot] and 23 guests