SketchUp to AC3D exporter: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
No edit summary
(12 intermediate revisions by 10 users not shown)
Line 1: Line 1:
With the '''SketchUp to AC3D exporter''', developed by James Turner, you're able to export [http://sketchup.google.com SketchUp] models to the [[File Formats#.2A.ac|.ac fileformat]]. The script works on both the free version aswell on the pro version.
{{Infobox Software
|title            = SketchUp to AC3D exporter
|developedby      = James Turner and others
|initialrelease    = 0.1 (1 September 2008)
|writtenin        = Ruby
|developmentstatus = Not under active development as of 05/2016
|type              = SketchUp extension
|license          = [[GNU General Public License]]
}}
With the '''SketchUp to AC3D exporter''', developed by James Turner and improved by others, you are able to export [http://www.sketchup.com/ SketchUp] models to the [[File Formats#.2A.ac|AC3D file format]]. The script works in both SketchUp Make and Pro.


==Development==
== Installation ==
You can download the script from [http://wiki.flightgear.org/images/0/05/Ac3d_export.rb this link]. Then, follow the extension installation instuctions [https://help.sketchup.com/en/article/38583 here]. Then restart SketchUp and the script should be visible through the via {{menu item|Plugins|Export to AC3D}}, or {{menu item|Extensions|Export to AC3D}} in SketchUp 2015 or later.
 
{{note|In Sketchup 8, users are able to export as a .dae file, and AC3D is able to import .dae files, meaning no conversions are necessary if texturing in AC3D.}}
 
== A note about textures ==
The AC3D exporter is set to export textures to the PNG format by standard. That means that for FlightGear to be able to display your model correctly, you will have to provide your textures in the .png format.
 
So if you have a texture in a format other than PNG, you'll have to transform it into PNG. One free program capable of this conversion is ImageMagick. You can download it from http://www.imagemagick.org/script/binary-releases.php
 
See also [[AC files: Basic changes to textures and colors#Textures|AC files: Textures]] and [[Textures & Texture Maps in SketchUp#Correct display of texture colors in the AC file|SketchUp: Correct display of texture colors in the AC file]].
 
== Development ==
The script is still in development at the moment. The current progress as of 12 September 2008 is:
The script is still in development at the moment. The current progress as of 12 September 2008 is:


'''Done:'''
'''Done:'''
* Geometry export
* Geometry export
* Texture export (including conversion to .rgb format)
* Texture export


'''Known Issues:'''
'''Known Issues:'''
Line 13: Line 34:


'''To do:'''
'''To do:'''
* Conversion of lat- and longitude locations.
* Conversion of latitude and longitude locations.


==Installation==
== Development update July 2011 ==
You can download the script at http://www.goneabitbursar.com/ac3d_export.rb (Right mouseclick > Save as). Place the .rb file into your <tt>SketchUp/plugins</tt> folder. Now restart SketchUp and the script should be visible through the <tt>Plugins > Export to AC3D</tt> menu.
SketchUp models which are completed using the existing SketchUp to AC3D exporter are rendered in FlightGear with double sided faces.


For texture format conversion, install ImageMagick:
Though there is nothing wrong with double sided faces, there is a considerable saving in FG processing if single faces can be used. This affects fps (frames per second) and is particularly noticeable when entering an area which is heavily inhabited with buildings/models.
* Windows - [http://www.imagemagick.org/script/binary-releases.php#windows]
* Mac - for the moment, see [http://www.imagemagick.org/script/binary-releases.php#macosx], but I'll switch to using a simpler solution in the near future


==PNG adaption==
It is possible to export SketchUp models with single faces by using a new version of the exporter (adapted by VicMar & i4dnf).
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. The advantage is that Sketchup and FG can both read PNG and no conversion will be necessary. In order for this to work, open the file <tt>ac3d_export.rb</tt> in any text editor and change two lines as follows:
The new version is named "ac3dS_export.rb" and is available for download from http://vicmar.weebly.com/downloads.html


<tt>return File.basename(n, File.extname(n)) + ".rgb"</tt> becomes<br>
The "ac3dS_export.rb" file should be placed in the same folder/directory as the existing exporter. In the SketchUp <tt>Plugins</tt>/<tt>Exentsions</tt> menu, it will appear as "Export to AC3D (Single_Faced)" and should appear with the existing exporter. '''Do NOT remove the existing exporter.'''
<tt>return File.basename(n, File.extname(n)) + ".png"</tt>


and
The new version is recommended for use with SketchUp models which do NOT have any see through textures. It is also not recommended if your model has apertures like open hangar doors, which allow a view inside the building, as the opposite walls will be invisible.


<tt>output_path = File.join($output_dir, File.basename(t, File.extname(t)) + ".rgb")</tt> becomes<br>
There is a work around for models which have see-through textures, but it is a chore to do, so it is recommended you use the existing exporter for such models.
<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>.
 
Also see: [[AC files: Basic changes to textures and colors#Textures|AC files: Textures]] and [[Textures & Texture Maps in SketchUp#Correct display of texture colors in the AC file|SketchUp: Correct display of texture colors in the AC file]].


{{3d}}
{{3d}}


[[Category:Modeling]]
[[Category:Scenery enhancement]]
[[Category:Scenery enhancement]]
[[Category:Modeling]]
 
[[pt:Sketchup AC3D]]

Revision as of 12:02, 17 May 2016

SketchUp to AC3D exporter
Developed by James Turner and others
Initial release 0.1 (1 September 2008)
Written in Ruby
Development status Not under active development as of 05/2016
Type SketchUp extension
License GNU General Public License

With the SketchUp to AC3D exporter, developed by James Turner and improved by others, you are able to export SketchUp models to the AC3D file format. The script works in both SketchUp Make and Pro.

Installation

You can download the script from this link. Then, follow the extension installation instuctions here. Then restart SketchUp and the script should be visible through the via PluginsExport to AC3D, or ExtensionsExport to AC3D in SketchUp 2015 or later.

Note  In Sketchup 8, users are able to export as a .dae file, and AC3D is able to import .dae files, meaning no conversions are necessary if texturing in AC3D.

A note about textures

The AC3D exporter is set to export textures to the PNG format by standard. That means that for FlightGear to be able to display your model correctly, you will have to provide your textures in the .png format.

So if you have a texture in a format other than PNG, you'll have to transform it into PNG. One free program capable of this conversion is ImageMagick. You can download it from http://www.imagemagick.org/script/binary-releases.php

See also AC files: Textures and SketchUp: Correct display of texture colors in the AC file.

Development

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

Done:

  • Geometry export
  • Texture export

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 latitude and longitude locations.

Development update July 2011

SketchUp models which are completed using the existing SketchUp to AC3D exporter are rendered in FlightGear with double sided faces.

Though there is nothing wrong with double sided faces, there is a considerable saving in FG processing if single faces can be used. This affects fps (frames per second) and is particularly noticeable when entering an area which is heavily inhabited with buildings/models.

It is possible to export SketchUp models with single faces by using a new version of the exporter (adapted by VicMar & i4dnf).

The new version is named "ac3dS_export.rb" and is available for download from http://vicmar.weebly.com/downloads.html

The "ac3dS_export.rb" file should be placed in the same folder/directory as the existing exporter. In the SketchUp Plugins/Exentsions menu, it will appear as "Export to AC3D (Single_Faced)" and should appear with the existing exporter. Do NOT remove the existing exporter.

The new version is recommended for use with SketchUp models which do NOT have any see through textures. It is also not recommended if your model has apertures like open hangar doors, which allow a view inside the building, as the opposite walls will be invisible.

There is a work around for models which have see-through textures, but it is a chore to do, so it is recommended you use the existing exporter for such models.