Change object materials. An example config file using this control can be found here: https://github.com/3db/3db/tree/main/examples/unit_tests/material.yaml.
Control that swap material of an object with another one
replacement_material: The name of the material that replaces the
The possible values for
replacement_materialcan be any file name found in
Each of these file should only contain a single material.
Construct a BaseControl
root_folder – The folder containing all the data for this 3DB experiment. All paths are lative to his folder
apply(context: Dict[str, Any], control_args: Dict[str, Any]) → None¶
Replace the material of the target object with the material corresponding to
context (Dict[str, Any]) – The blender scene context.
control_args (Dict[str, Any]) – Must have key
replacement_materialcontaining the file name of the replacement material to use.
unapply(context: Dict[str, Any]) → None¶
Undo the modification on a scene
Most of the time, recreating a scene is very expensive, therefore, controls are asked to implement a reverse operation to undo their changes. Controls that need to store state in order to undo their actions should add data to the target object they received.
context (Dict[str, Any]) – The description of the scene to render