Template

 A template is a predefined params list, which can be used in a process.
The usual use cases are:
  • Montage process: text style
  • 3d process: material, light properties, rendering proprerties
  • Compositing process: Nuke node properties
example: a material template definition
<Template id="myMat" action="writable">
     <Param name="class">Standardmaterial</Param>
     <Param name="opacityFallOff">0.0</Param>
     <Param name="selfIllumAmount">0.0</Param>
     <Param name="displacementMapAmount">100.0</Param>
     <Param name="specularLevel">100.0</Param>
</Template>
use the template to set an object material
<Object name="ground" create="floor">
     <Param name="dimension">100;50;4</Param>
     <Param name="pos.z">50</Param>
     <Param name="material.template">myMat</Param>
</Object>
Template setting
A template is defined by:
  • An id attribute
  • A param list. Each param has a name attribute and a value
A template can be set in a process or in a process group.
example: set and use a template in a montage process
<Process id="main" type="montage">
     <Template id="titleStyle">
             <Param name="color">255;101;36</Param>
             <Param name="font">Verdana-bold</Param>
             <Param name="fontSize">72</Param>
     </Template>
     ..
     ..
     <Layer type="text" frames="k1-k3">
             <Param name="text">Hello World</Param>
             <Param name="template">titleStyle</Param>
     </Layer>
</Process>
example: set a template in a process group
<ProcessGroup id="group1">
     <Template id="titleStyle">
             <Param name="color">255;101;36</Param>
             <Param name="font">Verdana-bold</Param>
             <Param name="fontSize">72</Param>
     </Template>
     ..
     ..
</ProcessGroup>
Template use
To use a template, set a param with "template" or "material.template" as name, and the template id as value.
The param can be a process param, a node param or an animParam param. The param is replaced by the template params list.
First, the template is searched in the process where the param is set, then in all process group if exists.
example
<Param name="template">titleStyle</Param>
will be replaced by the template params list
<Param name="color">255;101;36</Param>
<Param name="font">Verdana-bold</Param>
<Param name="fontSize">72</Param>