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

Postby Hyde » Sat Jan 07, 2012 11:56 pm

I import the AC3D file using 2.61 and export without any modification but texture is gone and get strange color.
Is this your mentioning "Export doesn't export the UV references for texture mapping"?
If so, can it be fixed by manual easily?
Hyde
 
Posts: 724
Joined: Fri Aug 12, 2011 2:09 pm
Location: Peachtree city, GA
Callsign: N407DS
Version: GIT
OS: Fedora 25

Re: Blender 2.6 AC3D importer

Postby JC_SV » Tue Jan 24, 2012 5:25 am

Would you mind trying this scripts I have joined and modified a little bit ( From Rene's = _run_ and majic79 which I have been recently using in Blender 2.60a

EDITED: LINK ERASED due to new and better aproach from Majic79. You will find the link to download them some post below this.


P.S. Actually they seem to work with Blender 2.61 and 2.60a, I did some quick test with 2.61 and seems to be working. If anybody tries this and can give feedback ... More testing is needed. Textures were exported fine. No need to edit and eliminate textures paths.

After copying them in your Blender addons folder remember to go to : --> User Preferences --> Addons --> Impor-Export
and then enable both : Import-Export: AC3D (.ac) format and
Import-Export: AC3D Exporter
then save user settings.

I am not responsible for any work lost ! Try them first. I have not had time to test them carefully but they work for me.

Best Regards Everybody.
Last edited by JC_SV on Sat Jan 28, 2012 6:07 pm, edited 1 time in total.
JC_SV
 
Posts: 80
Joined: Tue Nov 29, 2011 8:06 pm

Re: Blender 2.6 AC3D importer

Postby mr_no » Tue Jan 24, 2012 4:24 pm

I did a very simple "cube test" and it worked with 2.61.
Just make sure the .blender, the exported .ac and textures are in the same folder, or you'll have problems with paths.
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

Postby mr_no » Tue Jan 24, 2012 5:36 pm

Also with a much more complex scene it worked in 2.61.
What exactly doesn't work in 2.61?
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

Postby JC_SV » Tue Jan 24, 2012 6:24 pm

My first test with 2.61 last night did not succeeded so I concluded It would not work. I downloaded Blender 2.61 yesterday and asume these scripts would not work after my first failure.I had been using Blender 2.49 most of the time and 2.60a sometimes. But today tests in Blender 2.60a and 2.61 gave good results. The only issue I have found is that Blender 2.60a shows the wrong texture but this ONLY happens when you open other object with the same name in texture ( I usually use the name colors.png to name textures ). BUT Blender keeps the wrong file texture assigned ( with the same name ) even if you close it and open again.
I found two ways to get the right texture image assigned:
1.- Go to File --> Load Factory Settings ( and clic it ) . After doing this you will have to enable again the addons in --> User Preferences --> Addons --> Impor-Export ) because they are not enable by default. Doing this the mismatch texture is fixed when you import an object with a duplicated texture's name.

2. Go to EDit Mode and in --> UV/Image Editor --> Image --> Replace Image for the right one !

But it can be avoided if we use unique names for textures ( like refering to the name of the model ) instead of a generic name like "colors.png" . But it only happened to me in Blender 2.60a ( BUT not in Blender 2.61 ! ) . Anyway, It does not affect osgviewer because it is supposed that the texture file should be in the same folder as the model where osgviewer looks for it .
Last edited by JC_SV on Sat Jan 28, 2012 6:08 pm, edited 1 time in total.
JC_SV
 
Posts: 80
Joined: Tue Nov 29, 2011 8:06 pm

Re: Blender 2.6 AC3D importer

Postby mr_no » Tue Jan 24, 2012 10:20 pm

I love 2.5+ Blender so I tried to fix Majics exporter but I failed.
Thank you!
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

Postby helijah » Wed Jan 25, 2012 12:34 am

Hey JC_SV

As I have said on my forum, everything works perfectly with Blender 2.61. It's great:) A big thank you to you.

To my tests, I made an update of Arup S2 in my shed. Import of various ac files. Correction and exports. As anyone can see, the Arup S2 is now updated with no problem :)

http://helijah.free.fr/flightgear/les-appareils/arup/appareil.htm
Image

Regards. Emmanuel
Some planes (and other) for FlightGear
http://helijah.free.fr
and
http://embaranger.free.fr
User avatar
helijah
 
Posts: 1336
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

Postby penta » Wed Jan 25, 2012 8:48 am

It works great also for me with blender 2.61 under windows XP. I also checked if it works with blender 2.58 that ships with ubuntu 11.10 but it failed.
Thanks for your work!
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

Postby JC_SV » Thu Jan 26, 2012 7:13 pm

Thanks mr_no (Mister_No? I'm kidding... Image ) , Helijah and Penta for the feedback. It was nice to hear it is working for you guys.
I had time to use them yesterday in Blender 2.61 with many models from B-25 aircraft and it worked nice. I hope Blender's users get these script... and thanks to Majic79 and Rene( _run_) for their work !
Cheers
JC_SV
JC_SV
 
Posts: 80
Joined: Tue Nov 29, 2011 8:06 pm

Re: Blender 2.6 AC3D importer

Postby mr_no » Thu Jan 26, 2012 11:47 pm

No problem, and yes it's Mister No.
http://en.wikipedia.org/wiki/Mister_No
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

Postby 439Tiger » Fri Jan 27, 2012 12:59 am

I have a different version where the export file is named "export_ac3d.py".

Can anyone tell me which is the correct one to use? The importer works fine, but I haven't tried the exporter.
Specializing in Canadian built aircraft and aircraft flown by the RCAF

http://www.flightgearcanada.ca/ or: https://sites.google.com/site/flightgearcanada/
User avatar
439Tiger
 
Posts: 1163
Joined: Sat Jan 01, 2011 3:39 am
Location: St-Georges-de-Beauce, Québec, Canada (CYSG)
Callsign: C-CYSG
Version: 2.10.03
OS: Windoze 7

Re: Blender 2.6 AC3D importer

Postby majic79 » Sat Jan 28, 2012 12:15 am

I've just been through the scripts and made some modifications - the exporter now copies textures to the same location as the exported .ac file, and UV references are also included in the export (I think they may have been in a previous update, but I hadn't updated my first post to reflect this)

I've got a little tidying up to do (some TRACE's left in the script from my debugging) but it's late and I've been drinking - be interesting to compare my code to that of others, but probably won't get much of a chance this weekend :(
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

Postby majic79 » Sat Jan 28, 2012 12:22 am

439Tiger wrote in Fri Jan 27, 2012 12:59 am:I have a different version where the export file is named "export_ac3d.py".

Can anyone tell me which is the correct one to use? The importer works fine, but I haven't tried the exporter.


I can't speak for the other developers - but on my github page, the latest version (uploaded this evening, about 10 minutes prior to this post) is the "correct" version
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

Postby JC_SV » Sat Jan 28, 2012 6:04 pm

Majic79:
I downloaded and tested the scripst and they work perfectly. The Exporter even copy the texture file to the folder destination. It does not write ( overwrite) the texture file if you already have a texture with the same name. That's really a good feature! .Your aproach is better and more elegant. I am going to edit my post with "my modified and joined scripts" and erase the link to have people downloading the same script from your github to avoid confusions whe anybody ask for help like 439Tiger.
It is good you added a Readme.txt with instructions to install this scripts to help new users of Blender. Thanks Majic79
By the way, I tested in Blender 2.61, anybody else using Majic79 Scripts in another version of Blender should give some feedback about them.

Here is the link for Majic79 good work :

https://github.com/majic79/Blender-AC3D


Best Regards

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

Re: Blender 2.6 AC3D importer

Postby 439Tiger » Sat Jan 28, 2012 6:29 pm

Hi JC_SV,

Thank you for posting the link, I have already dowloaded it.You saved me a bunch of time searching the forums to find the address to majic79's GIT hub. :D
Specializing in Canadian built aircraft and aircraft flown by the RCAF

http://www.flightgearcanada.ca/ or: https://sites.google.com/site/flightgearcanada/
User avatar
439Tiger
 
Posts: 1163
Joined: Sat Jan 01, 2011 3:39 am
Location: St-Georges-de-Beauce, Québec, Canada (CYSG)
Callsign: C-CYSG
Version: 2.10.03
OS: Windoze 7

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 5 guests