threedb.controls.blender.pin_to_ground¶
Control where the bottom bounding box of an object lies on the z axis. An example config file using this control can be found here: https://github.com/3db/3db/tree/main/examples/unit_tests/pin_to_ground.yaml.
-
class
threedb.controls.blender.pin_to_ground.
PinToGroundControl
(root_folder: str)¶ Bases:
threedb.controls.base_control.PreProcessControl
Control that moves an object vertically to touch the ground Useful when you want a slightly more realistic rendering (i.e. avoid flying objects)
Continuous Dimensions:
z_ground
: the z-coordinate that the bottom of the object’s boundingmoves to (default range:
[0, 1]
)
Note
This control come after the
PositionControl
andOrientationControl
controls. In these patterns, you first move the object to a location of interest, then drag it to the ground under that location.-
__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¶ Pins the object to the ground
- Parameters
context (Dict[str, Any]) – The scene context object
control_args (Dict[str, Any]) – The parameters for this control; should have key
z_ground
mapping to any real number, see class docstring for documentation.
-
unapply
(context)¶ 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.pin_to_ground.
Control
¶ alias of
threedb.controls.blender.pin_to_ground.PinToGroundControl