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 mr_no » Wed Feb 08, 2012 2:01 am

mr_no wrote:mr_no_blenderAC3D_03022012.zip
http://www.mediafire.com/?6e6e1gc8plok9o9

This preliminary script will import anything except that one big n-gon. N-gons are faces that have more than 4 vertices, and are not supported in Blender. They can however be converted to triangles. I did that in my newer script tests, but the uv maps present a challenge. I need to look into that.

TheTom wrote in Tue Feb 07, 2012 5:59 pm:Also the .ac files has some strange surface codes (0,1,2 allowed but 3 used...). Where does this file come from?

SURF 0x30 is allowed.
0000000001 = 1 Low flag means face is smooth.
0000000010 = 2 High flag means face is double sided.
1+2=3 means the face is both smooth and double sided.
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 360
Joined: Thu Jan 19, 2012 3:20 pm

Re: Blender 2.6 AC3D Importer & Exporter

Postby TheTom » Wed Feb 08, 2012 12:14 pm

mr_no wrote in Wed Feb 08, 2012 2:01 am:0000000001 = 1 Low flag means face is smooth.
0000000010 = 2 High flag means face is double sided.

Thats what I thought, because it said the first 4 bits are for the type and the second 4 bits for the shading. But the first 4 bits are only the first if you store the byte as little-endian... But yes, you are right :)
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 11:20 am

Re: Blender 2.6 AC3D Importer & Exporter

Postby mr_no » Wed Feb 08, 2012 3:18 pm

The file format instructions are a little confusing.
...The first 4 bits (flags & 0xF) is the type ...

The first 4 bits are those to the right because hex numbers are read and stored from right to left!
So the "0" in the "30" is the type, and means it's a face. The "0" is the first 4 bits!
It can be very confusing.
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 360
Joined: Thu Jan 19, 2012 3:20 pm

Re: Blender 2.6 AC3D Importer & Exporter

Postby helijah » Wed Feb 08, 2012 9:31 pm

Hi all,

Concerning face of more than 4 points I would not comment too much so this is ridiculous in 3D. 3 points and 4 sometimes... but never more.In any case the rendering algorithms work only with triangles :)

Otherwise your work is fantastic and really begin to become interresting :) Cheer all !

Yesterday I tested the latest version (GIT version ) and I noticed a small problem. It is also a problem of number of points in faces :) Indeed, more than 4 is a bad idea, but it gets worse. This is less than 3 ! Yet it is useful for creating cables and son. See the Farman IV, the Bleriot XI, B17 etc. .... Currently the import and export are only points. Segments joining them are not present ..... yes I know the faces to two points is strange :)

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

Re: Blender 2.6 AC3D Importer & Exporter

Postby penta » Wed Feb 22, 2012 8:53 pm

I have problems exporting to ac from Blender 2.61 under ubuntu 11.10 with latest majic79 script. The problem is that the reference to the texture image is not in the ac file. The JC_SV script worked but I havn't it no more.
penta
 
Posts: 238
Joined: Mon Dec 29, 2008 12:05 pm
Location: Parma-Italy
Version: Git
OS: Ubuntu Linux

Re: Blender 2.6 AC3D Importer & Exporter

Postby mr_no » Wed Feb 22, 2012 9:26 pm

Read back in this thread.
If you need exporting you can use my preliminary script. Remember to put texture in UV editor.
http://www.flightgear.org/forums/viewtopic.php?f=18&t=13442&start=105#p149463
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 360
Joined: Thu Jan 19, 2012 3:20 pm

Re: Blender 2.6 AC3D Importer & Exporter

Postby JC_SV » Fri Feb 24, 2012 1:39 am

penta wrote in Wed Feb 22, 2012 8:53 pm:I have problems exporting to ac from Blender 2.61 under ubuntu 11.10 with latest majic79 script. The problem is that the reference to the texture image is not in the ac file. The JC_SV script worked but I havn't it no more.


Hi. I erased the links for downloading my scripts becasue other scripts have resolved some issues and added more functions AND I didn't want us to have many diferent versions of the script wich leads to some issues. .

Since you don't know wich script was used to create .ac file I decided to have both version of scripts but in diferent "versions" of Blender ( "versions" = folders because both are 2.61 but I am talking about versions of scripts for importing-exportin .ac file )
I am now using Majic79-TheTom Scripts and mr_no. BOTH but no together. HOW: To avoid a real mess with them I made a copy of the Blender folder (Blender2.61-linux-glibc21 ...etc) and renamed to Blender2.61_MajicTheTom and place the Script from Majic79 and TheTom there. And the other copy I renamed to Blender2.61_MrNo and place his script there. Then I created two Shorcuts one for each folder of Blender. When I have issues opening a file with one "version" I switch to the other "version". When I have problems Exporting I save it to .blend file and open it with the other version.

NOTE: 1) With Majic79_TheTom scripts there is an issue with the importer not applying the smoothing. The mayor problem is that you have to reapply smoothing to some objects because you get them "flat" after exporting. But this scrips can open files with thextures path like "../../../texture.png"
2) Wih mr_no Scripts I got errors when opening files with textures path "../../../../texture.png". The good thing here is that with Mr_No Scripts you don't have to bother applying Smooth Shade every time before you export.

I hope I explained myself well

Best Regards
JC_SV
JC_SV
 
Posts: 80
Joined: Tue Nov 29, 2011 8:06 pm

Re: Blender 2.6 AC3D Importer & Exporter

Postby penta » Sat Feb 25, 2012 11:04 am

Thanks for the help. I was able to export with mr_no script with blender 2.61 but the objects of the exported model are rotated. This behavior happens only in a model I've imported in a blend file some time ago, probably with a old version of the Majic79 script. If I use blender 2.49 I don't have this problem. I noticed that in wireframe view there are dashed lines that points to a cross. If I delete this cross, the objects are rotated as in the exported model with mr_no script.
penta
 
Posts: 238
Joined: Mon Dec 29, 2008 12:05 pm
Location: Parma-Italy
Version: Git
OS: Ubuntu Linux

Re: Blender 2.6 AC3D Importer & Exporter

Postby DFaber » Sat Mar 03, 2012 2:44 pm

Hi Guys,

I have found out what was causing the problem with export without texture. First off, Majics Exporter works flawless, it was just a matter of Material Settings within Blender. To get this working correct, one needs to explicitly set the Texture file for each texture mapped Material in Blenders Texture Tab. Finally, set the Mapping Coordinates to UV and your done!

Greetings and a big thanks for the fantastic Exporter!
Detlef Faber
FlightGear Development:
http://flightgear-de.net

my 3D-Art:
https://www.sol2500.net
DFaber
 
Posts: 709
Joined: Fri Dec 01, 2006 8:51 pm
Location: Aachen, Germany
Version: GIT
OS: Linux

Re: Blender 2.6 AC3D Importer & Exporter

Postby majic79 » Sun Mar 04, 2012 2:12 pm

I'm glad to see that the majority of problems are worked out - many thanks to TheTom for the fixes he's applied

I suppose my only question now is what's not working, or not working as people expect?

I'm back with some time to spare on the project now, if there's any work needed
majic79
 
Posts: 106
Joined: Fri Dec 28, 2007 9:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

Re: Blender 2.6 AC3D Importer & Exporter

Postby TheTom » Mon Mar 05, 2012 10:37 am

For me the exporter works without problems (apart from uv coord export not working with latest blender from svn, but theres nothing we can do about it now). I'm not using the importer very much but I think there are still some problems with correctly importing smoothing settings and creating way to much materials (new material for every texture with otherwise same material settings). Also importing lines (2 vertices) and faces with more than 4 vertices doesn't work, but maybe we should wait for the next blender release where the integration of the new bmesh should be completed. Among other things they allow faces with an arbitrary number of vertices, which should make importing them very easy - at least when the python api will be available :)
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 11:20 am

Re: Blender 2.6 AC3D Importer & Exporter

Postby TheTom » Wed Mar 14, 2012 9:00 am

I have created a new branch (https://github.com/majic79/Blender-AC3D/tree/bl-svn) which supports the latest blender version from SVN. Because of some API changes it does NOT work with the current blender official release (2.62). Additionally it is now also able to export curves (as triangle meshes) and faces with any number of vertices (>2, thanks to the new bmesh implementation).
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 11:20 am

Re: Blender 2.6 AC3D Importer & Exporter

Postby helijah » Sun Apr 29, 2012 1:10 am

Hi TheTom

I just received the version 2.63 of Blender. And now no script works :(

Image

help
Some planes (and other) for FlightGear
http://helijah.free.fr
and
http://embaranger.free.fr
User avatar
helijah
 
Posts: 1339
Joined: Wed Dec 27, 2006 1: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 » Sun Apr 29, 2012 9:49 am

BMesh is the new Blender mesh system with full support for N-sided polygons instead of only triangles and quads.

Since they have a new mesh system the importer will need to be updated.
Downloading it right now.
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 360
Joined: Thu Jan 19, 2012 3:20 pm

Re: Blender 2.6 AC3D Importer & Exporter

Postby TheTom » Sun Apr 29, 2012 10:23 am

I've pushed a new version which should support importing, but without materials yet. Exporting should work without problems, does it?
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 11:20 am

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 10 guests