5.26. InitializationScript (element)

<initializationScript> ‐ An initialization script

5.26.1. Attributes

NameTypeDefaults
idIDNone (required)

5.26.2. Description

This element is used to contain a script associated with the initialization of a scene. It is attached to the root node of a scene graph. Initialization script commands have no triggers since the script is automatically launched when the scene is loaded.

5.26.3. Expected child

This element expects a list of commands as child nodes.

5.26.4. Example

In the example below, the initialization script contains one command. The actions associated with this command modify the boolean attribute testable of several scene nodes.


<initializationScript id="beginning_script">
   <command>
      <action>
         <set_node_attribute_value testable="false" />
         <target type="multiple_nodes" value="#*" />
      </action>
      <action>
         <set_node_attribute_value testable="true" />
         <target type="multiple_nodes" value="#classe_niveau1_no*" />
      </action>
   </command>              
</initializationScript>