Game Development Reference
In-Depth Information
To write or adapt a script, you should know the following:
What the inputs are, where to find them, and what to do with them
What outputs you produce and where they go
The status codes you get and return
If your application doesn't support cameras and lighting and/or doesn't read camera and lighting parameters
from the COLLADA document, you may have to set the camera and light positions in your Python script; you need
cameras and lights in order to render and you must use the settings the tests require. You may need to delete your
default lights and cameras so that the application properly renders the values in the COLLADA document.
Listing 6-1 shows some pseudo code, contributed by Simone Nicolò, a software engineer at Google, which shows
how to write the log file for an import operation for SketchUp.
Listing 6-1. Pseudocode for Writing a Log File for a SketchUp Import Operation
Get the return value from Import
return_value = Sketchup.active_model.import "<model_path>"
then based on the return value write the log
if return_value
# write 'Import Succeeded' to the log
else
# write 'Import Failed' to the log
end
Your script will need to call the following methods in the following order:
Init
BeginScript
WriteImport
WriteRender
WriteExport
EndScript
RunScript
BeginScript
WriteImport
WriteRender
EndScript
RunScript
See the list of methods in HowToIntegrateSoftware.doc in the CTS\Documentation\HowtoAddSoftware directory,
which also includes tips on dealing with cameras.
You will need to implement methods such as GetPrettyName(): return string , which passes information to
the script that runs the target application. The script is run in the RunScript method. You can find all the methods in
the complete COLLADA conformance test tutorial hosted by Khronos (see the “Useful Links” section).
 
Search WWH ::




Custom Search