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 2.6 AC3D Importer & Exporter

Postby TheTom » Fri Jun 15, 2012 9:05 pm

mr_no wrote in Wed Jun 13, 2012 2:50 pm:TheTom, try importing cessna c172p. You'll see broken surface left on the panel.

Hm. I've tried both importers and can't see any obvious differences. Do you have a screenshot? I've just a very strange problem with your importer. Importing of the c172p.ac works but as soon as I switch to textured mode blender freezes the whole system and gets killed after a time.

Btw. your exporter can't handle spaces in material names...

mr_no wrote in Wed Jun 13, 2012 2:50 pm:Also from the original 39 materials in the .ac file the imported model has over 50 materials.

Sounds like a bit too much :) I'll have a look at this.

mr_no wrote in Wed Jun 13, 2012 2:50 pm:Also your exporter exports ngons as triangles not as original ngons. The conversion ngons to triangles isn't longer needed since Blender 2.63 supports ngons. You can also import and export original ngons in my script.

I'm just using the Blender tesselator. I don't think it makes too much sense to also export ngons as you'll never know how the target application can handle arbitrary ngons. If just triangles are exported you can be sure that they will be correctly tesselated and not become some degenerated polygons.

Are there some special reasons that want to export ngons?

I don't know if there are programs exporting ngons but if there is a need for it I'll also add support for importing ngons.
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 10:20 am

Re: Blender 2.6 AC3D Importer & Exporter

Postby mr_no » Thu Jun 21, 2012 12:11 pm

Again, the hole in the control panel is located to the left.

And you are right, my exporter is a little unstable if you do multiple imports in a row. There are some smaller issues like you mentioned but it was not meant for public use from the beggining. I made one for my own use, because I need to understand what happends with all the data from an .ac file.

My script should be considered a first help script in a situation where there's a lack of sufficient more professional script that works in all basic areas.

Importing and exporting ngons is needed so that the polygons that an artist made are in their original shape. It's not up to the script author to decide how model should look like. Leave that to the artist.
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 362
Joined: Thu Jan 19, 2012 2:20 pm

Re: Blender 2.6 AC3D Importer & Exporter

Postby TheTom » Thu Jun 21, 2012 3:08 pm

mr_no wrote in Thu Jun 21, 2012 12:11 pm:Again, the hole in the control panel is located to the left.

I still can't see any differences in the panel:
Image
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 10:20 am

Re: Blender 2.6 AC3D Importer & Exporter

Postby mr_no » Fri Jun 22, 2012 9:43 pm

Why is your panel called panel_1_1??? Did you edit anything? It's just "panel".
Are you using Blender 2.63? That doesn't look like it.

This is what I get:
Image
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 362
Joined: Thu Jan 19, 2012 2:20 pm

Re: Blender 2.6 AC3D Importer & Exporter

Postby TheTom » Fri Jun 22, 2012 10:11 pm

Very strange. I'm using the latest Blender from SVN (currently 2.63.13, r48178) on Ubuntu 12.04. I have imported fgdata/Aircraft/c172p/Models/c172p.ac from the latest fgdata/master without any modification. The panel itself is called panel_1_1 but it has also empty parents panel_1 and panel. I have also downloaded the latest release from blender.org and got the same results...
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 10:20 am

Re: Blender 2.6 AC3D Importer & Exporter

Postby mr_no » Sat Jun 23, 2012 12:54 am

My import is from the 2.6.0 release not from GIT.
The GIT version has been updated.
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 362
Joined: Thu Jan 19, 2012 2:20 pm

Re: Blender 2.6 AC3D Importer & Exporter

Postby xiii » Sun Jul 22, 2012 10:09 pm

mr_no wrote in Tue Jun 12, 2012 10:08 pm:The most important: You can only have one texture per object in AC3D format even if you used many materials!!!
So why have many materials when you used the same texture? This will complicate things for you.
Also I recommend" one object -one material" to make UV mapping easier.


I mister No,

Well, I do a lot of modelling with AC3D and I would say that it is very cool to do simple objects that have one part glossy and the other matted.
Any modeller has his own habits, and I suppose that when using a format, like .ac, the modeller will want to use all the features available in this format. At least the modeller would not like to know that some things are forbidden because someone thinks that it would be simpler.
I know, it is not obvious to guess how all other people like to work. But it can be a problem to reduce the features of a tool just because you think modellers need simple things ;-)

If AC3D can things, if Blender can those things too, reducing the set of feature in between gives twice the loss... Now I'm aware that the problem might be difficult to handle in the importer.

That said, I'm very happy that people create and take care of tools to make our life better :-) Thanks,

Alexis
If the engines are Pratt and Whitney, the seats best be Martin Baker
xiii
 
Posts: 472
Joined: Tue Jan 08, 2008 10:04 pm

Re: Blender 2.6 AC3D Importer & Exporter

Postby mr_no » Thu Jul 26, 2012 1:59 pm

xiii wrote in Sun Jul 22, 2012 10:09 pm:...But it can be a problem to reduce the features of a tool just because you think modellers need simple things ;-) If AC3D can things, if Blender can those things too, reducing the set of feature in between gives twice the loss..

You are absolutely right. Since someone already wrote the exporter I have the importer left to write.
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 362
Joined: Thu Jan 19, 2012 2:20 pm

Re: Blender 2.6 AC3D Importer & Exporter

Postby mr_no » Thu Jul 26, 2012 11:53 pm

Here's a new version. I implemented Tigran's changes and coded the importer as well. Now faces can have different materials and share materials with faces of another object. No material duplicates are created on import or export.
mr_no_blender263_AC3D_27072012.zip-deleted
Last edited by mr_no on Fri Jul 27, 2012 6:52 pm, edited 1 time in total.
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 362
Joined: Thu Jan 19, 2012 2:20 pm

Re: Blender 2.6 AC3D Importer & Exporter

Postby helijah » Fri Jul 27, 2012 12:44 am

Hey mr_no

I just try your last version.

Import work fine. Fast, all objects are there (even segments :)). bravo.

For export, I have this :
Image
I tested with aircraft imported, and former Blender file, the result is the same. But maybe (probably) that I had to make a mistake somewhere in the installation :(

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

Re: Blender 2.6 AC3D Importer & Exporter

Postby mr_no » Fri Jul 27, 2012 8:59 am

Interesting bug. You are using an exported file (he111.ac) with faces and edges with "DefaultWhite" material assigned. Then when you try to export the exporter gets confused because DefaultWhite is in this case there only for objects without materials.
You can still export just don't call the material DefaultWhite. Rename it to something else. :P
I never came across this problem. Let me see what I can do.
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 362
Joined: Thu Jan 19, 2012 2:20 pm

Re: Blender 2.6 AC3D Importer & Exporter

Postby helijah » Fri Jul 27, 2012 11:32 am

Hey mr_no

I use material "DefaultWhite" but it's not for object without material. All object use "DefaultWhite" (exept tranparent of course) :)
Image

Use more "material" on the same object is error sources and problems :) (I created a few planes and accumulated experience allows me to say lol )

If the simplest solution is to change the name of default material, this does not bother me. Only one change per aircraft. It is not difficult :)

Regards Emmanuel

P.S. I just take the test, by changing "DefaultWhite" with "Neutral" and everything works perfectly (import and export) :)
Some planes (and other) for FlightGear
http://helijah.free.fr
and
http://embaranger.free.fr
User avatar
helijah
 
Posts: 1097
Joined: Wed Dec 27, 2006 12:35 pm
Location: Chartres (France)
Callsign: helijah
IRC name: helijah
Version: GIT
OS: GNU/Linux

Re: Blender 2.6 AC3D Importer & Exporter

Postby mr_no » Fri Jul 27, 2012 3:29 pm

I will upload new script tomorrow that allows you to use DefaultWhite. The "DefaultWhite" material is used internally in the script when exporting objects without material.
In Blender you can have objects without material, but NOT in AC3D. In AC3D every object must have a material.
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 362
Joined: Thu Jan 19, 2012 2:20 pm

Re: Blender 2.6 AC3D Importer & Exporter

Postby helijah » Fri Jul 27, 2012 4:03 pm

mr_no wrote in Fri Jul 27, 2012 3:29 pm:I will upload new script tomorrow that allows you to use DefaultWhite. The "DefaultWhite" material is used internally in the script when exporting objects without material.
In Blender you can have objects without material, but NOT in AC3D. In AC3D every object must have a material.


I use Blender, but NEVER, I created an object without "material". This fault is that we should not commit :)

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

Re: Blender 2.6 AC3D Importer & Exporter

Postby mr_no » Fri Jul 27, 2012 6:57 pm

Fixed here. Also fixed materials on edges and some other smaller tweaks.
mr_no_blender263_AC3D_28072012.zip
When importing make sure textures are all in place.
Feel free to find something it can't import or export.
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 362
Joined: Thu Jan 19, 2012 2:20 pm

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron