Board index FlightGear Development Aircraft

.obj -> .ac via Ruby script...

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

.obj -> .ac via Ruby script...

Postby Kugelfang » Sat Jan 20, 2007 3:53 pm

I've been working on a Ruby script to convert .obj format to .ac in order to avoid using Blender for this. But I can't seem to be able to keep the UV coordinates in the correct order. Do we have any Rubyists around who might be willing to take a look at it?

Let me know.

--jeff
Kugelfang
 
Posts: 178
Joined: Sun Dec 24, 2006 1:40 pm
Location: Silver Spring, MD, USA
Version: 2020.4.0
OS: Linux Mint 20.3

Postby Kugelfang » Sun Jan 28, 2007 5:22 pm

Ah Ha! Success! Now I can get on with the fun part. Finishing up the textures and working on the configuration.

Image

--jeff
www.static-lift.net
Kugelfang
 
Posts: 178
Joined: Sun Dec 24, 2006 1:40 pm
Location: Silver Spring, MD, USA
Version: 2020.4.0
OS: Linux Mint 20.3

Postby RatOmeter » Wed Jan 31, 2007 6:25 pm

Good work. Are you going to post your Ruby script ? I might find it of use.

:)
RatOmeter
 
Posts: 30
Joined: Tue Jan 30, 2007 8:38 pm

Postby Kugelfang » Wed Jan 31, 2007 10:45 pm

Yes, I do intend to make it available on my site. While it's pretty straight forward I do want to put together a little readme file.

--jeff
Kugelfang
 
Posts: 178
Joined: Sun Dec 24, 2006 1:40 pm
Location: Silver Spring, MD, USA
Version: 2020.4.0
OS: Linux Mint 20.3

Postby Kugelfang » Sun Feb 25, 2007 11:34 pm

Well, I decided to call it 'RubyGear/convert'. This is the first program I've released to the wild. Hope others find it useful. It can be obtained by visiting my projects page at www.static-lift.net.

--jeff
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: 178
Joined: Sun Dec 24, 2006 1:40 pm
Location: Silver Spring, MD, USA
Version: 2020.4.0
OS: Linux Mint 20.3

Postby Kugelfang » Sun Mar 04, 2007 2:43 pm

Another test:

Image

So much easier than converting via Blender. This one was modeled and uv mapped in Wings3d. Textures were made in The Gimp, so it's produced 100% in open source.

--jeff
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: 178
Joined: Sun Dec 24, 2006 1:40 pm
Location: Silver Spring, MD, USA
Version: 2020.4.0
OS: Linux Mint 20.3

Postby RatOmeter » Thu Mar 08, 2007 2:22 am

Thank you for making this script available. I was having some trouble getting a model converted to .ac and this tool has helped quite a bit so far.
RatOmeter
 
Posts: 30
Joined: Tue Jan 30, 2007 8:38 pm

Postby pauljs75 » Thu Mar 08, 2007 10:17 am

I'm keeping my fingers crossed that this little app will be as easy to use as it sounds. (Not familar with Ruby at all, but found that a Windows version exists.) There's plenty of .obj files here to test it on. :twisted:

I'm sure blender is nice for people who know what they're doing, but your script sounds really great for those of us who barely tread water in that program. Loading blender is probably overkill for what we're doing, and I'm guessing that unless we know what to tweak - we're not doing it right anyways. (Thus the mats being all wonky, etc.)

:idea: :?:
Now if only there were someone who knew their way around Erlang and had an idea of how the .obj exporter worked and knew .ac... We could have a direct from Wings .ac exporter (importer?) plugin. ...But that's just me imagining things.

Then again... Maybe there's a Wings3D developer that might know enough about Ruby to translate the concept to Erlang... Hmmm.
pauljs75
 
Posts: 228
Joined: Sat Jan 20, 2007 5:30 am

Postby Kugelfang » Fri Mar 09, 2007 2:06 am

Let me know if the program gives you problems. I've not tested it under Windows, but I've never noticed much difference in Ruby scripts due to platform. There used to be a Ruby packaging program which would allow you to run Ruby scripts without actually installing the whole Ruby language. I might look into that later.

I'm sure it would not be too difficult for someone familiar with Erlang to make a Wings exporter. But to be honest, I'm not cetain that Wing's AutoUV is advanced enough to make it a one stop shop of FG models. I still like having the option of using other UV mapping programs. Besides, I have an inventory of *.obj that Wings doesn't import very well since they aren't all 'solid'.

--jeff
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: 178
Joined: Sun Dec 24, 2006 1:40 pm
Location: Silver Spring, MD, USA
Version: 2020.4.0
OS: Linux Mint 20.3

Postby pauljs75 » Sun Mar 11, 2007 1:08 am

Ah yeah... Wings gets goofy with geometry that doesn't fall into the norms of winged-edge-topography. Or I'm assuming that's what happens with some meshes. So yeah, some .obj files will fall through the cracks. I wouldn't assume Wings would be the one-stop for everyone, but if that were possible it would be great for those who can do just about the whole process in the program. :wink:

Anyhow, I installed the Windows Ruby with the installer. And tried running either models.rb or convert.rb of RubyGear afterwards. Nothing happened other than a brief flash of a console-type window. Am I supposed to have the model mesh files in the same directory/folder? Is a menu supposed to come up? :?

Seems like it did something, just not sure what.
pauljs75
 
Posts: 228
Joined: Sat Jan 20, 2007 5:30 am

Postby Kugelfang » Sun Mar 11, 2007 4:37 pm

Pauljs,

It is a command line program. You'll need to run it from Windows command prompt. cd into the directory where your model is and type the command. The command will look something like:

c:\ruby\bin\ruby.exe convert.rb model_in.obj model_out.ac

Note that the path to your ruby executable may be different on your machine.

There are instructions in the README.txt file.

--jeff
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: 178
Joined: Sun Dec 24, 2006 1:40 pm
Location: Silver Spring, MD, USA
Version: 2020.4.0
OS: Linux Mint 20.3

Postby pauljs75 » Mon Mar 12, 2007 2:01 pm

Ah... Ok. I didn't catch that. I'm used to having a prompt or something, even with command line programs. (Even if it's a "Hey dummy! Use this syntax...etc." kept from blipping offscreen with "Hit any key to continue." kind of thing. Thinking back to what I remember of DOS.) I must be too used to having an interface of some sort. But I got it now, back to experimenting.
pauljs75
 
Posts: 228
Joined: Sat Jan 20, 2007 5:30 am

Postby RatOmeter » Tue Mar 13, 2007 12:38 am

Paul,

You've probably already figured it out, but for info purposes:

In Windows, hold the "windows" key on the keyboard and press the 'R' key. At the resulting "Run" prompt, type "cmd" and hit ENTER. There be your comand line. Jeff's instructions should work from there.
RatOmeter
 
Posts: 30
Joined: Tue Jan 30, 2007 8:38 pm

Postby Kugelfang » Thu Mar 15, 2007 11:00 am

Ah, yes. IIRC the quickly opening/closing command line window is a default for Windows when double-clicking a *.rb file.

My intention is to hook RubyGear/convert into a local web-based gui which I'm building for FG. So, yeah... eventually it'll be a bit less picky about who its friends are.

--jeff
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: 178
Joined: Sun Dec 24, 2006 1:40 pm
Location: Silver Spring, MD, USA
Version: 2020.4.0
OS: Linux Mint 20.3


Return to Aircraft

Who is online

Users browsing this forum: No registered users and 12 guests