Howto:Convert objects from X-Plane: Difference between revisions

Jump to navigation Jump to search
m
Proper headings
m (Proper headings)
Line 14: Line 14:
'''Please note: objects that are uploaded to the [[FlightGear Scenery Database]] (and thus official FG scenery) must be released under the [[GNU GPL]] license. Most X-Plane/MSFS scenery does ''not'' comply with this license. Therefore, it cannot be included with the official scenery, unless the author granted you permission to release his work under GNU GPL.'''
'''Please note: objects that are uploaded to the [[FlightGear Scenery Database]] (and thus official FG scenery) must be released under the [[GNU GPL]] license. Most X-Plane/MSFS scenery does ''not'' comply with this license. Therefore, it cannot be included with the official scenery, unless the author granted you permission to release his work under GNU GPL.'''


= Installation and setup =
== Installation and setup ==
== Prerequisites ==
=== Prerequisites ===
Besides a Unix environment, you'll need the following tools:
Besides a Unix environment, you'll need the following tools:


Line 32: Line 32:
* convert (from [http://www.imagemagick.org ImageMagick])
* convert (from [http://www.imagemagick.org ImageMagick])


== Installation ==
=== Installation ===
Install xplane2fg:
Install xplane2fg:


Line 44: Line 44:
Install X-Plane tools in $HOME/convert/xptools
Install X-Plane tools in $HOME/convert/xptools


== Hack the tools ==
=== Hack the tools ===
For the first step - importing objects into blender - we use Jonathan Harris' XPlane2Blender import filter. The .ac export filter shipped with Blender does the export. As we will batch convert a large number of objects, both import and export filters need to be 'hacked' as to not stop and wait for user interaction on warnings etc:
For the first step - importing objects into blender - we use Jonathan Harris' XPlane2Blender import filter. The .ac export filter shipped with Blender does the export. As we will batch convert a large number of objects, both import and export filters need to be 'hacked' as to not stop and wait for user interaction on warnings etc:


Line 57: Line 57:
Make sure you keep indention. Save this file as ac3d_export_hack.py
Make sure you keep indention. Save this file as ac3d_export_hack.py


== Setting up the environment according to your system ==
=== Setting up the environment according to your system ===
The xplane2fg scripts glue together a number of tools. To have the scripts find these tools, you have to adjust the paths in $HOME/fgfs/convert/xplane2fg/profile according to your system (using a text editor).
The xplane2fg scripts glue together a number of tools. To have the scripts find these tools, you have to adjust the paths in $HOME/fgfs/convert/xplane2fg/profile according to your system (using a text editor).


Now everything should be set up to actually convert scenery!
Now everything should be set up to actually convert scenery!


= Conversion =
== Conversion ==
First load xplane2fg's environment profile:
First load xplane2fg's environment profile:
  source $HOME/fgfs/convert/xplane2fg/profile
  source $HOME/fgfs/convert/xplane2fg/profile


== Prepare X-Plane scenery ==
=== Prepare X-Plane scenery ===
In the following, we assume the X-Plane scenery we want to convert is named EDDN (make sure it contains no spaces!) and lives in
In the following, we assume the X-Plane scenery we want to convert is named EDDN (make sure it contains no spaces!) and lives in
   $HOME/fgfs/convert/EDDN/
   $HOME/fgfs/convert/EDDN/
Line 76: Line 76:
Those sub folders may have slightly different names. If so, rename them to fit the above scheme. Remember that Unix file names are case sensitive.
Those sub folders may have slightly different names. If so, rename them to fit the above scheme. Remember that Unix file names are case sensitive.


== Prepare FlightGear ==
=== Prepare FlightGear ===
X-Plane objects are positioned using [http://en.wikipedia.org/wiki/Above_ground_level AGL], while FlightGear's .stg files expect [http://en.wikipedia.org/wiki/Above_mean_sea_level AMSL]. We will use FlightGear to automatically query the elevation at the object's postition. Therefore, the corresponding scenery tile must be installed. Find out on which tile the scenery you want to convert is located. See [[Howto: Install scenery]] for details on how to install FlightGear scenery. The most convenient way may be to use [[TerraSync]].
X-Plane objects are positioned using [http://en.wikipedia.org/wiki/Above_ground_level AGL], while FlightGear's .stg files expect [http://en.wikipedia.org/wiki/Above_mean_sea_level AMSL]. We will use FlightGear to automatically query the elevation at the object's postition. Therefore, the corresponding scenery tile must be installed. Find out on which tile the scenery you want to convert is located. See [[Howto: Install scenery]] for details on how to install FlightGear scenery. The most convenient way may be to use [[TerraSync]].


== Convert ==
=== Convert ===
Now run the main conversion script:
Now run the main conversion script:
  cd $HOME/fgfs/convert/
  cd $HOME/fgfs/convert/
Line 110: Line 110:
We're almost done!
We're almost done!


== Check textures ==
=== Check textures ===
X-Plane may use .dds textures, which '''can''' be converted to .png format. However, following recent discussion on the developers mailing list, FlightGear/OSG can also use .dds textures. Hence, you may also skip this step. I have not tested using .dds textures with FlightGear. Your milage may vary.
X-Plane may use .dds textures, which '''can''' be converted to .png format. However, following recent discussion on the developers mailing list, FlightGear/OSG can also use .dds textures. Hence, you may also skip this step. I have not tested using .dds textures with FlightGear. Your milage may vary.


Line 120: Line 120:
  rm *.dds
  rm *.dds


== Integrate the converted files into FlightGear scenery ==
=== Integrate the converted files into FlightGear scenery ===
Finally you have to copy the converted scenery to FlightGear's scenery folder. Make sure to backup the respective scenery folder beforehand.
Finally you have to copy the converted scenery to FlightGear's scenery folder. Make sure to backup the respective scenery folder beforehand.


Line 127: Line 127:
Now you can fire up FlightGear and enjoy the converted scenery!
Now you can fire up FlightGear and enjoy the converted scenery!


= Final steps =
== Final steps ==
== Cleanup ==
=== Cleanup ===
Temporary files were written to $HOME/fgfs/convert/tmp. You can remove them now:
Temporary files were written to $HOME/fgfs/convert/tmp. You can remove them now:
  rm -rf $HOME/fgfs/convert/tmp
  rm -rf $HOME/fgfs/convert/tmp


== Share the converted scenery ==
=== Share the converted scenery ===
If you want to publish the scenery you need to obtain authorization to do so from the scenery's original authors.
If you want to publish the scenery you need to obtain authorization to do so from the scenery's original authors.


If you want it to be included in FlightGear's official scenery via the [[FlightGear Scenery Database]], the converted scenery (including all textures) must comply with the [[GNU GPL]].
If you want it to be included in FlightGear's official scenery via the [[FlightGear Scenery Database]], the converted scenery (including all textures) must comply with the [[GNU GPL]].


== Optional ==
=== Optional ===
You may use
You may use


Line 144: Line 144:
to prepend all converted objects with a prefix, e.g., EDDN_objectname.ac
to prepend all converted objects with a prefix, e.g., EDDN_objectname.ac


== Troubleshooting ==
=== Troubleshooting ===
xplane2fg.sh may complain about funny elevations reported by FlightGear:
xplane2fg.sh may complain about funny elevations reported by FlightGear:


Line 164: Line 164:
and correct the respective line in the indicated .stg file.
and correct the respective line in the indicated .stg file.


== Note to Windows Users ==
=== Note to Windows Users ===
I developed these scripts on Linux. They are written in bash and make heavy use of GNU utilities (sed, awk, grep etc.). Some helpers require Perl.  
I developed these scripts on Linux. They are written in bash and make heavy use of GNU utilities (sed, awk, grep etc.). Some helpers require Perl.  
To run these scripts on Windows, you will need to install cygwin and perl (at least). You will have to fix some further issues yourself; the wine part, for example, is probably not necessary on Windows ;)
To run these scripts on Windows, you will need to install cygwin and perl (at least). You will have to fix some further issues yourself; the wine part, for example, is probably not necessary on Windows ;)
--[[User:Radi|Radi]] 20:39, 26 December 2010 (UTC)


[[Category:Howto|Convert objects from X-Plane]]
[[Category:Howto|Convert objects from X-Plane]]
[[Category:Scenery enhancement|Convert objects from X-Plane]]
[[Category:Scenery enhancement|Convert objects from X-Plane]]

Navigation menu