Assignment with replacement
- Last UpdatedDec 06, 2023
- 1 minute read
The assignment with replacement mode is used inside the child nodes of the deftemplate to create a template.
In other words, it uses placeholder tags that are populated with values during template definition.
The placeholder syntax is %placeholderName%.
Syntax example
An example of assignment by replacement.
name="%nodename%-interpvol2" from="%node1%.position"
Code example
This is a code example for replacement.
<deftemplate name="sbolla">
<mesh name="b%number%" mesh="bolla_%number%" />
<mesh name="bb%number%" mesh="bolla_billboard_%number%" />
<touchsensor name="t_b%number%" mesh="bolla_%number%_cmesh" />
<mesh name="t_b%number%_c" mesh="bolla_%number%_cmesh"/>
<route from="vgen1.value" to="b%number%.position_offset"/>
</deftemplate>
Note: Ensure that the placeholder is nested inside another assignment. The replacement is a string substitution.