SketchUp to AC3D exporter: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
No edit summary
Line 26: Line 26:
[[Category:Scenery enhancement]]
[[Category:Scenery enhancement]]
[[Category:Modeling]]
[[Category:Modeling]]
==PNG adaption==
The AC3D exporter is set to export textures to RGB format by standard. That means that for FG to be able to display your model correctly, you will have to provide your textures in RGB format. Sketchup, however, cannot read RGB files, so you first have to feed them into Sketchup in another format, e.g. JPG and then convert them after exporting the model.
You can change that by telling AC3D exporter to export the textures as PNG files. There are two advantages to that:
*Sketchup and FG can both read PNG and no conversion will be necessary
*PNG files are smaller than RGB files
In order for this to work, open the file <tt>ac3d_export.rb</tt> in any text editor and change two lines as follows:
<tt>return File.basename(n, File.extname(n)) + ".rgb"</tt> becomes<br>
<tt>return File.basename(n, File.extname(n)) + ".png"</tt>
and
<tt>output_path = File.join($output_dir, File.basename(t, File.extname(t)) + ".rgb")</tt> becomes<br>
<tt>output_path = File.join($output_dir, File.basename(t, File.extname(t)) + ".png")</tt>
And you're done! Now AC3D exporter will tell all .ac files to request textures in PNG format.
You can check whether this has worked by opening your .ac files in a text editor. Texture lines should now have PNG endings like here:<br><tt>texture "oilrig09contyellow.png"</tt>.

Revision as of 17:31, 11 July 2009

With the SketchUp to AC3D exporter, developed by James Turner, you're able to export SketchUp models to the .ac fileformat. The script works on both the free version aswell on the pro version.

Development

The script is still in development at the moment. The current progress as of 12 September 2008 is:

Done:

  • Geometry export
  • Texture export (including conversion to .rgb format)

Known Issues:

  • Texture scaling on the model may appear wrong, further testing required
  • Material properties are guessed, so may appear different from Blender defaults. SketchUp has very limited material controls, so manual editing may be required.

To do:

  • Conversion of lat- and longitude locations.

Installation

You can download the script at http://www.goneabitbursar.com/ac3d_export.rb (Right mouseclick > Save as). Place the .rb file into your SketchUp/plugins folder. Now restart SketchUp and the script should be visible through the Plugins > Export to AC3D menu.

For texture format conversion, install ImageMagick:

  • Windows - [1]
  • Mac - for the moment, see [2], but I'll switch to using a simpler solution in the near future

PNG adaption

The AC3D exporter is set to export textures to RGB format by standard. That means that for FG to be able to display your model correctly, you will have to provide your textures in RGB format. Sketchup, however, cannot read RGB files, so you first have to feed them into Sketchup in another format, e.g. JPG and then convert them after exporting the model.

You can change that by telling AC3D exporter to export the textures as PNG files. There are two advantages to that:

  • Sketchup and FG can both read PNG and no conversion will be necessary
  • PNG files are smaller than RGB files

In order for this to work, open the file ac3d_export.rb in any text editor and change two lines as follows:

return File.basename(n, File.extname(n)) + ".rgb" becomes
return File.basename(n, File.extname(n)) + ".png"

and

output_path = File.join($output_dir, File.basename(t, File.extname(t)) + ".rgb") becomes
output_path = File.join($output_dir, File.basename(t, File.extname(t)) + ".png")

And you're done! Now AC3D exporter will tell all .ac files to request textures in PNG format.

You can check whether this has worked by opening your .ac files in a text editor. Texture lines should now have PNG endings like here:
texture "oilrig09contyellow.png".