Howto:Work with AC3D files in Blender: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Added warning of export in edit mode)
(added Blender 3.2 branch)
 
(20 intermediate revisions by 8 users not shown)
Line 1: Line 1:
Many [[FlightGear]] [[aircraft]] modelers prefer [[Blender]] as their 3D-modelling editor. FlightGear primarily uses the [[AC3D]] file format (<code>.ac</code>) to model aircraft, [[scenery]] models, and many other things. There is good support for the import and export of the AC3D file format from Blender. This page gives an overview of those options.
Many [[FlightGear]] [[aircraft]] modellers prefer [[Blender]] as their 3D-modelling editor. Blender is a powerful, robust and open-source 3D modelling suite. FlightGear primarily uses the [[AC3D_file_format|AC3D file format]] (<code>.ac</code>) to model aircraft, [[scenery]] models, and many other things. With the AC3D file format first released in 1996<ref>http://fileformats.archiveteam.org/wiki/AC3D_Model</ref>, modern versions of Blender do not bother maintaining support for the format. However, add-ons exist to extend Blender's functionality in order to allow the import and export of these files.


== Blender versions 2.4 and older ==
{{TOC limit|3}}
For these versions, Blender supports both the import and export of AC3D files out of the box.  Just go into user preferences and enable the addon scripts.


== Blender versions 2.5 to 2.62 ==
== Importing and exporting AC3D files ==
For these versions you can use one of these scripts by Majic79:
{{note| Modern versions of Blender (2.5+) require an add-on to work with AC3D (<code>.ac</code>) files.}}
=== Addons ===


* {{github source|proj=majic79|repo=Blender-AC3D|branch=BL2.59|text=Version for Blender 2.59 (repository)}} ({{github zip file|majic79|Blender-AC3D|branch=BL2.59|text=ZIP file download}}).
The prominent add-on for using AC3D files in Blender is called ''Blender-AC3D''. It has been forked from its original to provide support for Blender 2.8.
* {{github source|proj=majic79|repo=Blender-AC3D|branch=BL2.60|text=Version for Blender 2.60 (repository)}} ({{github zip file|majic79|Blender-AC3D|branch=BL2.60|text=ZIP file download}}).
* {{github source|proj=majic79|repo=Blender-AC3D|branch=BL2.62|text=Version for Blender 2.62 (repository)}} ({{github zip file|majic79|Blender-AC3D|branch=BL2.62|text=ZIP file download}}).


== Blender versions 2.63 and later ==
{| class="wikitable"
For version 2.63 onwards you have a choice of several scripts.
|-
! Blender version !! Addon !! Remarks
|-
| 3.2 || {{github source|user=NikolaiVChr|repo=Blender-AC3D|branch=3.2|text=NikolaiVChr/Blender-AC3D (GitHub)}}. || NikolaiVChr's fork of majic79's add-on, with a special branch for Blender 3.2
|-
| 2.80 - 2.90 || {{github source|user=NikolaiVChr|repo=Blender-AC3D|branch=2.80|text=NikolaiVChr/Blender-AC3D (GitHub)}}. || NikolaiVChr's fork of majic79's add-on, with a special branch for Blender 2.80
|-
| 2.63 - 2.7a || {{github source|user=NikolaiVChr|repo=Blender-AC3D|branch=master|text=NikolaiVChr/Blender-AC3D (GitHub)}} || NikolaiVChr's fork of majic79's add-on. For more information read {{forum link|t=13442|title=Blender 2.6 AC3D Importer & Exporter}}
|-
| 2.62 || {{github source|proj=majic79|repo=Blender-AC3D|branch=BL2.62|text=majic79/Blender-AC3D (GitHub)}} || Branch of majic79's plugin targeting Blender 2.62 (Abandoned)
|-
| 2.60 || {{github source|proj=majic79|repo=Blender-AC3D|branch=BL2.60|text=majic79/Blender-AC3D (GitHub)}} || Branch of majic79's plugin targeting Blender 2.60 (Abandoned)
|-
| 2.59 || {{github source|proj=majic79|repo=Blender-AC3D|branch=BL2.59|text=majic79/Blender-AC3D (GitHub)}} || Branch of majic79's plugin targeting Blender 2.59 (Abandoned)
|-
| <2.5 || N/A || Versions of Blender below 2.5 include out of the box support for the AC3D file format, simply enable the add-on in <code>Preferences > Addons</code>
|}


=== Majic79 addon ===
==== Notes ====
 
Current maintainer: [[User:Necolatis]]
 
Tested with Blender version 2.63 to 2.78a
 
'''Notes:'''
* Before you export a model with this addon, make sure that you set the UV map and texture inside the material, not just inside the UV editor.  See the video tutorial [https://www.youtube.com/watch?v=URMjoFSm5pk here].
* Before you export a model with this addon, make sure that you set the UV map and texture inside the material, not just inside the UV editor.  See the video tutorial [https://www.youtube.com/watch?v=URMjoFSm5pk here].
* Before you export make sure to exit Edit Mode or some of your last changes won't be exported.
* Before you export make sure to exit ''Edit Mode'' or some of your last changes won't be exported.
* Inside Blender when you want to see the textures, be sure to set the shader to GLSL (or for 2.7+ just set view mode to materials). Alternatively set textured solid in solid view.
* Inside Blender when you want to see the textures, be sure to set the shader to GLSL (or for 2.7+ just set view mode to materials). Alternatively set textured solid in solid view.
* To see textured surfaces as they will be shown in Flightgear, go into the material texture and set the blend type to "Multiply" instead of the default "Mix" (the importer will also do this automatically). An example plane that will look very different if this is not done is the FGAddon aircraft ASK-13, notice the wingtips.
* To see textured surfaces as they will be shown in FlightGear, go into the material texture and set the blend type to ''Multiply'' instead of the default ''Mix'' (the importer will also do this automatically). An example plane that will look very different if this is not done is the FGAddon aircraft {{fgaddon source|path=Aircraft/ASK13|commit=1363|text=ASK-13}}, notice the wingtips.
* If you wonder where to put the scripts you could open blender's user preferences (''CTRL ALT U'', or ''File->User Preferences'') tick e.g. Import/Export and extent the informations concerning an existing script. Usually this throws the path. For Ubuntu 14.04LTS/Blender 2.79b e.g. it's: ''/usr/share/blender/scripts/addons/''.
* The final model might display color mismatches (Texture color vs Material color) when viewed in Flightgear. Hand editing the [[AC files: Basic changes to textures and colors#Materials|materials]] section of the exported AC3D file might fix this.
* If you wonder where to put the scripts you could open blender's user preferences ({{Key press|Ctrl|Alt|U}}, or ''File > User Preferences'') tick for example Import/Export and extent the information concerning an existing script. Usually this throws the path. For for example Ubuntu 14.04LTS/Blender 2.79b it is: <code>/usr/share/blender/scripts/addons/</code>. In recent Ubuntu versions blender is distributed as a snap image. In such cases blender addon scripts are placed in: <code>$HOME/.config/blender/X.YY/scripts/addons/</code> (where X.YY is blender version, for example 2.82).
* Be aware that Blender only has greyscale for emission and ambient colors. If you want to export/import a color for those, import/export options gives you capability to choose to use Blenders mirror color for that.
* Be aware that Blender only has greyscale for emission and ambient colors. If you want to export/import a color for those, import/export options gives you capability to choose to use Blenders mirror color for that.
* The importer will not fail if it does not locate a texture, instead it will issue warnings. Pull down the top bar to see if there was any, they will be orange lines.
* The importer will not fail if it does not locate a texture, instead it will issue warnings. Pull down the top bar to see if there was any, they will be orange lines.
* The exporter will not fail if it tries to save a texture without data, instead it will issue warnings. Pull down the top bar to see if there was any, they will be orange lines. Notice that since AC3D only support 1 texture per object, if multiple textures are attached to an object in Blender the last of the textures that has any data, if any, will be the one that get exported, but it will still warn about the missing data in the others, so take care.
* The exporter will not fail if it tries to save a texture without data, instead it will issue warnings. Pull down the top bar to see if there was any, they will be orange lines. Notice that since AC3D only support 1 texture per object, if multiple textures are attached to an object in Blender the last of the textures that has any data, if any, will be the one that get exported, but it will still warn about the missing data in the others, so take care.
* Orientation: The default settings in the plugin correspond to the FlightGear coordinate system (-X forward and Z up, also see: [[Howto:3D_Aircraft_Models]]). The default settings are: Forward -Z and Up Y.


You can report bugs with the addon [https://github.com/NikolaiVChr/Blender-AC3D/issues here], but please include problematic .ac/.blend files and their textures.
You can report bugs with the addon [https://github.com/NikolaiVChr/Blender-AC3D/issues here], but please include problematic <code>.ac</code>/<code>.blend</code> files and their textures.


: {{github source|proj=NikolaiVChr|repo=Blender-AC3D|text=Repository}} ({{github zip file|NikolaiVChr|Blender-AC3D|text=ZIP file download}}).
=== Importing ===


Notice that the above link is to Necolatis (Nikolai) latest version, as the Majic79 github hasn't kept up with the updates and seems dead.
{{main article|Working with FlightGear models in Blender}}
 
{{note|If you do not see the option for <code>AC3D (.ac)</code> under <code>File > Import</code>, your add-on is either not installed, not enabled, or not working correctly.}}
=== Mr. No addon ===
Once the add-on is installed, AC3D models can be imported in the same manner as any other model foramat into Blender by using the <code> File > Import > AC3D (.ac)</code> dialog.  
'''Notes:'''
[[File:Blender AC3D import dialog.png|thumb|This figure demonstrates how to import an AC3D model in Blender using a third-party addon.]]
* When exporting with this addon, make sure you set the texture inside the UV editor.
* When using this script, it is very important that everything is textured. The addon will silently fail if this is not the case.
* This script does not work reliable when nested groups are being used in the imported AC3D model (example [https://github.com/NikolaiVChr/flightgear-saab-ja-37-viggen/blob/FG-v3.4/Aircraft/JA37/Models/Instruments/Altimeter2/altimeter-metric.ac here]).
* The importer cannot handle the token 'subdiv', its just ignored.
* The exporter does not always export the rotations/location matrix of objects correctly.
 
: [http://www.mediafire.com/?m4f9m95qj9e5qq0 Download link (MediaFire)]
 
== External links ==
[https://sites.google.com/view/ac3dfileformat/home AC3D file format]


{{Appendix}}
{{3d}}
{{3d}}
[[Category:Modeling]]
[[Category:Modeling]]

Latest revision as of 23:23, 12 December 2022

Many FlightGear aircraft modellers prefer Blender as their 3D-modelling editor. Blender is a powerful, robust and open-source 3D modelling suite. FlightGear primarily uses the AC3D file format (.ac) to model aircraft, scenery models, and many other things. With the AC3D file format first released in 1996[1], modern versions of Blender do not bother maintaining support for the format. However, add-ons exist to extend Blender's functionality in order to allow the import and export of these files.

Importing and exporting AC3D files

Note  Modern versions of Blender (2.5+) require an add-on to work with AC3D (.ac) files.

Addons

The prominent add-on for using AC3D files in Blender is called Blender-AC3D. It has been forked from its original to provide support for Blender 2.8.

Blender version Addon Remarks
3.2 NikolaiVChr/Blender-AC3D (GitHub). NikolaiVChr's fork of majic79's add-on, with a special branch for Blender 3.2
2.80 - 2.90 NikolaiVChr/Blender-AC3D (GitHub). NikolaiVChr's fork of majic79's add-on, with a special branch for Blender 2.80
2.63 - 2.7a NikolaiVChr/Blender-AC3D (GitHub) NikolaiVChr's fork of majic79's add-on. For more information read Blender 2.6 AC3D Importer & Exporter topic on the forum This is a link to the FlightGear forum.
2.62 majic79/Blender-AC3D (GitHub) Branch of majic79's plugin targeting Blender 2.62 (Abandoned)
2.60 majic79/Blender-AC3D (GitHub) Branch of majic79's plugin targeting Blender 2.60 (Abandoned)
2.59 majic79/Blender-AC3D (GitHub) Branch of majic79's plugin targeting Blender 2.59 (Abandoned)
<2.5 N/A Versions of Blender below 2.5 include out of the box support for the AC3D file format, simply enable the add-on in Preferences > Addons

Notes

  • Before you export a model with this addon, make sure that you set the UV map and texture inside the material, not just inside the UV editor. See the video tutorial here.
  • Before you export make sure to exit Edit Mode or some of your last changes won't be exported.
  • Inside Blender when you want to see the textures, be sure to set the shader to GLSL (or for 2.7+ just set view mode to materials). Alternatively set textured solid in solid view.
  • To see textured surfaces as they will be shown in FlightGear, go into the material texture and set the blend type to Multiply instead of the default Mix (the importer will also do this automatically). An example plane that will look very different if this is not done is the FGAddon aircraft ASK-13, notice the wingtips.
  • The final model might display color mismatches (Texture color vs Material color) when viewed in Flightgear. Hand editing the materials section of the exported AC3D file might fix this.
  • If you wonder where to put the scripts you could open blender's user preferences (Ctrl+Alt+U, or File > User Preferences) tick for example Import/Export and extent the information concerning an existing script. Usually this throws the path. For for example Ubuntu 14.04LTS/Blender 2.79b it is: /usr/share/blender/scripts/addons/. In recent Ubuntu versions blender is distributed as a snap image. In such cases blender addon scripts are placed in: $HOME/.config/blender/X.YY/scripts/addons/ (where X.YY is blender version, for example 2.82).
  • Be aware that Blender only has greyscale for emission and ambient colors. If you want to export/import a color for those, import/export options gives you capability to choose to use Blenders mirror color for that.
  • The importer will not fail if it does not locate a texture, instead it will issue warnings. Pull down the top bar to see if there was any, they will be orange lines.
  • The exporter will not fail if it tries to save a texture without data, instead it will issue warnings. Pull down the top bar to see if there was any, they will be orange lines. Notice that since AC3D only support 1 texture per object, if multiple textures are attached to an object in Blender the last of the textures that has any data, if any, will be the one that get exported, but it will still warn about the missing data in the others, so take care.
  • Orientation: The default settings in the plugin correspond to the FlightGear coordinate system (-X forward and Z up, also see: Howto:3D_Aircraft_Models). The default settings are: Forward -Z and Up Y.

You can report bugs with the addon here, but please include problematic .ac/.blend files and their textures.

Importing

1rightarrow.png See Working with FlightGear models in Blender for the main article about this subject.

Note  If you do not see the option for AC3D (.ac) under File > Import, your add-on is either not installed, not enabled, or not working correctly.

Once the add-on is installed, AC3D models can be imported in the same manner as any other model foramat into Blender by using the File > Import > AC3D (.ac) dialog.

This figure demonstrates how to import an AC3D model in Blender using a third-party addon.
References