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 DFaber » Tue Jun 02, 2015 12:47 pm

Necolatis wrote in Tue Jun 02, 2015 4:40 am:Here is how to setup your texture if you use my modified Majic79 script (or the original).

https://www.youtube.com/watch?v=URMjoFSm5pk


it's working now, Thanks again! But I noticed that the Crease Angle seems to be wrong. It hasn't wrote the angle in degrees into the .ac file, but the value in radians that was given by the popup of the "default Crease Angle" Dialog. Not much of a thing with Aircraft, but the walker looked much too edgy :-)

Greetings
Detlef Faber
FlightGear Development:
http://flightgear-de.net

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

Re: Blender 2.6 AC3D Importer & Exporter

Postby Necolatis » Tue Jun 02, 2015 6:30 pm

oops, will look into it right away.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2113
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Blender 2.6 AC3D Importer & Exporter

Postby Necolatis » Tue Jun 02, 2015 7:04 pm

Exporter should be fixed now, if you go here: https://github.com/NikolaiVChr/Blender-AC3D

I also included a fix for the importer. In rare cases it would change the order of vertices in a face such that the UV coords would not match it anymore. (was an old bug from majic79's code).
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2113
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Blender 2.6 AC3D Importer & Exporter

Postby Necolatis » Wed Jun 03, 2015 4:42 am

I have made a new wiki page for Blender import/export scripts, so users do not have to look through 20 pages of forum thread to find the addon they need.

http://wiki.flightgear.org/Blender_AC3D ... and_export
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2113
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Blender 2.6 AC3D Importer & Exporter

Postby Catalanoic » Wed Jun 03, 2015 6:21 am

Thankyou!
User avatar
Catalanoic
 
Posts: 1075
Joined: Mon Mar 05, 2012 12:33 am
Location: Barcelona (LEBL)
Callsign: Catalanoic
Version: 2017.3
OS: Lubuntu/Windows 7

Re: Blender 2.6 AC3D Importer & Exporter

Postby Necolatis » Wed Jun 03, 2015 12:09 pm

The exporter will no longer tessellate the polygons. This could give a slight performance improvement in Flightgear for aircraft with many faces that have more than 4 edges.

Also if you downloaded from my repo some hours ago, there was introduced a bug in the exporter, it is fixed about an hour ago.

The importer will now also import lines. The exporter will not export lines however, only vertices and polygons.

I will make a request to merge this into the Majic79 repo, after some more testing/feedback. For now you can download it from my repo.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2113
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Blender 2.6 AC3D Importer & Exporter

Postby Nick R » Tue Jun 30, 2015 12:06 am

I'm having an issue in blender 2.74 where some objects with shading set to smooth don't get exported that way.
Here's an image of the model in blender:
Image

And an image of after exporting it:
Image

As can be seen after exporting the fuselage has a smooth shading as it should have but the seats have a flat shading which they shouldn't have :x .

P.S. This only happened after some recent updates to the plugin.
Hangar: fgpipistrel.org
Modelling the Pipistrel Virus SW (github, website)
Nick R
 
Posts: 173
Joined: Tue Nov 26, 2013 3:50 pm
Location: Stettler, AB, Canada
Callsign: NickR
Version: 2017.2.1
OS: Linux

Re: Blender 2.6 AC3D Importer & Exporter

Postby Necolatis » Tue Jun 30, 2015 1:56 am

Could you possibly give me a link to the blend file?
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2113
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Blender 2.6 AC3D Importer & Exporter

Postby Nick R » Tue Jun 30, 2015 2:08 am

In my signature is a link to the github repo.
https://github.com/Nick-R9/pipistrel-virus-sw
Hangar: fgpipistrel.org
Modelling the Pipistrel Virus SW (github, website)
Nick R
 
Posts: 173
Joined: Tue Nov 26, 2013 3:50 pm
Location: Stettler, AB, Canada
Callsign: NickR
Version: 2017.2.1
OS: Linux

Re: Blender 2.6 AC3D Importer & Exporter

Postby Necolatis » Tue Jun 30, 2015 3:18 am

- When you export make sure to pay notice to the default crease angle export option, if really in doubt maybe set it to 61 degrees thats the default FG will apply anyway if if no crease angle is specified in the AC3D object. Although a bit high for many uses, is why I set the default to 35.

- You have made some edgesplit modifiers with angle they export fine. But do remember that AC3D do NOT support 'sharp edges'. So you should only use the angle. For example for your 'fairing_front', you have specified no angle, but you have marked some sharp angles, to see how it will look in Flightgear, be sure to tick off the 'sharp angles' option, and use angle instead. Or use auto-smooth angle, that will do the same as edge-split with angle. If you cannot find the right angle due to some edges being smoothed while shouldn't and some get sharp where you prefer smooth, then you will have to edge split (the option, not the modifier) and then put an angle high enough so that it gets sufficiently smoothed where it should be.

- I notice in your picture that the seats are not smoothed. They do not have a edge-split modifier with angle nor a auto-smooth angle, therefore they will be exported with the default crease angle you specify in export options. I am guessing you either set it very low or you have used the script from https://github.com/majic79/Blender-AC3D, which have a bug that crease angles will be output as radians instead of degrees and therefore will be very low. That bug has been fixed here: https://github.com/NikolaiVChr/Blender-AC3D, I have requested a merge into Majic79, but it has not happened yet, so the bug is still there. If you scroll some posts back you will see DFaber reporting the bug. So just download the script from my site until the merge happens.

- Other bugs has also been fixed in the scripts if you download them from my repo instead of Majic79's repo, so I can only recommend that. It also has some additional features, like no tesselation of faces that contain more than 4 vertices. It was last updated yesterday with improvements (and some bug fixes [not introduced by me]) to the way materials are imported/exported.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2113
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Blender 2.6 AC3D Importer & Exporter

Postby Nick R » Tue Jun 30, 2015 3:26 am

Thanks for the information. :)
Hangar: fgpipistrel.org
Modelling the Pipistrel Virus SW (github, website)
Nick R
 
Posts: 173
Joined: Tue Nov 26, 2013 3:50 pm
Location: Stettler, AB, Canada
Callsign: NickR
Version: 2017.2.1
OS: Linux

Re: Blender 2.6 AC3D Importer & Exporter

Postby japreja » Tue Jun 30, 2015 12:39 pm

Hi Necolatis,

I have noticed there are 3 total scripts that import/export .ac files. They all work OK depending on which version of Blender you use. and I would like to see if we can take the 3 scripts and combine them all into one. The AC3D importer/Exporter is the best so far as I have tried. Some older .ac files seem to cause an error and when I find one I will point you to it, as requested in another topic.

The 3rd script I am speaking of is fg2blender which, according to other users, works fine on linux systems. I found a few bugs with the fg2blender script on Windows, I think it is mainly regarding line endings and UTF encoding. I am going to spend the next few weeks rewriting the fg2blender script since it has a very interesting feature, it imports/exports Bones animations to/from FlightGear .xml files and I have been learning how to use it by trial an error. All current documentation is in French and googles translate is mangling some sentances. Hopefully the rewrite will eliminate the UTF encoding errors I have not been able to track down.

Once I am done rewriting the script I will toss the new version on SF.net if it works any better so we can have, hopefully, a working windows version. I asked the origional developer of the script and he said it was ok to use the fg2blender script. Then we can also update the wiki page you just created. I will also try to figure out how easy/dificult it will be to modify the fg2blender script to use the current AC3D import/exporter you are maintaining since it works better at the moment.
japreja
 
Posts: 334
Joined: Thu May 07, 2015 11:05 pm
Location: MT, USA
OS: Windows 10 Pro 64bit

Re: Blender 2.6 AC3D Importer & Exporter

Postby Necolatis » Tue Jun 30, 2015 10:07 pm

User TheTom has now merged my changes into the Majic79 script. So you can now again get it from there.

Yes, please point me to AC files you find that gives trouble.

Just remember that the Majic79 script is GPL, don't know what license fg2blender is. If you are lucky fg2blender is based on an old majic79 script, then the update should be easier. :)
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2113
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Blender 2.6 AC3D Importer & Exporter

Postby japreja » Mon Jul 13, 2015 11:55 pm

I found an .ac file that is giving your script some problems. "Aircraft\T-38C\Models\Panel\Instruments\AI\attitude-mod1.ac". My system (Windows) complained about line endings on this file, and when I opened it every other line is empty. I havent seen many files like that. I used fg2blender to open it and it seems fine with that. I also noticed that the Majic79 script is not applying the texture properly to glass/transparent objects where fg2blender does in the other .ac files in this directory.

NOTE: This is in Blender 2.74

EDIT: I thout I should note that I converted the .rgb files to PNG and updated the .ac files. I don't know if that might be why the script got the texture mapping wrong.
japreja
 
Posts: 334
Joined: Thu May 07, 2015 11:05 pm
Location: MT, USA
OS: Windows 10 Pro 64bit

Re: Blender 2.6 AC3D Importer & Exporter

Postby Necolatis » Tue Jul 14, 2015 2:30 am

Thanks, will take a look.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2113
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest