Syntax
- set(attribute, value)
Parameters
- attribute—selectorName of shape attribute to set.
- value—(bool, float, string, bool[], float[], string[] - same type as attribute)Value to assign to shape attribute.
Note:
Not all shape attributes are writable.
Description
The set operation assigns a value to a shape attribute of the current shape. There are two kinds of shape attributes: builtin attributes such as material.color or scope.tx and generic attributes, which are declared as rule attributes (see CGA attributes).
Related
Examples
Builtin shape attributes
Enable horizontal trim planes | set(trim.horizontal, true) |
Set x-translation of scope 0 | set(scope.tx, 0) |
Set the material color's red component to 0.5 | set(material.color.r, 0.5) |
Assign the built-in test texture to the colormap channel | set(material.colormap, "builtin:uvtest.png") |
Generic shape attributes
Store floor index in a generic attribute, floorHeight. The attribute is then used to color the windows on every 3rd floor in pink.
|