Game Development Reference
In-Depth Information
resources without having to make several copies of the same file. Also, even with
relative-path exports, the images may have been saved in a different location than
referenced by the relative path in the COLLADA document. Fixing this problem
can be either be done by exporting again with relative paths, moving the images
where they are referenced, or editing the document and changing the path, which
can be done using XML Notepad or another editor.
9.10 Refinery
COLLADA refinery is an open-source content pipeline tool for COLLADA. It can
run in interactive mode or in batch mode. A content pipeline is made up of con-
ditioners, small C++ functions interfacing with the COLLADA-DOM. One of the
conditioners provided is the —emphcoherency check, which we have already added
to our toolbox.
A COLLADA conditioner is a module component in COLLADA refinery. Each
conditioner can take a COLLADA document, perform a specific operation on the
document, and pass the resulting document to the next conditioner. A series of
conditioners is a pipeline that transforms COLLADA documents.
This tool was released in March 2007. In fact, it can be used as-is, or as a source
code starting point to add more and more tools to a toolbox. Refinery was created
in C++ using the C++ DOM library for performance and cross-platform goals,
but one can take the idea and use the XML validate source and copy or create new
conditioners using C# and the .NET built in DOM, which is, in my opinion, a
much easier environment to use for creating COLLADA tools. Refinery is available
in source code or precompiled for Windows, Linux, and Mac OS on Sourceforge at
http://sourceforge.net/projects/colladarefinery/files/ [COLLADA 10].
When started, the refinery user interface shows two (green) triangles that can
be moved on the surface, one representing the input COLLADA document, one
representing the output. On the left side, there is a list of conditioners that can be
selected and pasted onto the surface and connected to the input, output, or other
conditioners on the surface. For this example let's say that we have a COLLADA
document that we want to process in order to replace the absolute path with rel-
ative paths, so we select the “filename” (not the best naming convention for this
conditioner), add it to the refinery content pipeline, and connect it to the input
and output (green) triangles. Connecting two elements is easy: simply click on one
element connection point and drag the mouse to the other element connection point
(see Figure9.13 ) .
Now we can set the parameters for this pipeline. Right click on the input
triangle, select property, and select the document to process. Select the output
triangle and select the destination. Open the properties for the filename conditioner,
toggle “Modify Image element” to yes, and type the new prefix to be used before
the image filename in the COLLADA document. For example, enter ./images/ if
Search WWH ::




Custom Search