SketchUp to AC3D exporter: Difference between revisions

Jump to navigation Jump to search
Moved notes from "AC3D file format" page
No edit summary
(Moved notes from "AC3D file format" page)
 
Line 1: Line 1:
{{out of date}}
{{cleanup}}
{{Infobox Software
{{Infobox Software
|title            = SketchUp to AC3D exporter
|title            = SketchUp to AC3D exporter
Line 21: Line 24:


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]].
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]].
== Other notes ==
Unfortunately, when using SketchUp, the [[SketchUp to AC3D exporter]] will name every object the same:
<tt>OBJECT poly<br />
name "blah"</tt>
Here is how you can find an object you are looking for: Every part of the model with a unique <tt>material</tt> is defined as a new <tt>OBJECT poly</tt>. This means that you only have to know which material an object uses to find it in the body of the AC file. Every material is given a number, starting from the '''first material after''' <tt>material "default"</tt>:
<tt>MATERIAL "default" rgb ...</tt><br />
<tt>MATERIAL "Color_A07" rgb ...</tt> This is <tt>mat 1</tt><br />
<tt>MATERIAL "Color_D01" rgb ...</tt> This is <tt>mat 2</tt><br />
<tt>MATERIAL "Color_F01" rgb ...</tt> This is <tt>mat 3</tt><br />
Now we will look for the object further below in the AC file that uses <tt>mat 2</tt>. It is this one:
<tt>
OBJECT poly<br />
name "Roof"<br />
numvert 4<br />
-5.245000 10.550000 -0.010000<br />
5.245000 0.060000 -0.010000<br />
-5.245000 0.060000 -0.010000<br />
5.245000 10.550000 -0.010000<br />
numsurf 2<br />
SURF 0x30<br />
mat 2<br />
refs 3<br />
0 0 0<br />
1 0 0<br />
2 0 0<br />
SURF 0x30<br />
mat 2<br />
refs 3<br />
1 0 0<br />
0 0 0<br />
3 0 0<br />
kids 0
</tt>
As you can see, <tt>mat 2</tt> is used in this object. Let's imagine that we know that it is a roof. So now that we have named it ''Roof'' we can refer to it from the XML file. Voilà!
Note: When you [[Textures & Texture Maps in SketchUp#Loading your texture into SketchUp|define a new texture in SketchUp]], you can give it a name. Imagine that we use the texture <tt>roof1.png</tt> and that we name the texture <tt>Roof</tt>. The name and the texture filename will appear in the AC file. Yet you will still have to rename the object. The [[SketchUp to AC3D exporter]] will give you this:
<tt>MATERIAL "Roof" rgb<br /><br />
OBJECT poly<br />
name "blah"<br />
texture "roof1.png"</tt>
The name of the material does not matter at all, it could be anything. The object name is the important thing for reference from XML. Only after renaming the object you will be able to address it from the XML file. (Or, of course, you can refer to the object "blah", if this is the only object with that name in the AC file.)
When you are modelling in SketchUp and you want to ensure that you can identify one part of it later in the AC file, simply give it a unique color or texture that is not used anywhere else in the AC file. An exception to this method exists where you want your object to be invisible until the .xml file animates it (as with some lighting effects) - in that case you MUST use a unique texture. Failure to use a unique texture in these cases will result in your object not showing in FlightGear.


== Development ==
== Development ==
149

edits

Navigation menu