Board index FlightGear Development

Blender 2.6 AC3D Importer & Exporter

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Re: Blender AC3D importer - now with special 2.5 flavour!

Postby Mossie » Mon Sep 12, 2011 2:26 pm

Ok, understand that limitation, not a problem to triangulate surfaces.

I'll do some more tests with complex models with nested hiarchary. These may well cause some issues.
Regards, Gerry "Mossie" Mos
--------------------------------------------------------------------------
Mossie 3D CAD, "Prompt and Precise"
http://mossie3dcad.com/

http://ww1-aircraft.info/
Mossie
 
Posts: 111
Joined: Thu Dec 27, 2007 3:22 pm

Re: Blender AC3D importer - now with special 2.5 flavour!

Postby majic79 » Thu Sep 15, 2011 8:45 am

Ive been chatting to Rene (who developed another .ac format importer/exporter) and weve decided to collaborate on a bigger and better importer.

New features to include:
- User interface checkboxes and parameters (so that you dont have to go and fudge blenders registry to get features to work)
- Object oriented design - ground up design to handle importing of data into blender
- Full use of blender 2.5 material models
- Model orientation will always match AC3D orientation against axis (eg, X positive left->right, Y positive bottom->Top, Z positive in->Out)
- Make full use of AC3D mesh properties

Now is the time to add in feature requests!

Im thinking that we could have the following features:
- Generate bump map + xml files during export
- Generate light map + xml files during export

Last night I completed the new model importer and file parser (1am coding FTW!) tonight I aim to have it importing most of the materials into blender
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

Re: Blender 2.59 AC3D importer - now taking feature requests

Postby i4dnf » Thu Sep 15, 2011 9:05 am

Regarding model orientation, curently when importing a model into Blender (2.49) to get coordinates for animation, I can use the coordinates I get from Blender directly in an animation. I'm affraid that changing the behaviour of the importer might make some sign/axis conversions necessary, which would make animating parts of models even more tedious :(.
i4dnf
Retired
 
Posts: 745
Joined: Wed Sep 09, 2009 7:17 am
Location: LRBS
Callsign: YR-I4D
Version: GIT
OS: Gentoo Linux ~amd64

Re: Blender 2.59 AC3D importer - now taking feature requests

Postby majic79 » Thu Sep 15, 2011 11:05 am

i4dnf wrote in Thu Sep 15, 2011 9:05 am:Regarding model orientation, curently when importing a model into Blender (2.49) to get coordinates for animation, I can use the coordinates I get from Blender directly in an animation. I'm affraid that changing the behaviour of the importer might make some sign/axis conversions necessary, which would make animating parts of models even more tedious :(.


I think this is less of a problem than you say: The models get rotated anyway so that they are oriented sort of correctly in blender, but with the wrong axis "up", this only applies to the global "world" models, everything else is rotated relative to it's parent (in most cases, not at all)

It's a valid point, but we'll test for it in development and see how it impacts on that side of things - I'm hoping that it won't impact at all. If it's a big issue, we can add a last stage rotation to the model to bring it back round to the original orientation, but I would prefer that each axis in blender lines up with the approriate AC3D axis, so that 3D designers will see what they expect to see, rather than an object brought into blender and transposed to fit blenders world.

The "core" importer is then one that brings in an AC3D model, creates blender compatible materials that work correctly inside of blender, with the model oriented in the same way as it would be inside of AC3D.

Features would then be things that expand on this eg:

- Flightgear final model rotate - for animations (if it turns out it needs it)
- generate flightgear bump maps + XML
- generate flightgear light maps + XML
some other features....

I want to make this as easy as possible to bring a model into blender from ac3d, or to generate a model from scratch in blender, then export it and generate all the little bits that have to be done manually at the moment.

If there's animations in the blender file, might be able to export them for you as well (eg, undercarriage weight on wheels, flaps, elevator, ailerons, flaps) as blender has some very useful animation tools that might be useable
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

Re: Blender 2.59 AC3D importer - now taking feature requests

Postby i4dnf » Thu Sep 15, 2011 11:50 am

majic79 wrote:It's a valid point, but we'll test for it in development and see how it impacts on that side of things - I'm hoping that it won't impact at all. If it's a big issue, we can add a last stage rotation to the model to bring it back round to the original orientation, but I would prefer that each axis in blender lines up with the approriate AC3D axis, so that 3D designers will see what they expect to see, rather than an object brought into blender and transposed to fit blenders world.


As I said earlier, what I see now in blender(2.49) with an imported ac3 model is what I expect to see.
If blender tells me that a point is at global coordinates:
x:1.5
y:-2
z:3.25
then that's what I put In the animation file and it works, no conversion necesary.

If there are internal conversions/rotations necesary in the blender importer to make it right then by all means do them, but what I'm understanding from you is that I'll need to swap z and y coordinates and make x=-x if I'll be working with your importer, which is "bad" (tm).
I don't care about the ac3d axis, for all I know they might be screwed to begin with (as all coordinate systems that consider z anything else than up are), what I care is for the axis blender reports to match the axis of the model in FG. (which relies on the osg module, which in turn If I'm not mistaken does the same rotation the blender importer does).

Just expressing my worries here, maybe I'm not understanding your explanations...
i4dnf
Retired
 
Posts: 745
Joined: Wed Sep 09, 2009 7:17 am
Location: LRBS
Callsign: YR-I4D
Version: GIT
OS: Gentoo Linux ~amd64

Re: Blender 2.59 AC3D importer - now taking feature requests

Postby majic79 » Thu Sep 15, 2011 12:25 pm

Let me look closer at it - I take your point on board, if the systems that blender provides to manipulate the axis-orientation don't do what we expect them to do, we can still get back to a systems that doesn't impact on the way things are currently working.

Have you any features that you'd like to see added to the import/export?
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

Re: Blender 2.59 AC3D importer - now taking feature requests

Postby helijah » Fri Sep 30, 2011 10:47 pm

I must admit that being forced to rotate 90 degrees on X for each import is quite annoying. But this is done quickly.

Regards. Emmanuel
Some planes (and other) for FlightGear
http://helijah.free.fr
and
http://embaranger.free.fr
User avatar
helijah
 
Posts: 1038
Joined: Wed Dec 27, 2006 12:35 pm
Location: Chartres (France)
Callsign: helijah
IRC name: helijah
Version: GIT
OS: GNU/Linux

Re: Blender 2.59 AC3D importer - now taking feature requests

Postby majic79 » Sat Oct 01, 2011 8:18 am

I've got an initial version that I want to tidy up this weekend (import and export)

When importing into flightgear, I've got a couple of options: assume the co-ordinates of the AC model are in X Y Z order and then when it's brought into blender, it's then spot on, absolutely correct, for AC3D (eg, if a vertex is 10 units on the vertical [Y] axis in AC3D, it'll be 10 units along the Y axis in blender), or we can say to re-orient to Blender axis (eg, vertex at 10 on the Y axis is rotated about X axis to become -10 on the Z axis). Likewise for the import.

I've identified another feature that might come in useful: Create a UV-unwrap.png for the meshes?
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

Re: Blender 2.59 AC3D importer - now taking feature requests

Postby VaLeo » Sat Oct 01, 2011 8:46 am

May be, is it worth to make FG-developer's SpecialEdition Script, where model is correctly placed in FG axis, as in good old 2.49?
VaLeo
 
Posts: 186
Joined: Wed Nov 29, 2006 10:00 am
Location: Ukraine, Dnipropetrovsk
Version: GIT
OS: Debian 7

Re: Blender 2.59 AC3D importer - now taking feature requests

Postby HHS » Sat Oct 01, 2011 1:42 pm

majic79 wrote in Sat Oct 01, 2011 8:18 am:I've identified another feature that might come in useful: Create a UV-unwrap.png for the meshes?


Hmmm...no. We have/had something better.

But please look into http://gitorious.org/fg/flightgear/tree ... /Modeller- there are some very good scripts, which are very often used by the aircraft developers with Blender 2.49 and would be nice to have in Blender 2.5x/2.6:

fgfs_animation.py -> Rotation, Generate textured Lights, Range (LOD), translation (from origin and curser)

yasim_import.py - > visualize YASim-fdms

uv_pack.py ->Pack UV maps of all selected objects onto an empty square texture

uv_export_svg.py ->Saves the UV mappings of all selected objects to an SVG file. The uv_import_svg.py
script can be used to re-import such a file. Each object and each group of adjacent
faces therein will be made a separate SVG group.

uv_import_svg.py ->Imports an SVG file containing UV maps, which has been saved by the
uv_export.svg script. This allows to move, scale, and rotate object
mappings in SVG editors like Inkscape. Note that all contained UV maps
will be set, no matter which objects are actually selected at the moment.
The choice has been made when the file was saved!
Up, up and away
User avatar
HHS
Retired
 
Posts: 3624
Joined: Thu Jul 19, 2007 8:09 am
Version: GIT

Re: Blender 2.59 AC3D importer - now taking feature requests

Postby majic79 » Sun Oct 02, 2011 10:37 pm

Modifying the old scripts to work in 2.5 should be fairly easy - so when I've completed the last little things with this version and got something that everyone can use (FYI, the reboot branch is the new work, the master branch is a port of the old importer to work in 2.59) maybe then I can take a look at those scripts to upgrade them?
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

Re: Blender 2.59 AC3D importer - now taking feature requests

Postby helijah » Mon Oct 03, 2011 12:13 am

Melchior FRANZ expects the release of Blender 2.6 because it has no confidence in the stability of the 2.5 for redo all scripts
Some planes (and other) for FlightGear
http://helijah.free.fr
and
http://embaranger.free.fr
User avatar
helijah
 
Posts: 1038
Joined: Wed Dec 27, 2006 12:35 pm
Location: Chartres (France)
Callsign: helijah
IRC name: helijah
Version: GIT
OS: GNU/Linux

Re: Blender 2.59 AC3D importer - now taking feature requests

Postby majic79 » Tue Oct 04, 2011 3:34 pm

Ah well, as long as the API doesn't change too much, going to 2.6 should be fairly easy
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

Re: Blender 2.59 AC3D importer - now taking feature requests

Postby helijah » Thu Oct 20, 2011 7:47 am

Hello all,

This morning, when updating my OS, version 2.60 of Blender has arrived :)
Image

I warned Melchior:) Now hope that the scripts coming soon :)

Regards Emmanuel
Some planes (and other) for FlightGear
http://helijah.free.fr
and
http://embaranger.free.fr
User avatar
helijah
 
Posts: 1038
Joined: Wed Dec 27, 2006 12:35 pm
Location: Chartres (France)
Callsign: helijah
IRC name: helijah
Version: GIT
OS: GNU/Linux

Re: Blender 2.59 AC3D importer - now taking feature requests

Postby majic79 » Thu Oct 20, 2011 12:19 pm

Right, time for me to get updating and testing!
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest