7.11. ReplaceNode

replace_node ‐ A node replacement action

7.11.1. Attributes

None.

7.11.2. Description

This action is used to modify a node. The node that is included in the replace_node element defines the new node that will replace the target node(s) when the action is executed.

7.11.3. Expected children

One of the following elements must occur in add_node: node or use.

7.11.4. Expected target

A leaf node.

7.11.5. Example

The example below defines an action that replaces a leaf node by a sphere.

<replace_node>
  <node id="sphere_#{#n}">
    <sphere id="sphere" radius="(0.05+({#n}*.02))" 
             sky_sphere="false" segments="{#segments}">
        <texture encoding="jpeg" xlink:href="sky.jpg" 
              id="sky" tile_s="1" tile_t="-1" />
    </sphere>
  </node/>
</replace_node>