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.

Blender 2.6 AC3D Importer & Exporter

Postby majic79 » Sat Sep 10, 2011 3:17 pm

Want to play with blender 2.6?
Fustrated with no import/export utility to use .ac files within blender?

What you need is the new and improved blender 2.6 import_ac3d scripts!

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

I've spent this morning going through the code, tidying a few loose ends up and polishing things up for 2.59. I've tagged that download as well, so if anyone's still using 2.59, they can get that copy and use that

I've also tested on blender 2.6 and tweaked that so that it's now working (on initial test) with the latest version.

Known Issues:
- Export options limited to "Export Everything" (regardless of which layer it's on) or "Export Selected", I want to add a "Scene Visible Objects" option to only export the objects that appear on the layers selected for the view context
Last edited by majic79 on Sun Jan 29, 2012 3:48 pm, edited 6 times in total.
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

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

Postby i4dnf » Sat Sep 10, 2011 4:42 pm

I have not tested your script yet, but wanted to make you aware of another porting project for the AC3D import/export scripts for Blender 2.5x. Maybe you guys can share knowledge and avoid some duplication. This script was/is in quite and avanced development stage.
The other project is here: http://rene16.dyndns.org/run/
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 AC3D importer - now with special 2.5 flavour!

Postby majic79 » Sat Sep 10, 2011 5:25 pm

I didn't know about it, thanks for that. I don't know if I'll get in touch directly - I wanted to play around with blender today and didn't fancy waiting or looking too deeply (I did google ac3d and blender 2.5 first - it didn't show up when I searched)

I've just been tweaking my code to support various options - I think I'm about at the stage where he is, I've ditched the pre-defined rotational matrix in favour of the axis-correction routines supplied by blender, this means that things imported from .ac into blender will be oriented for left handed axis (same as AC3D I think) - so tailfin goes up on the Y axis, wings elongate on the Z axis and X axis is as before.

I'm just working on the export and then if I get chance, I'll get the transparency stuff working as well :D
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

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

Postby majic79 » Sun Sep 11, 2011 12:32 am

I had a look at rene's stuff... maybe I've gone too far, anyway, I'm largely done on the import side of things

anyway, I've tweaked a few things and modified others, I've also re-hosted it on github (mainly because I can't update the files in the tracker in the original link):

https://github.com/majic79/Blender-AC3D
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

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

Postby Mossie » Sun Sep 11, 2011 4:18 pm

I've saved the three files into the io_scene_ac3d folder, copied that into Blender location.

Run Blender, and looked to select the addin, it is not listed. Looked at install, no go either.

So I'm stuck not able to test this addon, help please......
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 » Sun Sep 11, 2011 5:26 pm

did you copy io_scene_ac3d to (blenderfolder)/2.59/scripts/addons?

What are you using? linux or windows?
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

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

Postby Mossie » Sun Sep 11, 2011 5:53 pm

On Windows 7 Pro
Copied the folder direct, checked files in place ok
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 » Sun Sep 11, 2011 9:35 pm

hmmm, well I've not tried it on windows yet, allow me to reboot and I'll install blender on my win 7 disk and see if I can get it to work...
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

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

Postby majic79 » Sun Sep 11, 2011 10:13 pm

right, here's what I did:

download the io_scene_ac3d folder and it's contents, dropped that folder into
C:\Program Files\Blender Foundation\Blender\2.59\scripts\addons

so now I have this folder:

Image

Then to enable the addon, start blender, go to File->User preferences and the addon appears like so:

Image

You must check the box on the right to enable it (by default it's not checked and the box is slightly greyed out - just tick the box to enable it)

And now I can import .ac files:

Image

here's the c172p model in blender, imported with the addon

Image

Some of the complex models have faces with more than 4 vertices (apache, A10...) and they fail to load, I'm working on that after I've got the export fully functional!

edit: whoops, forgot the imported image....
Last edited by majic79 on Mon Sep 12, 2011 1:16 pm, edited 1 time in total.
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

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

Postby Mossie » Mon Sep 12, 2011 7:00 am

I see the problem already, the additional folder in your screenshot: "_pycache_" I don't have that. It was not part of the pack you provided.
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 » Mon Sep 12, 2011 11:02 am

you don't need it - it's generated automatically when the python scripts are run within blender

Edit: A quick thought - what version of Blender are you using? This script is targetting blender 2.59 (it ought to work on 2.57 and upwards)
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

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

Postby Mossie » Mon Sep 12, 2011 1:15 pm

2.59

Means I must have done something wrong, will try again.
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 » Mon Sep 12, 2011 1:19 pm

Mossie wrote in Mon Sep 12, 2011 1:15 pm:2.59

Means I must have done something wrong, will try again.


Can you try the https://github.com/majic79/Blender-AC3D link, there should be a download button in the top right to get a .zip of the sources. Extract that to your documents or somewhere, then copy the io_scene_ac3d folder into the location I've shown (Program Files\Blender Foundation\blender\2.59\scripts\addons) It might be that you've got an earlier version (somehow) that's missing some critical information or breaks the addon for some reason
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

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

Postby Mossie » Mon Sep 12, 2011 1:25 pm

Ok, got as far as seeing importer.

Run against one of my models and get error message in Blender:
Image
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 » Mon Sep 12, 2011 1:53 pm

Mossie wrote in Mon Sep 12, 2011 1:25 pm:Ok, got as far as seeing importer.

Run against one of my models and get error message in Blender:


Yep - this one of the problems at the moment - there's some polygon faces that have more than 4 points (eg, pentagons, hexagons etc) which blender doesn't handle, there used to be a method to convert them into triangles (using a function called PolyFill - that's what the error's about) but that function doesn't exist in 2.5, I'm still looking for an equivalent, or trying to finding an alternative method to fix this.

Models that I've imported with success:

Cessna C172p, Fokker 100/Fokker 70

Models with issues:
Apache
A10
majic79
 
Posts: 107
Joined: Fri Dec 28, 2007 8:40 pm
Callsign: majic79
Version: 2_4_0
OS: GNU/Linux

Next

Return to Development

Who is online

Users browsing this forum: No registered users and 2 guests