Game Development Reference
In-Depth Information
If “Export Single Clip” is selected, an additional parameter appears: “Name of Clip to Export.” To be sure that you
get only that animation, you must type the name of the clip exactly as it appears in the Unity animation clip selector. For
example, a character that has “idle,” “run,” and “walk” animation clips can be exported with just the “run” animation.
This option is there because several tools and the COLLADA importer do not support the animation_clip information.
In terms of the animation target, COLLADA allows for “Multiple Targets Per Clip” in order to keep the document
small by sharing animation across multiple instanced objects (a.k.a. prefabs). Unfortunately, we found out that
most COLLADA importers do not support multiple targets per clip; therefore you can select the option “Duplicate
Animation Clips,” which is a work-around but note that it bloats the size of the exported document.
For the export skins option, the default value is “Export Skins As Controllers,” which is how skins and bones are
expressed in COLLADA. If “Animation export” is selected, the animation will be applied to the bones through the
controllers. Another option here is to “Export Skins as Geometry,” which will convert the skins and bones to basic
geometry (without the bone animation). This is useful when you want to export the model into an application that does
not recognize skinning. The last choice is “Not Export Skins,” which will completely ignore skinned objects in the export.
Terrain Options
For the terrain export, you may decide to export or not export the terrain information. If you do export the terrain,
you can export or not export the trees attached to that terrain (see the trees option).
Another option is the sampling multiplier. Unity terrain data is very specific to the way it is implemented.
Namely, a terrain is a height map associated with a Splat Map that contains up to four values (stored in a RGBA image)
that are interpreted by the algorithm to blend between different materials (splat prototypes). The COLLADA Exporter
creates a triangle mesh model of the terrain geometry with a density defined by the Sampling multiplier. Two triangles
are created per quad, the corners of which correspond to each value in the HeightMap. So a 100x100 HeightMap
will define 99*99 quads, resulting in 19,602 triangles. Using a multiplier of 0.25, the number of triangles will be
INT(99*0.25) * INT(99*0.25) * 2 = 1728 triangles.
As for texture choices, the options for the diffuse material on export are defined by the texture choices parameter.
“Single UV Approximation” is the default choice that assigns each triangle with the most important (greater coefficient
in the Splat Map) material.
Figure 8-7 provides a good visual approximation of the terrain as rendered in Unity. The current limitation is
that it only creates one UV set that is scaled by the “size” of the first splat prototype. If different sizes are used in the
terrain, the textures other than the first one will have incorrect scale. Since the image is only an approximation of the
visual terrain, it may be sufficient anyway, but please contact us if you find out you need something different. The
other options are not to export any texture, or to export the Splat Map that covers the terrain. This is probably the most
valuable option as it enables the user to use or modify the blending coefficients. The prototype textures will also be
exported, but won't be attached to the terrain.
 
Search WWH ::




Custom Search