threedb.controls.blender.position

Control the object location. An example config file using this control can be found here: https://github.com/3db/3db/tree/main/examples/unit_tests/position.yaml.

class threedb.controls.blender.position.PositionControl(root_folder: str)

Bases: threedb.controls.base_control.PreProcessControl

This control changes the position of the object (i.e. translates it)

Note

The change in position is relative to the object’s original position.

Continuous Parameters:

  • offset_x: Translation component along the world’s x-axis (default range: [-1, 1])

  • offset_y: Translation component along the world’s y-axis (default range: [-1, 1])

  • offset_z: Translation component along the world’s z-axis (default range: [-1, 1])

Example images

Varying the position across the relevant parameters.

__init__(root_folder: str)

Construct a BaseControl

Parameters

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

Modify the target give a combination of the inputs the control needs

Parameters
  • context (Dict[str, Any]) – A dictionary representation of the current scene.

  • control_args (Dict[str, Any]) – a dict containing an entry for each of the discrete and continuous parameters declared by the Control

  • the scene in-place (Modifies) –

  • return value. (no) –

unapply(context: Dict[str, Any])None

Undo the modification on a scene

Note

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.

Parameters

context (Dict[str, Any]) – The description of the scene to render

threedb.controls.blender.position.Control

alias of threedb.controls.blender.position.PositionControl