Command API

May 31, 2024 ยท View on GitHub

This document contains all commands currently available in TDW.

Table of Contents

Command

CommandDescription
add_magnebotAdd a Magnebot to the scene. For further documentation, see: Documentation/misc_frontend/robots.md For a high-level API, see: https://github.com/alters-mit/magnebot
adjust_point_lights_intensity_byAdjust the intensity of all point lights in the scene by a value. Note that many scenes don't have any point lights.
apply_forceApply a force into the world to an target position. The force will impact any objects between the origin and the target position.
create_avatarCreate an avatar (agent).
create_empty_environmentCreate an empty environment. This must be called after load_scene.
create_vr_rigCreate a VR rig. If there is already a VR rig in the scene, this fails silently. For more information, see: Documentation/misc_frontend/vr.md
destroy_all_objectsDestroy all objects and avatars in the scene.
do_nothingDo nothing. Useful for benchmarking.
enable_reflection_probesEnable or disable the reflection probes in the scene. By default, the reflection probes are enabled. Disabling the reflection probes will yield less realistic images but will improve the speed of the simulation.
initialize_clatterInitialize Clatter. This command must be sent after each ClatterizeObject command has been sent (though it can be in the same list of commands).
load_sceneLoads a new locally-stored scene. Unloads an existing scene (if any). This command must be sent before create_exterior_walls or create_empty_environment This command does not need to be sent along with an add_scene command.
parent_audio_source_to_objectParent an audio source to an object. When the object moves, the audio source will move with it.
pause_editorPause Unity Editor.
perlin_noise_terrainInitialize a scene environment with procedurally generated "terrain" using Perlin noise. This command will return Meshes output data which will contain the mesh data of the terrain.
rotate_hdri_skybox_byRotate the HDRI skybox by a given value and the sun light by the same value in the opposite direction, to maintain alignment.
set_ambient_intensitySet how much the ambient light fom the source affects the scene. Low values will darken the scene overall, to simulate evening /night light levels.
set_cursorSet cursor parameters.
set_download_timeoutSet the timeout after which an Asset Bundle Command (e.g. add_object) will retry a download. The default timeout is 30 minutes, which should always be sufficient. Send this command only if your computer or Internet connection is very slow.
set_dsp_buffer_sizeSet the DSP buffer size. A lower value will result in less latency.
set_error_handlingSet whether TDW will quit when it logs different types of messages.
set_floorplan_roofShow or hide the roof of a floorplan scene. This command only works if the current scene is a floorplan added via the add_scene command: "floorplan_1a", "floorplan_4b", etc.
set_gravity_vectorSet the gravity vector in the scene.
set_hdri_skybox_exposureSet the exposure of the HDRI skybox to a given value.
set_physics_solver_iterationsSet the number of physics solver iterations, which affects the overall accuracy of the physics engine.
set_render_qualitySet the render quality level. The highest render quality level enables near-photorealism runtime rendering. The lowest render quality has "flat" rendering, no shadows, etc. The lower the render quality, the faster the simulation will run, especially in scenes with complex lighting.
set_screen_sizeSet the screen size. Any images the build creates will also be this size.
set_shadow_strengthSet the shadow strength of all lights in the scene. This only works if you already sent load_scene or add_scene.
set_sleep_thresholdSet the global Rigidbody "sleep threshold", the mass-normalized energy threshold below which objects start going to sleep. A "sleeping" object is completely still until moved again by a force (object impact, force command, etc.)
set_socket_timeoutSet the timeout behavior for the socket used to communicate with the controller.
set_target_framerateSet the target render framerate of the build. For more information: https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html
set_time_stepSet Time.fixedDeltaTime (Unity's physics step, as opposed to render time step). NOTE: Doubling the time_step is NOT equivalent to advancing two physics steps. For more information, see: https://docs.unity3d.com/Manual/TimeFrameManagement.html
set_vsync_countSet the renderer's vsync count. For more information, read this: https://docs.unity3d.com/ScriptReference/QualitySettings-vSyncCount.html
step_physicsStep through the physics without triggering new avatar output, or new commands.
stop_all_audioStop all ongoing audio.
terminateTerminate the build.
unload_asset_bundlesUnloads all AssetBundles. Send this command only after destroying all objects in the scene. This command should be used only to free up memory. After sending it, you will need to re-download any objects you want to add to a scene.
unload_unused_assetsUnload lingering assets (scenes, models, textures, etc.) from memory. Send this command if you're rapidly adding and removing objects or scenes in order to prevent apparent memory leaks.

Asset Bundle Command

CommandDescription
add_sceneAdd a scene to TDW. Unloads the current scene if any (including any created by the load_scene command).

Add Object Command

CommandDescription
add_droneAdd a drone to the scene.
add_hdri_skyboxAdd a single HDRI skybox to the scene. It is highly recommended that the values of all parameters match those in the record metadata. If you assign your own values, the lighting will probably be strange.
add_humanoid_animationLoad an animation clip asset bundle into memory.
add_robotAdd a robot to the scene. For further documentation, see: Documentation/lessons/robots/overview.md
add_vehicleAdd a vehicle to the scene.
add_visual_effectAdd a non-physics visual effect to the scene from an asset bundle.

Add Humanoid Command

CommandDescription
add_humanoidAdd a humanoid model to the scene.
add_replicantAdd a Replicant to the scene.
add_smpl_humanoidAdd a parameterized humanoid to the scene using SMPL. Each parameter scales an aspect of the humanoid and must be between -1 and 1. For example, if the height is -1, then the humanoid will be the shortest possible height. Because all of these parameters blend together to create the overall shape, it isn't possible to document specific body shape values, such as overall height, that might correspond to this command's parameters.
add_wheelchair_replicantAdd a WheelchairReplicant to the scene.

Add Material Command

CommandDescription
add_materialLoad a material asset bundle into memory. If you want to set the visual material of something in TDW (e.g. set_visual_material, you must first send this command.
send_material_properties_reportSend a report of the material property values. Each report will be a separate LogMessage.
send_material_reportTell the build to send a report of a material asset bundle. Each report will be a separate LogMessage.

Add Model Command

CommandDescription
add_objectAdd a single object from a model library or from a local asset bundle to the scene.
send_model_reportTell the build to send a report of a model asset bundle. Each report will be a separate LogMessage.

Avatar Command

CommandDescription
destroy_avatarDestroy an avatar.
enable_avatar_transparencyEnable transparency (the "alpha" channel, or "a" value in the color) on the avatar's visual materials. To set the color of an avatar, send set_avatar_color
follow_objectTeleport the avatar to a position relative to a target. This must be sent per-frame to continuously follow the target.
rotate_avatar_byRotate the avatar by a given angle around a given axis.
rotate_avatar_toSet the rotation quaternion of the avatar.
rotate_avatar_to_euler_anglesSet the rotation of the avatar with Euler angles.
scale_avatarScale the avatar's size by a factor from its current scale.
set_avatar_collision_detection_modeSet the collision mode of all of the avatar's Rigidbodies. This doesn't need to be sent continuously, but does need to be sent per avatar.
set_avatar_colorSet the color of an avatar. To allow transparency (the "alpha" channel, or "a" value in the color), first send enable_avatar_transparency
set_avatar_forwardSet the forward directional vector of the avatar.
set_camera_clipping_planesSet the near and far clipping planes of the avatar's camera.
set_field_of_viewSet the field of view of the avatar's camera. This will automatically set the focal length (see: set_focal_length).
set_focal_lengthSet the focal length of the avatar's camera. This will automatically set the field of view (see: set_field_of_view).
set_pass_masksSet which types of images the avatar will render. By default, the avatar will render, but not send, these images. See send_images in the Command API.
teleport_avatar_byTeleport the avatar by a position offset.
teleport_avatar_toTeleport the avatar to a position.

Add Audio Sensor Command

CommandDescription
add_audio_sensorAdd an AudioSensor component to the avatar, if it does not already have one.
add_environ_audio_sensorAdd a ResonanceAudioListener component to the avatar, if it does not already have one.

Avatar Rigidbody Command

CommandDescription
apply_force_to_avatarApply a force to the avatar.
move_avatar_forward_byApply a force along the avatar's forward directional vector.
move_avatar_toMove the position of the avatar's rigidbody. This is very similar to teleport_avatar_to, but it is a physics-based motion, and will comply with physics interpolation.
set_avatar_dragSet the drag of the avatar's Rigidbody. Both drag and angular_drag can be safely changed on-the-fly.
set_avatar_kinematic_stateSet an avatars's Rigidbody to be kinematic or not. A kinematic object won't respond to PhysX physics.
set_avatar_massSet the mass of an avatar.
set_avatar_physic_materialSet the physic material of the avatar's main body collider and apply friction and bounciness values. Friction and bounciness don't affect physics as much as drag and angular_drag (see set_avatar_drag). LOW friction values and HIGH bounciness means that the avatar won't "climb" up other objects.
turn_avatar_byApply a relative torque to the avatar.

Avatar Type Command

CommandDescription
set_first_person_avatarSet the parameters of an A_First_Person avatar.

Simple Body Command

CommandDescription
change_avatar_bodyChange the body of a SimpleBodyAvatar.

Move Avatar Towards

CommandDescription
move_avatar_towards_objectMove the avatar towards an object.
move_avatar_towards_positionMove the avatar towards the target position.

Sensor Container Command

CommandDescription
add_visual_camera_meshAdd a visual camera mesh to the sensor container. The visual mesh won't have colliders and won't respond to physics.
enable_image_sensorTurn a sensor on or off. The command set_pass_masks will override this command (i.e. it will turn on a camera that has been turned off),
look_atLook at an object (rotate the image sensor to center the object in the frame).
look_at_avatarLook at another avatar (rotate the image sensor to center the avatar in the frame).
look_at_positionLook at a worldspace position (rotate the image sensor to center the position in the frame).
reset_sensor_container_rotationReset the rotation of the avatar's sensor container.
rotate_sensor_container_byRotate the sensor container of the avatar by a given angle along a given axis.
rotate_sensor_container_toSet the rotation quaternion of the avatar's sensor container.
set_anti_aliasingSet the anti-aliasing mode for the avatar's camera.
set_render_orderSet the order in which this camera will render relative to other cameras in the scene. This can prevent flickering on the screen when there are multiple cameras. This doesn't affect image capture; it only affects what the simulation application screen is displaying at runtime.
translate_sensor_container_byTranslate the sensor container relative to the avatar by a given directional vector.

Focus On Object Command

CommandDescription
focus_on_objectSet the post-process depth of field focus distance to equal the distance between the avatar and an object. This won't adjust the angle or position of the avatar's camera.
focus_towards_objectFocus towards the depth-of-field towards the position of an object.

Rotate Sensor Container Towards

CommandDescription
rotate_sensor_container_towards_objectRotate the sensor container towards the current position of a target object.
rotate_sensor_container_towards_positionRotate the sensor container towards a position at a given angular speed per frame.
rotate_sensor_container_towards_rotationRotate the sensor container towards a target rotation.

Compass Rose Command

CommandDescription
add_compass_roseAdd a visual compass rose to the scene. It will show which way is north, south, etc. as well as positive X, negative X, etc.
destroy_compass_roseDestroy the compasss rose in the scene.

Create Reverb Space Command

CommandDescription
set_reverb_space_expertCreate a ResonanceAudio Room, sized to the dimensions of the current room environment. All values are passed in as parameters.
set_reverb_space_simpleCreate a ResonanceAudio Room, sized to the dimensions of the current room environment. Reflectivity (early reflections) and reverb brightness (late reflections) calculated automatically based on size of space and percentage filled with objects.

Directional Light Command

CommandDescription
adjust_directional_light_intensity_byAdjust the intensity of the directional light (the sun) by a value.
reset_directional_light_rotationReset the rotation of the directional light (the sun).
rotate_directional_light_byRotate the directional light (the sun) by an angle and axis. This command will change the direction of cast shadows, which could adversely affect lighting that uses an HDRI skybox, Therefore this command should only be used for interior scenes where the effect of the skybox is less apparent. The original relationship between directional (sun) light and HDRI skybox can be restored by using the reset_directional_light_rotation command.
set_directional_light_colorSet the color of the directional light (the sun).

Flex Container Command

CommandDescription
create_flex_containerCreate a Flex Container. The ID of this container is the quantity of containers in the scene prior to adding it.
destroy_flex_containerDestroy an existing Flex container. Only send this command after destroying all Flex objects in the scene.

Floor Command

CommandDescription
create_floor_obi_collidersCreate Obi colliders for the floor if there aren't any.
set_floor_colorSet the albedo color of the floor.
set_floor_materialSet the material of the floor.
set_floor_obi_collision_materialSet the Obi collision material of the floor.
set_floor_physic_materialSet the physic material of the floor. These settings can be overriden by sending the command again. When an object contacts the floor, the floor's physic material values are averaged with an object's values.
set_floor_texture_scaleSet the scale of the tiling of the floor material's main texture.

Global Boolean Command

CommandDescription
set_img_pass_encodingToggle the _img pass of all avatars' cameras to be either png or jpg. True = png, False = jpg, Initial value = True (png)
set_legacy_shadersSet whether TDW should use legacy shaders. Prior to TDW v1.8 there was a bug and this command would result in lower image quality. Since then, TDW has far better rendering quality (at no speed penalty). Send this command only if you began your project in an earlier version of TDW and need to ensure that the rendering doesn't change. Initial value = False. (TDW will correctly set each object's shaders.)
set_network_loggingIf True, the build will log every message received from the controller and will log every command that is executed. Initial value = False
set_post_processToggle whether post-processing is enabled in the scene. Disabling post-processing will make rendered images "flatter". Initial value = True (post-processing is enabled)
simulate_physicsToggle whether to simulate physics per list of sent commands (i.e. per frame). If false, the simulation won't step the physics forward. Initial value = True (simulate physics per frame).
use_pre_signed_urlsToggle whether to download asset bundles (models, scenes, etc.) directly from byte streams of S3 objects, or from temporary URLs that expire after ten minutes. Only send this command and set this to True if you're experiencing segfaults when downloading models from models_full.json Initial value = On Linux: True (use temporary URLs). On Windows and OS X: False (download S3 objects directly, without using temporary URLs).

Load From Resources

Load Game Object From Resources

CommandDescription
load_flex_fluid_from_resourcesLoad a FlexFluidPrimitive from resources.
load_flex_fluid_source_from_resourcesLoad a FlexFluidSource mesh from resources.
load_primitive_from_resourcesLoad a primitive object from resources.

Nav Mesh Command

CommandDescription
bake_nav_meshBake the NavMesh, enabling Unity pathfinding. This must be sent before any other Nav Mesh Commands, and after creating the scene environment (e.g. the procedurally generated room).
send_is_on_nav_meshGiven a position, try to get the nearest position on the NavMesh.

Non Physics Object Command

Line Renderer Command

CommandDescription
add_line_rendererAdd a 3D line to the scene.
destroy_line_rendererDestroy an existing line in the scene from the scene.

Adjust Line Renderer Command

CommandDescription
add_points_to_line_rendererAdd points to an existing line in the scene.
remove_points_from_line_rendererRemove points from an existing line in the scene.
simplify_line_rendererSimplify a 3D line to the scene by removing intermediate points.

Position Marker Command

CommandDescription
add_position_markerCreate a non-physics, non-interactive marker at a position in the scene.
remove_position_markersRemove all position markers from the scene.

Textured Quad Command

CommandDescription
create_textured_quadCreate a blank quad (a rectangular mesh with four vertices) in the scene.
destroy_textured_quadDestroy an existing textured quad.

Adjust Textured Quad Command

CommandDescription
parent_textured_quad_to_objectParent a textured quad to an object in the scene. The textured quad will always be at a fixed local position and rotation relative to the object.
rotate_textured_quad_byRotate a textured quad by a given angle around a given axis.
rotate_textured_quad_toSet the rotation of a textured quad.
scale_textured_quadScale a textured quad by a factor.
set_textured_quadApply a texture to a pre-existing quad.
show_textured_quadShow or hide a textured quad.
teleport_textured_quadTeleport a textured quad to a new position.
unparent_textured_quadUnparent a textured quad from a parent object. If the textured quad doesn't have a parent object, this command doesn't do anything.

Visual Effect Command

CommandDescription
destroy_visual_effectDestroy a non-physical effect object.

Adjust Visual Effect Command

CommandDescription
parent_visual_effect_to_objectParent a non-physical visual effect to a standard TDW physically-embodied object.
rotate_visual_effect_byRotate a non-physical visual effect by a given angle around a given axis.
rotate_visual_effect_toSet the rotation of a non-physical visual effect.
scale_visual_effectScale a non-physical visual effect by a factor.
teleport_visual_effectTeleport a non-physical visual effect to a new position.
unparent_visual_effectUnparent a non-physical visual effect from a parent object. If the visual effect doesn't have a parent object, this command doesn't do anything.

Obi Command

CommandDescription
create_obi_solverCreate an Obi Solver. The solver has a unique ID that is generated sequentially: The first solver's ID is 0, the second solver's ID is 1, and so on.
destroy_obi_solverDestroy an Obi solver.
set_obi_solver_scaleSet an Obi solver's scale. This will uniformly scale the physical size of the simulation, without affecting its behavior.
set_obi_solver_substepsSet an Obi solver's number of substeps. Performing more substeps will greatly improve the accuracy/convergence speed of the simulation at the cost of speed.

Create Obi Actor Command

CommandDescription
create_obi_fluidCreate an Obi fluid. Obi fluids have three components: The emitter, the fluid, and the shape of the emitter.

Create Obi Cloth Command

CommandDescription
create_obi_cloth_sheetCreate an Obi cloth sheet object.
create_obi_cloth_volumeCreate an Obi cloth volume object.

Object Command

CommandDescription
add_trigger_colliderAdd a trigger collider to an object. Trigger colliders are non-physics colliders that will merely detect if they intersect with something. You can use this to detect whether one object is inside another. The side, position, and rotation of the trigger collider always matches that of the parent object. Per trigger event, the trigger collider will send output data depending on which of the enter, stay, and exit booleans are True.
clatterize_objectMake an object respond to Clatter audio by setting its audio values and adding a ClatterObject component. You must send ClatterizeObject for each object prior to sending InitializeClatter (though they can all be in the same list of commands).
create_obi_collidersCreate Obi colliders for an object if there aren't any.
destroy_objectDestroy an object.
enable_nav_mesh_obstacleEnable or disable an object's NavMeshObstacle. If the object doesn't have a NavMeshObstacle, this command does nothing.
ignore_collisionsSet whether one object should ignore collisions with another object. By default, objects never ignore any collisions.
ignore_leap_motion_physics_helpersMake the object ignore a Leap Motion rig's physics helpers. This is useful for objects that shouldn't be moved, such as kinematic objects.
make_nav_mesh_obstacleMake a specific object a NavMesh obstacle. If it is already a NavMesh obstacle, change its properties. An object is already a NavMesh obstacle if you've sent the bake_nav_mesh or make_nav_mesh_obstacle command.
object_look_atSet the object's rotation such that its forward directional vector points towards another object's position.
object_look_at_positionSet the object's rotation such that its forward directional vector points towards another position.
parent_object_to_avatarParent an object to an avatar. The object won't change its position or rotation relative to the avatar. Only use this command in non-physics simulations.
parent_object_to_objectParent an object to an object. In a non-physics simulation or on the frame that the two objects are first created, rotating or moving the parent object will rotate or move the child object. In subsequent physics steps, the child will move independently of the parent object (like any object).
remove_nav_mesh_obstacleRemove a NavMesh obstacle from an object (see make_nav_mesh_obstacle).
rotate_object_aroundRotate an object by a given angle and axis around a position.
rotate_object_byRotate an object by a given angle around a given axis.
rotate_object_toSet the rotation quaternion of the object.
rotate_object_to_euler_anglesSet the rotation of the object with Euler angles.
scale_objectScale the object by a factor from its current scale.
scale_object_toScale the object to the given value. This is only useful if you know the model scale beforehand, which is not always (1, 1, 1). This command is only useful when used with send_scales, because ObjectScales output data will return the actual scale of each object.
set_colorSet the albedo RGBA color of an object.
set_obi_collision_materialSet the Obi collision material of an object.
set_object_visibilityToggle whether an object is visible. An invisible object will still have physics colliders and respond to physics events.
set_physic_materialSet the physic material of an object and apply friction and bounciness values to the object. These settings can be overriden by sending the command again, or by assigning a semantic material via set_semantic_material_to.
set_rigidbody_constraintsSet the constraints of an object's Rigidbody.
set_vr_graspableMake an object graspable for a VR rig, with Oculus touch controllers. Uses the AutoHand plugin for grasping and physics interaction behavior.
teleport_objectTeleport an object to a new position.
teleport_object_byTranslate an object by an amount, optionally in local or world space.
unparent_objectUnparent an object from an object. If the textured quad doesn't have a parent, this command doesn't do anything.

Add Container Shape Command

CommandDescription
add_box_containerAdd a box container shape to an object. The object will send output data whenever other objects overlap with this volume.
add_cylinder_containerAdd a cylindrical container shape to an object. The object will send output data whenever other objects overlap with this volume.
add_sphere_containerAdd a spherical container shape to an object. The object will send output data whenever other objects overlap with this volume.

Empty Object Command

CommandDescription
attach_empty_objectAttach an empty object to an object in the scene. This is useful for tracking local space positions as the object rotates. See: send_empty_objects
teleport_empty_objectTeleport an empty object to a new position.

Flex Object Command

CommandDescription
apply_forces_to_flex_object_base64Apply a directional force to the FlexActor object.
apply_force_to_flex_objectApply a directional force to the FlexActor object.
assign_flex_containerAssign the FlexContainer of the object.
destroy_flex_objectDestroy the Flex object. This will leak memory (due to a bug in the Flex library that we can't fix), but will leak less memory than destroying a Flex-enabled object with destroy_object.
set_flex_object_massSet the mass of the Flex object. The mass is distributed equally across all particles. Thus the particle mass equals mass divided by number of particles.
set_flex_particles_massSet the mass of all particles in the Flex object. Thus, the total object mass equals the number of particles times the particle mass.
set_flex_particle_fixedFix the particle in the Flex object, such that it does not move.

Object Type Command

CommandDescription
add_constant_forceAdd a constant force to an object. Every frame, this force will be applied to the Rigidbody. Unlike other force commands, this command will provide gradual acceleration rather than immediate impulse; it is thus more useful for animation than a deterministic physics simulation.
add_fixed_jointAttach the object to a parent object using a FixedJoint.
add_floorplan_flood_buoyancyMake an object capable of floating in a floorplan-flooded room. This is meant to be used only with the FloorplanFlood add-on.
apply_force_at_positionApply a force to an object from a position. From Unity documentation: For realistic effects position should be approximately in the range of the surface of the rigidbody. Note that when position is far away from the center of the rigidbody the applied torque will be unrealistically large.
apply_force_magnitude_to_objectApply a force of a given magnitude along the forward directional vector of the object.
apply_force_to_obi_clothApply a uniform force to an Obi cloth actor.
apply_force_to_objectApplies a directional force to the object's rigidbody.
apply_torque_to_obi_clothApply a uniform torque to an Obi cloth actor.
apply_torque_to_objectApply a torque to the object's rigidbody.
scale_object_and_massScale the object by a factor from its current scale. Scale its mass proportionally. This command assumes that a canonical mass has already been set.
set_angular_velocitySet an object's angular velocity. This should ONLY be used on the same communicate() call in which the object is created. Otherwise, sending this command can cause physics glitches.
set_color_in_substructureSet the color of a specific child object in the model's substructure. See: ModelRecord.substructure in the ModelLibrarian API.
set_composite_object_kinematic_stateSet the top-level Rigidbody of a composite object to be kinematic or not. Optionally, set the same state for all of its sub-objects. A kinematic object won't respond to PhysX physics.
set_kinematic_stateSet an object's Rigidbody to be kinematic or not. A kinematic object won't respond to PhysX physics.
set_massSet the mass of an object.
set_object_collision_detection_modeSet the collision mode of an objects's Rigidbody. This doesn't need to be sent continuously, but does need to be sent per object.
set_object_dragSet the drag of an object's RigidBody. Both drag and angular_drag can be safely changed on-the-fly.
set_object_physics_solver_iterationsSet the physics solver iterations for an object, which affects its overall accuracy of the physics engine. See also: set_physics_solver_iterations which sets the global default number of solver iterations.
set_primitive_visual_materialSet the material of an object created via load_primitive_from_resources
set_semantic_material_toSets or creates the semantic material category of an object.
set_sub_object_idSet the ID of a composite sub-object. This can be useful when loading saved data that contains sub-object IDs. Note that the id parameter is for the parent object, not the sub-object. The sub-object is located via sub_object_name. Accordingly, this command only works when all of the names of a composite object's sub-objects are unique.
set_velocitySet an object's velocity. This should ONLY be used on the same communicate() call in which the object is created. Otherwise, sending this command can cause physics glitches.
show_collider_hullsShow the collider hulls of the object.

Drone Command

CommandDescription
apply_drone_driveFly a drone forwards or backwards, based on an input force value. Positive values fly forwards, negative values fly backwards. Zero value hovers drone.
apply_drone_liftControl the drone's elevation above the ground. Positive numbers cause the drone to rise, negative numbers cause it to descend. A zero value will cause it to maintain its current elevation.
apply_drone_turnTurn a drone left or right, based on an input force value. Positive values turn right, negative values turn left. Zero value flies straight.
parent_avatar_to_droneParent an avatar to a drone. Usually you'll want to do this to add a camera to the drone.
set_drone_motorTurns the drone's motor on or off.
set_drone_speedSet the forward and/or backward speed of the drone.

Humanoid Command

CommandDescription
destroy_humanoidDestroy a humanoid.
play_humanoid_animationPlay a motion capture animation on a humanoid. The animation must already be in memory via the add_humanoid_animation command.
stop_humanoid_animationStop a motion capture animation on a humanoid.

Obi Actor Command

CommandDescription
rotate_obi_actor_byRotate an Obi actor by a given angle around a given axis.
rotate_obi_actor_toSet an Obi actor's rotation.
teleport_obi_actorTeleport an Obi actor to a new position.
untether_obi_cloth_sheetUntether a cloth sheet at a specified position.

Obi Fluid Command

CommandDescription
set_obi_fluid_capacitySet a fluid emitter's particle capacity.
set_obi_fluid_emission_speedSet the emission speed of a fluid emitter. Larger values will cause more particles to be emitted.
set_obi_fluid_lifespanSet a fluid emitter's particle lifespan.
set_obi_fluid_random_velocitySet a fluid emitter's random velocity.
set_obi_fluid_resolutionSet a fluid emitter's resolution.

Obi Fluid Fluid Command

CommandDescription
set_obi_fluid_smoothingSet a fluid's smoothing value.
set_obi_fluid_vorticitySet a fluid's vorticity.

Replicant Base Command

CommandDescription
parent_avatar_to_replicantParent an avatar to a Replicant. The avatar's position and rotation will always be relative to the Replicant's head. Usually you'll want to do this to add a camera to the Replicant.
replicant_resolve_collider_intersectionsTry to resolve intersections between the Replicant's colliders and any other colliders. If there are other objects intersecting with the Replicant, the objects will be moved away along a given directional vector.
replicant_stepAdvance the Replicant's IK solvers by 1 frame.

Replicant Base Arm Command

CommandDescription
replicant_drop_objectDrop a held object.
replicant_grasp_objectGrasp a target object.
replicant_set_grasped_object_rotationStart to rotate a grasped object relative to the rotation of the hand. This will update per communicate() call until the object is dropped.

Replicant Arm Command

Replicant Arm Motion Command

CommandDescription
replicant_reset_armTell the Replicant to start to reset the arm to its neutral position.

Replicant Reach For Command

CommandDescription
replicant_reach_for_objectTell the Replicant to start to reach for a target object. The Replicant will try to reach for the nearest empty object attached to the target. If there aren't any empty objects, the Replicant will reach for the nearest bounds position.
replicant_reach_for_positionTell a Replicant to start to reach for a target position.
replicant_reach_for_relative_positionInstruct a Replicant to start to reach for a target position relative to the Replicant.

Wheelchair Replicant Arm Command

Wheelchair Replicant Reach For Command

CommandDescription
wheelchair_replicant_reach_for_objectTell a WheelchairReplicant to start to reach for a target object. The WheelchairReplicant will try to reach for the nearest empty object attached to the target. If there aren't any empty objects, the Replicant will reach for the nearest bounds position.
wheelchair_replicant_reach_for_positionTell a WheelchairReplicant to start to reach for a target position.
wheelchair_replicant_reset_armTell a WheelchairReplicant to start to reset the arm to its neutral position.

Replicant Look At Command

CommandDescription
replicant_look_at_objectTell the Replicant to start to look at an object.
replicant_look_at_positionTell the Replicant to start to look at a position.
replicant_reset_headTell the Replicant to start to reset its head to its neutral position.
replicant_rotate_head_byRotate the Replicant's head by an angle around an axis.

Replicant Command

CommandDescription
add_replicant_rigidbodyAdd a Rigidbody to a Replicant.
play_replicant_animationPlay a Replicant animation. Optionally, maintain the positions and rotations of specified body parts as set in the IK sub-step prior to the animation sub-step.
stop_replicant_animationStop an ongoing Replicant animation.

Sub Object Command

CommandDescription
set_hinge_limitsSet the angle limits of a hinge joint. This will work with hinges, motors, and springs.
set_motor_forceSet the force a motor.
set_motor_target_velocitySet the target velocity a motor.
set_spring_damperSet the damper value of a spring.
set_spring_forceSet the force of a spring.
set_spring_target_positionSet the target position of a spring.
set_sub_object_lightTurn a light on or off.

Vehicle Command

CommandDescription
apply_vehicle_brakeSet the vehicle's brake value.
apply_vehicle_driveMove the vehicle forward or backward.
apply_vehicle_turnTurn the vehicle left or right.
parent_avatar_to_vehicleParent an avatar to the vehicle. Usually you'll want to do this to add a camera to the vehicle.

Visual Material Command

CommandDescription
set_texture_scaleSet the scale of the tiling of the material's main texture.
set_visual_materialSet a visual material of an object or one of its sub-objects.
set_visual_material_smoothnessSet the smoothness (glossiness) of an object's visual material.
set_wireframe_materialSet the visual material of an object or one of its sub-objects to wireframe.

Wheelchair Replicant Command

CommandDescription
set_wheelchair_brake_torqueSet the brake torque of the wheelchair's wheels.
set_wheelchair_motor_torqueSet the motor torque of the wheelchair's rear wheels.
set_wheelchair_steer_angleSet the steer angle of the wheelchair's front wheels.

Set Flex Actor

CommandDescription
set_flex_cloth_actorCreate or adjust a FlexClothActor for the object.
set_flex_fluid_actorCreate or adjust a FlexArrayActor as a fluid object.
set_flex_fluid_source_actorCreate or adjust a FlexSourceActor as a fluid "hose pipe" source.
set_flex_soft_actorCreate or adjust a FlexSoftActor for the object.
set_flex_solid_actorCreate or adjust a FlexSolidActor for the object.

Show Hide Object

CommandDescription
hide_objectHide the object.
show_objectShow the object.

Play Audio Command

Play Audio Data Command

CommandDescription
play_audio_dataPlay a sound at a position using audio sample data sent over from the controller.
play_audio_from_streaming_assetsLoad an audio clip from the StreamingAssets directory and play it.
play_point_source_dataMake this object a ResonanceAudioSoundSource and play the audio data.

Post Process Command

CommandDescription
set_ambient_occlusion_intensitySet the intensity (darkness) of the Ambient Occlusion effect.
set_ambient_occlusion_thickness_modifierSet the Thickness Modifier for the Ambient Occlusion effect controls "spread" of the effect out from corners.
set_apertureSet the depth-of-field aperture in post processing volume.
set_contrastSet the contrast value of the post-processing color grading.
set_focus_distanceSet the depth-of-field focus distance in post processing volume.
set_post_exposureSet the post-exposure value of the post-processing. A higher value will create a brighter image. We don't recommend values less than 0, or greater than 2.
set_saturationSet the saturation value of the post-processing color grading.
set_screen_space_reflectionsTurn ScreenSpaceReflections on or off.
set_vignetteEnable or disable the vignette, which darkens the image at the edges.

Proc Gen Room Command

CommandDescription
convexify_proc_gen_roomSet all environment colliders (walls, ceilings, and floor) to convex. This command only affects existing objects, and won't continuously convexify new objects. You should only use this command when using Flex objects, as some objects with convex colliders won't behave as expected.
create_proc_gen_ceilingCreate a ceiling for the procedurally generated room. The ceiling is divided into 1x1 "tiles", which can be manipulated with Proc Gen Ceiling Tiles Commands (see below).
destroy_proc_gen_ceilingDestroy all ceiling tiles in a procedurally-generated room.
set_proc_gen_ceiling_colorSet the albedo RGBA color of the ceiling.
set_proc_gen_ceiling_heightSet the height of all ceiling tiles in a proc-gen room.
set_proc_gen_ceiling_texture_scaleSet the scale of the tiling of the ceiling material's main texture.
set_proc_gen_walls_colorSet the albedo RGBA color of the walls.
set_proc_gen_walls_texture_scaleSet the texture scale of all walls in a proc-gen room.

Proc Gen Ceiling Tiles Command

CommandDescription
create_proc_gen_ceiling_tilesCreate new ceiling tiles in a procedurally generated room. If you just want to fill the ceiling with tiles, send the command create_ceiling instead.
destroy_proc_gen_ceiling_tilesDestroy ceiling tiles from a procedurally-created ceiling.

Proc Gen Floor Command

Proc Gen Material Command

CommandDescription
set_proc_gen_ceiling_materialSet the material of a procedurally-generated ceiling.
set_proc_gen_walls_materialSet the material of all procedurally-generated walls.

Proc Gen Walls Command

CommandDescription
create_exterior_wallsCreate the exterior walls. This must be called before all other ProcGenRoomCommands.
create_interior_wallsCreate the interior walls.
set_proc_gen_walls_scaleSet the scale of proc-gen wall sections.

Robot Command

CommandDescription
create_robot_obi_collidersCreate Obi colliders for a robot if there aren't any.
destroy_robotDestroy a robot in the scene.
make_robot_nav_mesh_obstacleMake a specific robot a NavMesh obstacle. If it is already a NavMesh obstacle, change its properties.
parent_avatar_to_robotParent an avatar to a robot. The avatar's position and rotation will always be relative to the robot. Usually you'll want to do this to add a camera to the robot.
remove_robot_nav_mesh_obstacleRemove a NavMesh obstacle from a robot (see make_robot_nav_mesh_obstacle).
set_immovableSet whether or not the root object of the robot is immovable. Its joints will still be moveable.
set_robot_colorSet the visual color of a robot in the scene.
set_robot_joint_idSet the ID of a robot joint. This can be useful when loading saved data that contains robot joint IDs. Note that the id parameter is for the parent robot, not the joint. The joint is located via joint_name. Accordingly, this command only works when all of the names of a robot's joints are unique.
set_robot_obi_collision_materialSet the Obi collision material of a robot.
teleport_robotTeleport the robot to a new position and rotation. This is a sudden movement that might disrupt the physics simulation. You should only use this command if you really need to (for example, if the robot falls over).

Magnebot Command

CommandDescription
detach_from_magnetDetach an object from a Magnebot magnet.
set_magnet_targetsSet the objects that the Magnebot magnet will try to pick up.

Magnebot Wheels Command

CommandDescription
set_magnebot_wheels_during_moveSet the friction coefficients of the Magnebot's wheels during a move_by() or move_to() action, given a target position. The friction coefficients will increase as the Magnebot approaches the target position and the command will announce if the Magnebot arrives at the target position.

Magnebot Wheels Turn Command

CommandDescription
set_magnebot_wheels_during_turn_bySet the friction coefficients of the Magnebot's wheels during a turn_by() action, given a target angle. The friction coefficients will increase as the Magnebot approaches the target angle and the command will announce if the Magnebot aligns with the target angle.
set_magnebot_wheels_during_turn_toSet the friction coefficients of the Magnebot's wheels during a turn_to() action, given a target angle. The friction coefficients will increase as the Magnebot approaches the target angle and the command will announce if the Magnebot aligns with the target angle. Because the Magnebot will move slightly while rotating, this command has an additional position parameter to re-check for alignment with the target.

Robot Joint Command

CommandDescription
clatterize_robot_jointMake a robot respond to Clatter audio by setting its audio values and adding a ClatterObject component. You must send ClatterizeObject for each robot prior to sending InitializeClatter (though they can all be in the same list of commands).
set_robot_joint_driveSet static joint drive parameters for a robot joint. Use the StaticRobot output data to determine which drives (x, y, and z) the joint has and what their default values are.
set_robot_joint_frictionSet the friction coefficient of a robot joint.
set_robot_joint_massSet the mass of a robot joint. To get the default mass, see the StaticRobot output data.
set_robot_joint_physic_materialSet the physic material of a robot joint and apply friction and bounciness values to the joint. These settings can be overriden by sending the command again.

Robot Joint Target Command

CommandDescription
add_force_to_prismaticAdd a force to a prismatic joint.
add_torque_to_revoluteAdd a torque to a revolute joint.
add_torque_to_sphericalAdd a torque to a spherical joint.
set_prismatic_targetSet the target position of a prismatic robot joint. Per frame, the joint will move towards the target until it is either no longer possible to do so (i.e. due to physics) or because it has reached the target position.
set_revolute_targetSet the target angle of a revolute robot joint. Per frame, the joint will revolve towards the target until it is either no longer possible to do so (i.e. due to physics) or because it has reached the target angle.
set_spherical_targetSet the target angles (x, y, z) of a spherical robot joint. Per frame, the joint will revolve towards the targets until it is either no longer possible to do so (i.e. due to physics) or because it has reached the target angles.

Set Robot Joint Position Command

CommandDescription
set_prismatic_positionInstantaneously set the position of a prismatic joint. Only use this command to set an initial pose for a robot.
set_revolute_angleInstantaneously set the angle of a revolute joint. Only use this command to set an initial pose for a robot.
set_spherical_anglesInstantaneously set the angles of a spherical joint. Only use this command to set an initial pose for a robot.

Send Multiple Data Once Command

CommandDescription
send_nav_mesh_pathTell the build to send data of a path on the NavMesh from the origin to the destination.

Send Overlap Command

CommandDescription
send_overlap_boxCheck which objects a box-shaped space overlaps with.
send_overlap_capsuleCheck which objects a capsule-shaped space overlaps with.
send_overlap_sphereCheck which objects a sphere-shaped space overlaps with.

Send Raycast Command

CommandDescription
send_boxcastCast a box along a direction and return the results. The can be multiple hits, each of which will be sent to the controller as Raycast data.
send_mouse_raycastRaycast from a camera through the mouse screen position.
send_raycastCast a ray from the origin to the destination.
send_spherecastCast a sphere along a direction and return the results. The can be multiple hits, each of which will be sent to the controller as Raycast data.

Singleton Subscriber Command

CommandDescription
send_collisionsSend collision data for all objects and avatars currently in the scene.
send_log_messagesSend log messages to the controller.

Send Data Command

CommandDescription
send_collider_intersectionsSend data for collider intersections between pairs of objects and between single objects and the environment (e.g. walls). Note that each intersection is a separate output data object, and that each pair of objects/environment meshes might intersect more than once because they might have more than one collider.
send_containmentSend containment data using container shapes. See: add_box_container, add_cylinder_container, and add_sphere_container. Container shapes will check for overlaps with other objects.
send_magnebotsSend data for each Magnebot in the scene.
send_occupancy_mapRequest an occupancy map, which will divide the environment into a grid with values indicating whether each cell is occupied or free.
send_robot_joint_velocitiesSend velocity data for each joint of each robot in the scene. This is separate from DynamicRobots output data for the sake of speed in certain simulations.
send_static_robotsSend static data that doesn't update per frame (such as segmentation colors) for each robot in the scene. See also: send_robots
send_substructureSend visual material substructure data for a single object.

Send Avatars Command

CommandDescription
send_avatarsSend data for avatars in the scene.
send_avatar_segmentation_colorsSend avatar segmentation color data.
send_camera_matricesSend camera matrix data for each camera.
send_field_of_viewSend field of view for each camera.
send_id_pass_grayscaleSend the average grayscale value of an _id pass.
send_id_pass_segmentation_colorsSend all unique colors in an _id pass.
send_imagesSend images and metadata.
send_image_sensorsSend data about each of the avatar's ImageSensors.
send_occlusionSend the extent to which the scene environment is occluding objects in the frame.
send_screen_positionsGiven a list of worldspace positions, return the screenspace positions according to each of the avatar's camera.

Send Fixed Length Data Command

CommandDescription
send_mouseSend mouse output data.
send_versionReceive data about the build version.

Send Fixed Length Avatars Data Command

CommandDescription
send_avatar_idsSend the IDs of each avatar in the scene.
send_fast_avatarsSend the position and rotation of each avatar in the scene. This is slightly faster than SendAvatars, and FastAvatars compresses much better than Avatars. However, FastAvatars doesn't contain avatar IDs, which makes it harder to use. See: send_avatar_ids which serializes the avatar IDs in the same order as the data in FastAvatars.
send_fast_image_sensorsSend the and rotation of each avatar's camera in the scene. This is slightly faster than SendImageSensors, and FastImageSensors compresses much better than ImageSensors. However, FastImageSensors is missing a lot of information contained in ImageSensors, including avatar IDs, making it harder to use. See: send_avatar_ids which serializes the avatar IDs in the same order as the data in FastImageSensors.

Send Fixed Length Object Data Command

CommandDescription
send_fast_transformsSend FastTransforms output data. This is slightly faster than SendTransforms, and FastTransforms compresses much better than Transforms. However, FastTransforms excludes some data (see output data documentation) and it is also harder to use. See: send_object_ids which serializes the object IDs in the same order as the data in FastTransforms.
send_object_idsSend the IDs of all Rigidbody objects (models and composite sub-objects) in the scene. The object IDs are sorted.

Send Single Data Command

CommandDescription
send_audio_sourcesSend data regarding whether each object in the scene is currently playing a sound.
send_avatar_transform_matricesSend 4x4 transform matrix data for all avatars in the scene.
send_categoriesSend data for the category names and colors of each object in the scene.
send_dronesSend data for each drone in the scene.
send_dynamic_composite_objectsSend dynamic data for every composite object in the scene.
send_dynamic_empty_objectsSend the positions of each empty object in the scene.
send_dynamic_robotsSend dynamic robot data for each robot in the scene.
send_framerateSend the build's framerate information.
send_humanoidsSend transform (position, rotation, etc.) data for humanoids in the scene.
send_junkSend junk data.
send_keyboardRequest keyboard input data.
send_lightsSend data for each directional light and point light in the scene.
send_obi_particlesSend particle data for all Obi actors in the scene.
send_post_processSend post-processing values.
send_replicant_segmentation_colorsSend the segmentationColor of each Replicant in the scene.
send_sceneSend streamed scene metadata.
send_scene_regionsReceive data about the sub-regions within a scene in the scene. Only send this command after initializing the scene.
send_static_composite_objectsSend static data for every composite object in the scene.
send_static_empty_objectsSend the IDs of each empty object and the IDs of their parent objects.
send_vr_rigSend data for a VR Rig currently in the scene.

Send Objects Block Command

CommandDescription
send_flex_particlesSend Flex particles data.
send_meshesSend mesh data. All requested objects MUST have readable meshes; otherwise, this command will throw unhandled C++ errors. To determine whether an object has a readable mesh, check if: record.flex == True For more information, read: Documentation/python/librarian/model_librarian.md

Send Objects Data Command

CommandDescription
send_albedo_colorsSend the main albedo color of each object in the scene.
send_boundsSend rotated bounds data of objects in the scene.
send_euler_anglesSend the rotations of each object expressed as Euler angles.
send_local_transformsSend Transform (position and rotation) data of objects in the scene relative to their parent object.
send_modelsSend name and URL of each model in the scene.
send_rigidbodiesSend Rigidbody (velocity, angular velocity, etc.) data of objects in the scene.
send_scalesSend Scales data of objects in the scene. The scales are the worldspace scales rather than a factor. Send scale_object_to, not scale_object
send_segmentation_colorsSend segmentation color data for objects in the scene.
send_static_rigidbodiesSend static rigidbody data (mass, kinematic state, etc.) of objects in the scene.
send_transformsSend Transform (position and rotation) data of objects in the scene.
send_transform_matricesSend 4x4 matrix data for each object, describing their positions and rotations.
send_volumesSend spatial volume data of objects in the scene. Volume is calculated from the physics colliders; it is an approximate value.

Send Replicants Command

CommandDescription
send_replicantsSend data of each Replicant in the scene.
send_wheelchair_replicantsSend data of each WheelchairReplicant in the scene.

Send Vr Command

CommandDescription
send_foveSend FOVE headset data.
send_leap_motionSend Leap Motion hand tracking data.
send_oculus_touch_buttonsSend data for buttons pressed on Oculus Touch controllers.
send_static_oculus_touchSend static data for the Oculus Touch rig.

Ui Command

CommandDescription
add_ui_canvasAdd a UI canvas to the scene. By default, the canvas will be an "overlay" and won't appear in image output data.
attach_ui_canvas_to_avatarAttach a UI canvas to an avatar. This allows the UI to appear in image output data.
attach_ui_canvas_to_vr_rigAttach a UI canvas to the head camera of a VR rig.
destroy_all_ui_canvasesDestroy all UI canvases in the scene. In this command, the canvas_id parameter is ignored.
destroy_ui_canvasDestroy a UI canvas and all of its UI elements.

Ui Element Command

Add Ui Command

CommandDescription
add_ui_textAdd UI text to the scene.

Add Ui Image Command

CommandDescription
add_ui_cutoutAdd a UI "cutout" image to the scene. This will draw a hole in a base UI element. The cutout image must be RGBA32.
add_ui_imageAdd a UI image to the scene. Note that the size parameter must match the actual pixel size of the image.

Set Ui Element Command

CommandDescription
destroy_ui_elementDestroy a UI element in the scene.
set_ui_colorSet the color of a UI image or text.
set_ui_element_depthSet the depth (z value) of a UI element relative its canvas (not its camera).
set_ui_element_positionSet the position of a UI element.
set_ui_element_rotationRotate a UI element to a new angle.
set_ui_element_sizeSet the size of a UI element.
set_ui_textSet the text of a Text object that is already on the screen.

Video Capture Command

CommandDescription
stop_video_captureStop ongoing video capture.

Start Video Capture Command

CommandDescription
start_video_capture_linuxStart video capture using ffmpeg. This command can only be used on Linux.
start_video_capture_osxStart video capture using ffmpeg. This command can only be used on OS X.
start_video_capture_windowsStart video capture using ffmpeg. This command can only be used on Windows.

Vr Command

CommandDescription
allow_fove_headset_movementHandle whether to send the Fove Headset position or not.
allow_fove_headset_rotationHandle whether to send the Fove Headset orientation or not.
attach_avatar_to_vr_rigAttach an avatar (A_Img_Caps_Kinematic) to the VR rig in the scene. This avatar will work like all others, i.e it can send images and other data. The avatar will match the position and rotation of the VR rig's head. By default, this feature is disabled because it slows down the simulation's FPS.
create_vr_obi_collidersCreate Obi colliders for a VR rig if there aren't any.
destroy_vr_rigDestroy the current VR rig.
refresh_leap_motion_rigRefresh a Leap Motion rig in the scene. This must be sent whenever new objects are added to the scene after the rig was created.
rotate_vr_rig_byRotate the VR rig by an angle.
set_vr_loading_screenShow or hide the VR rig's loading screen.
set_vr_obi_collision_materialSet the Obi collision material of the VR rig.
set_vr_resolution_scaleControls the actual size of eye textures as a multiplier of the device's default resolution.
show_leap_motion_handsVisually show or hide Leap Motion hands.
start_fove_calibrationStart the FOVE headset's internal calibration.
teleport_vr_rigTeleport the VR rig to a new position.
tilt_fove_rig_byTilt (pitch) the Fove rig by an angle.

Command

Abstract class for a message sent from the controller to the build.


add_magnebot

Add a Magnebot to the scene. For further documentation, see: Documentation/misc_frontend/robots.md For a high-level API, see: https://github.com/alters-mit/magnebot

{"$type": "add_magnebot"}
{"$type": "add_magnebot", "id": 0, "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"id"intThe unique ID of the Magnebot.0
"position"Vector3The initial position of the Magnebot.{"x": 0, "y": 0, "z": 0}
"rotation"Vector3The initial rotation of the Magnebot in Euler angles.{"x": 0, "y": 0, "z": 0}

adjust_point_lights_intensity_by

Adjust the intensity of all point lights in the scene by a value. Note that many scenes don't have any point lights.

{"$type": "adjust_point_lights_intensity_by", "intensity": 0.125}
ParameterTypeDescriptionDefault
"intensity"floatAdjust all point lights in the scene by this value.

apply_force

Apply a force into the world to an target position. The force will impact any objects between the origin and the target position.

{"$type": "apply_force", "origin": {"x": 1.1, "y": 0.0, "z": 0}, "target": {"x": 1.1, "y": 0.0, "z": 0}, "magnitude": 0.125}
ParameterTypeDescriptionDefault
"origin"Vector3The origin of the force.
"target"Vector3The target position of the force.
"magnitude"floatThe magnitude of the force.

create_avatar

Create an avatar (agent).

{"$type": "create_avatar", "type": "A_Simple_Body"}
{"$type": "create_avatar", "type": "A_Simple_Body", "id": "a"}
ParameterTypeDescriptionDefault
"type"AvatarTypeName of prefab.
"id"stringID of this avatar. Must be unique."a"

AvatarType

A type of avatar that can be created in TDW.

ValueDescription
"A_Simple_Body"An avatar that can toggle between multiple simply body types. See: change_avatar_body in the Command API.
"A_Img_Caps_Kinematic"An avatar without a body; a "floating camera".
"A_First_Person"An avatar with first-person keyboard and mouse controls.

create_empty_environment

Create an empty environment. This must be called after load_scene.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.
{"$type": "create_empty_environment"}
{"$type": "create_empty_environment", "center": {"x": 0, "y": 0, "z": 0}, "bounds": {"x": 10, "y": 10, "z": 10}}
ParameterTypeDescriptionDefault
"center"Vector3Centerpoint of this environment.{"x": 0, "y": 0, "z": 0}
"bounds"Vector3Spatial bounds (width, height, length) of the environment.{"x": 10, "y": 10, "z": 10}

create_vr_rig

Create a VR rig. If there is already a VR rig in the scene, this fails silently. For more information, see: Documentation/misc_frontend/vr.md

{"$type": "create_vr_rig"}
{"$type": "create_vr_rig", "rig_type": "oculus_touch_robot_hands", "sync_timestep_with_vr": True}
ParameterTypeDescriptionDefault
"rig_type"VrRigTypeThe type of VR rig to instantiate."oculus_touch_robot_hands"
"sync_timestep_with_vr"boolWhether to sync Time.fixedDeltaTime with the VR device refresh rate. Doing this improves physics behavior in VR; this parameter should almost always be True.True

VrRigType

The type of VR rig to add to the scene.

ValueDescription
"oculus_touch_robot_hands"A VR rig based on an Oculus headset (Rift S, Quest 2), Touch controllers and AutoHand grasping. Hands are visualized as robot hands.
"oculus_touch_human_hands"A VR rig based on an Oculus headset (Rift S, Quest 2), Touch controllers and AutoHand grasping. Hands are visualized as human hands.
"oculus_leap_motion"A VR rig based on an Oculus headset (Rift S, Quest 2) with Leap Motion hand tracking. </summary
"fove_leap_motion"A VR rig based on a FOVE human headset with Leap Motion hand tracking. </summary

destroy_all_objects

Destroy all objects and avatars in the scene.

  • Expensive: This command is computationally expensive.
  • Cached in memory: When this object is destroyed, the asset bundle remains in memory.If you want to recreate the object, the build will be able to instantiate it more or less instantly. To free up memory, send the command unload_asset_bundles.
{"$type": "destroy_all_objects"}

do_nothing

Do nothing. Useful for benchmarking.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.
{"$type": "do_nothing"}

enable_reflection_probes

Enable or disable the reflection probes in the scene. By default, the reflection probes are enabled. Disabling the reflection probes will yield less realistic images but will improve the speed of the simulation.

{"$type": "enable_reflection_probes"}
{"$type": "enable_reflection_probes", "enable": True}
ParameterTypeDescriptionDefault
"enable"boolIf True, the reflection probes will be enabled.True

initialize_clatter

Initialize Clatter. This command must be sent after each ClatterizeObject command has been sent (though it can be in the same list of commands).

{"$type": "initialize_clatter"}
{"$type": "initialize_clatter", "generate_random_seed": True, "random_seed": 0, "simulation_amp": 0.5, "min_collision_speed": 0.00001, "area_new_collision": 1e-5, "scrape_angle": 80, "impact_area_ratio": 5, "roll_angular_speed": 1, "max_contact_separation": 1e-8, "filter_duplicates": True, "max_num_contacts": 16, "sound_timeout": 0.1, "prevent_impact_distortion": True, "clamp_impact_contact_time": True, "min_time_between_impacts": 0.25, "max_time_between_impacts": 3, "scrape_amp": 1, "roughness_ratio_exponent": 0.7, "max_scrape_speed": 5, "loop_scrape_audio": True, "environment_impact_material": "wood_medium", "environment_size": 4, "environment_amp": 0.5, "environment_resonance": 0.1, "environment_mass": 100, "resonance_audio": False, "max_num_events": 200, "roll_substitute": "impact"}
ParameterTypeDescriptionDefault
"generate_random_seed"boolIf True, the random seed will be explicitly set.True
"random_seed"intThe random seed. Ignored if generate_random_seed == False.0
"simulation_amp"floatThe overall amplitude of the simulation. The amplitude of generated audio is scaled by this factor. Must be between 0 and 0.990.5
"min_collision_speed"floatThe minimum collision speed in meters per second. If a CollisionEvent has a speed less than this, it is ignored.0.00001
"area_new_collision"floatOn a collision stay event, if the previous area is None and the current area is greater than this, the audio event is either an impact or a scrape; see scrape_angle.1e-5
"scrape_angle"floatOn a collision stay event, there is a large new contact area (see area_new_collision), if the angle in degrees between Vector3.up and the normalized relative velocity of the collision is greater than this value, then the audio event is a scrape. Otherwise, it's an impact.80
"impact_area_ratio"floatOn a collision stay event, if the area of the collision increases by at least this factor, the audio event is an impact.5
"roll_angular_speed"floatOn a collision stay event, if the angular speed in meters per second is greater than or equal to this value, the audio event is a roll; otherwise, it's a scrape.1
"max_contact_separation"floatOn a collision stay event, if we think the collision is an impact but any of the contact points are this far away or greater, the audio event is none.1e-8
"filter_duplicates"boolEach object in Clatter tries to filter duplicate collision events in two ways. First, it will remove any reciprocal pairs of objects, i.e. it will accept a collision between objects 0 and 1 but not objects 1 and 0. Second, it will register only the first collision between objects per main-thread update (multiple collisions can be registered because there are many physics fixed update calls in between). To allow duplicate events, set this field to False.True
"max_num_contacts"intThe maximum number of contact points that will be evaluated when setting the contact area and speed. A higher number can mean somewhat greater precision but at the cost of performance.16
"sound_timeout"floatTimeout and destroy a Sound if it hasn't received new samples data after this many seconds.0.1
"prevent_impact_distortion"boolIf True, clamp impact audio amplitude values to less than or equal to 0.99, preventing distortion.True
"clamp_impact_contact_time"boolIf True, clamp impact contact time values to a plausible value. Set this to False if you want to generate impacts with unusually long contact times.True
"min_time_between_impacts"floatThe minimum time in seconds between impacts. If an impact occurs an this much time hasn't yet elapsed, the impact will be ignored. This can prevent strange "droning" sounds caused by too many impacts in rapid succession.0.25
"max_time_between_impacts"floatThe maximum time in seconds between impacts. After this many seconds, this impact series will end and a subsequent impact collision will start a new Impact.3
"scrape_amp"floatWhen setting the amplitude for a scrape, multiply simulation_amp by this factor.1
"roughness_ratio_exponent"floatAn exponent for each scrape material's roughness ratio. A lower value will cause all scrape audio to be louder relative to impact audio.0.7
"max_scrape_speed"floatFor the purposes of scrape audio generation, the collision speed is clamped to this maximum value.5
"loop_scrape_audio"boolIf True, fill in silences while scrape audio is being generated by continuously looping the current chunk of scrape audio until either there is new scrape audio or the scrape event ends.True
"environment_impact_material"ImpactMaterialUnsizedThe impact material for the environment (floors, walls, etc.)."wood_medium"
"environment_size"intThe impact material size bucket for the environment (floors, walls, etc.).4
"environment_amp"floatThe amp value for the environment (floors, walls, etc.).0.5
"environment_resonance"floatThe resonance value for the environment (floors, walls, etc.).0.1
"environment_mass"floatFor the purposes of audio generation, this is the mass of the environment (floors, walls, etc.).100
"resonance_audio"boolIf True, use Resonance Audio to play audio.False
"max_num_events"intThe maximum number of impacts, scrapes, and rolls that can be processed on a single communicate() call.200
"roll_substitute"AudioEventTypeRoll audio events are not yet supported in Clatter. If a roll is registered, it is instead treated as this value."impact"

load_scene

Loads a new locally-stored scene. Unloads an existing scene (if any). This command must be sent before create_exterior_walls or create_empty_environment This command does not need to be sent along with an add_scene command.

{"$type": "load_scene", "scene_name": "ProcGenScene"}
ParameterTypeDescriptionDefault
"scene_name"LocalSceneName of the scene to load.

LocalScene

The filename of a locally-stored scene.

ValueDescription
"ProcGenScene"The default ProcGen scene.
"PointLightScene"This is identical to ProcGenScene but with an extra point light.

parent_audio_source_to_object

Parent an audio source to an object. When the object moves, the audio source will move with it.

{"$type": "parent_audio_source_to_object", "object_id": 1, "audio_id": 1}
ParameterTypeDescriptionDefault
"object_id"intThe object ID.
"audio_id"intThe audio source ID.

pause_editor

Pause Unity Editor.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.
{"$type": "pause_editor"}

perlin_noise_terrain

Initialize a scene environment with procedurally generated "terrain" using Perlin noise. This command will return Meshes output data which will contain the mesh data of the terrain.

  • Sends data: This command instructs the build to send output data.

{"$type": "perlin_noise_terrain", "size": {"x": 1.1, "y": 0}}
{"$type": "perlin_noise_terrain", "size": {"x": 1.1, "y": 0}, "origin": {"x": 0, "y": 0}, "subdivisions": 1, "turbulence": 1, "max_y": 1, "visual_material": "", "color": {"r": 1, "g": 1, "b": 1, "a": 1}, "texture_scale": {"x": 1, "y": 1}, "dynamic_friction": 0.25, "static_friction": 0.4, "bounciness": 0.2}
ParameterTypeDescriptionDefault
"size"Vector2The (length, width) of the terrain in meters.
"origin"Vector2The offset of the perlin noise. Set this to a random number to generate random noise.{"x": 0, "y": 0}
"subdivisions"intThe number of subdivisions of the mesh. Increase this number to smooth out the mesh.1
"turbulence"floatHow "hilly" the terrain is.1
"max_y"floatThe maximum height of the terrain.1
"visual_material"stringThe visual material for the terrain. This visual material must have already been added to the simulation via the add_material command or Controller.get_add_material(). If empty, a gray default material will be used.""
"color"ColorThe color of the terrain.{"r": 1, "g": 1, "b": 1, "a": 1}
"texture_scale"Vector2If visual_material isn't an empty string, this will set the UV texture scale.{"x": 1, "y": 1}
"dynamic_friction"floatThe dynamic friction of the terrain.0.25
"static_friction"floatThe static friction of the terrain.0.4
"bounciness"floatThe bounciness of the terrain.0.2

rotate_hdri_skybox_by

Rotate the HDRI skybox by a given value and the sun light by the same value in the opposite direction, to maintain alignment.

{"$type": "rotate_hdri_skybox_by", "angle": 0.125}
ParameterTypeDescriptionDefault
"angle"floatThe value to rotate the HDRI skybox by. Skyboxes are always rotated in a positive direction; values are clamped between 0 and 360, and any negative values are forced positive. Rotate around the pitch axis to set the elevation of the sun. Rotate around the yaw axis to set the angle of the sun.

set_ambient_intensity

Set how much the ambient light fom the source affects the scene. Low values will darken the scene overall, to simulate evening /night light levels.

{"$type": "set_ambient_intensity"}
{"$type": "set_ambient_intensity", "intensity": 1.0}
ParameterTypeDescriptionDefault
"intensity"floatThe intensity of the ambient lighting in the scene.1.0

set_cursor

Set cursor parameters.

{"$type": "set_cursor"}
{"$type": "set_cursor", "visible": True, "locked": False}
ParameterTypeDescriptionDefault
"visible"boolIf True, the cursor is visible.True
"locked"boolIf True, the cursor is locked to the center of the screen.False

set_download_timeout

Set the timeout after which an Asset Bundle Command (e.g. add_object) will retry a download. The default timeout is 30 minutes, which should always be sufficient. Send this command only if your computer or Internet connection is very slow.

{"$type": "set_download_timeout"}
{"$type": "set_download_timeout", "timeout": 1800, "retry": True}
ParameterTypeDescriptionDefault
"timeout"intThe time in seconds until the asset bundle download request will timeout.1800
"retry"boolIf true, if a download times out, the build will try to download it again.True

set_dsp_buffer_size

Set the DSP buffer size. A lower value will result in less latency.

{"$type": "set_dsp_buffer_size"}
{"$type": "set_dsp_buffer_size", "size": 1024}
ParameterTypeDescriptionDefault
"size"intThe DSP buffer size.1024

set_error_handling

Set whether TDW will quit when it logs different types of messages.

  • Sends data: This command instructs the build to send output data.

{"$type": "set_error_handling"}
{"$type": "set_error_handling", "error": True, "warning": False}
ParameterTypeDescriptionDefault
"error"boolIf True, the build will try to quit when it logs an error.True
"warning"boolIf True, the build will quit when it logs a warning. This should almost always be False.False

set_floorplan_roof

Show or hide the roof of a floorplan scene. This command only works if the current scene is a floorplan added via the add_scene command: "floorplan_1a", "floorplan_4b", etc.

  • Expensive: This command is computationally expensive.
  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.
{"$type": "set_floorplan_roof"}
{"$type": "set_floorplan_roof", "show": True}
ParameterTypeDescriptionDefault
"show"boolIf true, show the roof.True

set_gravity_vector

Set the gravity vector in the scene.

{"$type": "set_gravity_vector"}
{"$type": "set_gravity_vector", "gravity": {"x": 0, "y": -9.81, "z": 0}}
ParameterTypeDescriptionDefault
"gravity"Vector3The gravity vector.{"x": 0, "y": -9.81, "z": 0}

set_hdri_skybox_exposure

Set the exposure of the HDRI skybox to a given value.

{"$type": "set_hdri_skybox_exposure", "exposure": 0.125}
ParameterTypeDescriptionDefault
"exposure"floatThe value to set the HDRI exposure to.

set_physics_solver_iterations

Set the number of physics solver iterations, which affects the overall accuracy of the physics engine.

{"$type": "set_physics_solver_iterations"}
{"$type": "set_physics_solver_iterations", "iterations": 12}
ParameterTypeDescriptionDefault
"iterations"intNumber of physics solver iterations. A higher number means better physics accuracy and somewhat reduced framerate.12

set_render_quality

Set the render quality level. The highest render quality level enables near-photorealism runtime rendering. The lowest render quality has "flat" rendering, no shadows, etc. The lower the render quality, the faster the simulation will run, especially in scenes with complex lighting.

{"$type": "set_render_quality"}
{"$type": "set_render_quality", "render_quality": 5}
ParameterTypeDescriptionDefault
"render_quality"intRender quality. 5=Best.5

set_screen_size

Set the screen size. Any images the build creates will also be this size.

{"$type": "set_screen_size"}
{"$type": "set_screen_size", "width": 256, "height": 256}
ParameterTypeDescriptionDefault
"width"intScreen width in pixels.256
"height"intScreen height in pixels.256

set_shadow_strength

Set the shadow strength of all lights in the scene. This only works if you already sent load_scene or add_scene.

{"$type": "set_shadow_strength"}
{"$type": "set_shadow_strength", "strength": 0.582}
ParameterTypeDescriptionDefault
"strength"floatThe shadow strength of each light in the scene. Must be between 0 and 1.0.582

set_sleep_threshold

Set the global Rigidbody "sleep threshold", the mass-normalized energy threshold below which objects start going to sleep. A "sleeping" object is completely still until moved again by a force (object impact, force command, etc.)

{"$type": "set_sleep_threshold"}
{"$type": "set_sleep_threshold", "sleep_threshold": 0.005}
ParameterTypeDescriptionDefault
"sleep_threshold"floatWhen any object's speed is less than this number, it will go to "sleep" and stop moving.0.005

set_socket_timeout

Set the timeout behavior for the socket used to communicate with the controller.

{"$type": "set_socket_timeout"}
{"$type": "set_socket_timeout", "timeout": Req.DEFAULT_TIMEOUT, "max_retries": Req.DEFAULT_MAX_RETRIES}
ParameterTypeDescriptionDefault
"timeout"intThe socket will timeout after this many milliseconds. The default value listed here is the default value for the build. This must be an integer.Req.DEFAULT_TIMEOUT
"max_retries"intThe number of times that the build will try to receive a message before terminating the socket and reconnecting.Req.DEFAULT_MAX_RETRIES

set_target_framerate

Set the target render framerate of the build. For more information: https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html

{"$type": "set_target_framerate"}
{"$type": "set_target_framerate", "framerate": 1000}
ParameterTypeDescriptionDefault
"framerate"intThe target framerate.1000

set_time_step

Set Time.fixedDeltaTime (Unity's physics step, as opposed to render time step). NOTE: Doubling the time_step is NOT equivalent to advancing two physics steps. For more information, see: https://docs.unity3d.com/Manual/TimeFrameManagement.html

{"$type": "set_time_step"}
{"$type": "set_time_step", "time_step": 0.01}
ParameterTypeDescriptionDefault
"time_step"floatTime.fixedDeltaTime0.01

set_vsync_count

Set the renderer's vsync count. For more information, read this: https://docs.unity3d.com/ScriptReference/QualitySettings-vSyncCount.html

{"$type": "set_vsync_count"}
{"$type": "set_vsync_count", "count": 1}
ParameterTypeDescriptionDefault
"count"intThe vsync count.1

step_physics

Step through the physics without triggering new avatar output, or new commands.

{"$type": "step_physics", "frames": 1}
ParameterTypeDescriptionDefault
"frames"intLet the physics run for this many frames.

stop_all_audio

Stop all ongoing audio.

{"$type": "stop_all_audio"}

terminate

Terminate the build.

  • Sends data: This command instructs the build to send output data.

{"$type": "terminate"}

unload_asset_bundles

Unloads all AssetBundles. Send this command only after destroying all objects in the scene. This command should be used only to free up memory. After sending it, you will need to re-download any objects you want to add to a scene.

  • Expensive: This command is computationally expensive.
{"$type": "unload_asset_bundles"}
{"$type": "unload_asset_bundles", "bundle_type": "models"}
ParameterTypeDescriptionDefault
"bundle_type"AssetBundleTypeThe type of asset bundle to unload from memory."models"

AssetBundleType

The type of cached asset bundle.

ValueDescription
"models"Model asset bundles.
"materials"Visual material asset bundles.
"scenes"Streamed scene asset bundles.
"skyboxes"HDRI skybox asset bundles.
"humanoids"Humanoid character asset bundles.
"humanoid_animations"Humanoid animation asset bundles.

unload_unused_assets

Unload lingering assets (scenes, models, textures, etc.) from memory. Send this command if you're rapidly adding and removing objects or scenes in order to prevent apparent memory leaks.

{"$type": "unload_unused_assets"}

AssetBundleCommand

These commands load an asset bundle (if it hasn't been loaded already), and then instiniate an object from that asset bundle.


add_scene

Add a scene to TDW. Unloads the current scene if any (including any created by the load_scene command).

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/scene_librarian.md
  • Wrapper function: The controller class has a wrapper function for this command that is usually easier than using the command itself. See: Controller.get_add_scene().
{"$type": "add_scene", "name": "string", "url": "string"}
{"$type": "add_scene", "name": "string", "url": "string", "convexify": False}
ParameterTypeDescriptionDefault
"convexify"boolIf true, make all the scene's colliders convex. Only set this to True if you are using NVIDIA Flex.False
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

AddObjectCommand

These commands load an asset bundle with a specific object (model, material, etc.).


add_drone

Add a drone to the scene.

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/drone_librarian.md
{"$type": "add_drone", "id": 1, "name": "string", "url": "string"}
{"$type": "add_drone", "id": 1, "name": "string", "url": "string", "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0}, "forward_speed": 7, "backward_speed": 5, "right_speed": 5, "left_speed": 5, "rise_speed": 5, "drop_speed": 5, "acceleration": 0.3, "deceleration": 0.2, "stability": 0.1, "turn_sensitivity": 2, "motor_on": True, "enable_lights": False}
ParameterTypeDescriptionDefault
"id"intThe unique ID of the drone.
"position"Vector3The position of the drone.{"x": 0, "y": 0, "z": 0}
"rotation"Vector3The rotation of the drone, in Euler angles.{"x": 0, "y": 0, "z": 0}
"forward_speed"floatSets the drone's max forward speed.7
"backward_speed"floatSets the drone's max backward speed.5
"right_speed"floatSets the drone's max right strafe speed.5
"left_speed"floatSets the drone's max left strafe speed.5
"rise_speed"floatSets the drone's max vertical rise speed.5
"drop_speed"floatSets the drone's max vertical drop speed.5
"acceleration"floatSets the drone's acceleration.0.3
"deceleration"floatSets the drone's deceleration.0.2
"stability"floatA factor that determinates how easily the drone is affected by outside forces.0.1
"turn_sensitivity"floatSets the drone's rotation speed.2
"motor_on"boolSets whether or not the drone is active on start.True
"enable_lights"boolSets whether or not the drone's lights are on.False
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

add_hdri_skybox

Add a single HDRI skybox to the scene. It is highly recommended that the values of all parameters match those in the record metadata. If you assign your own values, the lighting will probably be strange.

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/hdri_skybox_librarian.md
  • Wrapper function: The controller class has a wrapper function for this command that is usually easier than using the command itself. See: Controller.get_add_hdri_skybox().
{"$type": "add_hdri_skybox", "exposure": 0.125, "initial_skybox_rotation": 0.125, "sun_elevation": 0.125, "sun_initial_angle": 0.125, "sun_intensity": 0.125, "name": "string", "url": "string"}
ParameterTypeDescriptionDefault
"exposure"floatThe exposure value for this map.
"initial_skybox_rotation"floatThe initial rotation of the HDRI map.
"sun_elevation"floatThe elevation of the sun light, for this map image.
"sun_initial_angle"floatThe initial rotation angle of the sun light, matching the initial rotation of this map.
"sun_intensity"floatThe intensity value of the sun light for this map image.
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

add_humanoid_animation

Load an animation clip asset bundle into memory.

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/add_humanoid_animation.md
  • Wrapper function: The controller class has a wrapper function for this command that is usually easier than using the command itself. See: Controller.get_add_humanoid_animation().
{"$type": "add_humanoid_animation", "name": "string", "url": "string"}
ParameterTypeDescriptionDefault
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

add_robot

Add a robot to the scene. For further documentation, see: Documentation/lessons/robots/overview.md

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/robot_librarian.md
  • Wrapper function: The controller class has a wrapper function for this command that is usually easier than using the command itself. See: Controller.get_add_robot().
{"$type": "add_robot", "name": "string", "url": "string"}
{"$type": "add_robot", "name": "string", "url": "string", "id": 0, "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"id"intThe unique ID of the robot.0
"position"Vector3The initial position of the robot.{"x": 0, "y": 0, "z": 0}
"rotation"Vector3The initial rotation of the robot in Euler angles.{"x": 0, "y": 0, "z": 0}
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

add_vehicle

Add a vehicle to the scene.

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/vehicle_librarian.md
{"$type": "add_vehicle", "id": 1, "name": "string", "url": "string"}
{"$type": "add_vehicle", "id": 1, "name": "string", "url": "string", "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0}, "forward_speed": 30, "reverse_speed": 12}
ParameterTypeDescriptionDefault
"id"intThe unique ID of the vehicle.
"position"Vector3The position of the vehicle.{"x": 0, "y": 0, "z": 0}
"rotation"Vector3The rotation of the vehicle, in Euler angles.{"x": 0, "y": 0, "z": 0}
"forward_speed"floatSets the vehicle's max forward speed.30
"reverse_speed"floatSets the vehicle's max reverse speed.12
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

add_visual_effect

Add a non-physics visual effect to the scene from an asset bundle.

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/visual_effect_librarian.md
  • Wrapper function: The controller class has a wrapper function for this command that is usually easier than using the command itself. See: Controller.get_add_visual_effect().
{"$type": "add_visual_effect", "id": 1, "name": "string", "url": "string"}
{"$type": "add_visual_effect", "id": 1, "name": "string", "url": "string", "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"id"intThe ID of this visual effect.
"position"Vector3The initial position of the visual effect.{"x": 0, "y": 0, "z": 0}
"rotation"Vector3The initial rotation of the visual effect.{"x": 0, "y": 0, "z": 0}
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

AddHumanoidCommand

These commands add a humanoid model to the scene.


add_humanoid

Add a humanoid model to the scene.

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/humanoid_librarian.md
  • Wrapper function: The controller class has a wrapper function for this command that is usually easier than using the command itself. See: Controller.get_add_humanoid().
{"$type": "add_humanoid", "id": 1, "name": "string", "url": "string"}
{"$type": "add_humanoid", "id": 1, "name": "string", "url": "string", "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"id"intThe unique ID of the humanoid.
"position"Vector3Position of the humanoid.{"x": 0, "y": 0, "z": 0}
"rotation"Vector3Rotation of the humanoid, in Euler angles.{"x": 0, "y": 0, "z": 0}
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

add_replicant

Add a Replicant to the scene.

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/replicant_librarian.md
{"$type": "add_replicant", "id": 1, "name": "string", "url": "string"}
{"$type": "add_replicant", "id": 1, "name": "string", "url": "string", "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"id"intThe unique ID of the humanoid.
"position"Vector3Position of the humanoid.{"x": 0, "y": 0, "z": 0}
"rotation"Vector3Rotation of the humanoid, in Euler angles.{"x": 0, "y": 0, "z": 0}
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

add_smpl_humanoid

Add a parameterized humanoid to the scene using SMPL. Each parameter scales an aspect of the humanoid and must be between -1 and 1. For example, if the height is -1, then the humanoid will be the shortest possible height. Because all of these parameters blend together to create the overall shape, it isn't possible to document specific body shape values, such as overall height, that might correspond to this command's parameters.

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/humanoid_librarian.md
{"$type": "add_smpl_humanoid", "id": 1, "name": "string", "url": "string"}
{"$type": "add_smpl_humanoid", "id": 1, "name": "string", "url": "string", "height": 0, "weight": 0, "torso_height_and_shoulder_width": 0, "chest_breadth_and_neck_height": 0, "upper_lower_back_ratio": 0, "pelvis_width": 0, "hips_curve": 0, "torso_height": 0, "left_right_symmetry": 0, "shoulder_and_torso_width": 0, "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"height"floatThe height or overall scale of the model. Must be between -1 and 1.0
"weight"floatThe character's overall weight. Must be between -1 and 1.0
"torso_height_and_shoulder_width"floatThe height of the torso from the chest and the width of the shoulders. Must be between -1 and 1.0
"chest_breadth_and_neck_height"floatThe breadth of the chest and the height of the neck. Must be between -1 and 1.0
"upper_lower_back_ratio"floatThe extent to which the upper back is larger than the lower back or vice versa. Must be between -1 and 1.0
"pelvis_width"floatThe width of the pelvis. Must be between -1 and 1.0
"hips_curve"floatThe overall curviness of the hips. Must be between -1 and 1.0
"torso_height"floatThe height of the torso from the chest. Must be between -1 and 1.0
"left_right_symmetry"floatThe extent to which the left side of the mesh is slightly narrower or vice versa. Must be between -1 and 1.0
"shoulder_and_torso_width"floatThe width of the shoulders and torso combined. Must be between -1 and 1.0
"id"intThe unique ID of the humanoid.
"position"Vector3Position of the humanoid.{"x": 0, "y": 0, "z": 0}
"rotation"Vector3Rotation of the humanoid, in Euler angles.{"x": 0, "y": 0, "z": 0}
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

add_wheelchair_replicant

Add a WheelchairReplicant to the scene.

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/replicant_librarian.md
{"$type": "add_wheelchair_replicant", "id": 1, "name": "string", "url": "string"}
{"$type": "add_wheelchair_replicant", "id": 1, "name": "string", "url": "string", "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"id"intThe unique ID of the humanoid.
"position"Vector3Position of the humanoid.{"x": 0, "y": 0, "z": 0}
"rotation"Vector3Rotation of the humanoid, in Euler angles.{"x": 0, "y": 0, "z": 0}
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

AddMaterialCommand

These commands add material asset bundles to the scene.


add_material

Load a material asset bundle into memory. If you want to set the visual material of something in TDW (e.g. set_visual_material, you must first send this command.

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/material_librarian.md
  • Wrapper function: The controller class has a wrapper function for this command that is usually easier than using the command itself. See: Controller.get_add_material().
{"$type": "add_material", "name": "string", "url": "string"}
ParameterTypeDescriptionDefault
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

send_material_properties_report

Send a report of the material property values. Each report will be a separate LogMessage.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.

  • Sends data: This command instructs the build to send output data.

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/material_librarian.md

{"$type": "send_material_properties_report", "name": "string", "url": "string"}
ParameterTypeDescriptionDefault
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

send_material_report

Tell the build to send a report of a material asset bundle. Each report will be a separate LogMessage.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.

  • Sends data: This command instructs the build to send output data.

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/material_librarian.md

{"$type": "send_material_report", "name": "string", "url": "string"}
ParameterTypeDescriptionDefault
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

AddModelCommand

These commands add model asset bundles to the scene.


add_object

Add a single object from a model library or from a local asset bundle to the scene.

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/model_librarian.md
  • Wrapper function: The controller class has a wrapper function for this command that is usually easier than using the command itself. See: Controller.get_add_object().
{"$type": "add_object", "id": 1, "name": "string", "url": "string"}
{"$type": "add_object", "id": 1, "name": "string", "url": "string", "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0}, "scale_factor": 1, "category": "", "affordance_points": []}
ParameterTypeDescriptionDefault
"position"Vector3Position of the object.{"x": 0, "y": 0, "z": 0}
"rotation"Vector3Rotation of the object, in Euler angles.{"x": 0, "y": 0, "z": 0}
"id"intThe unique ID of the object.
"scale_factor"floatThe default scale factor of a model.1
"category"stringThe model category.""
"affordance_points"Vector3 []A list of affordance points. Can be empty.[]
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

send_model_report

Tell the build to send a report of a model asset bundle. Each report will be a separate LogMessage.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.

  • Sends data: This command instructs the build to send output data.

  • Downloads an asset bundle: This command will download an asset bundle from TDW's asset bundle library. The first time this command is sent during a simulation, it will be slow (because it needs to download the file). Afterwards, the file data will be cached until the simulation is terminated, and this command will be much faster. See: python/librarian/model_librarian.md

{"$type": "send_model_report", "flex": True, "id": 1, "name": "string", "url": "string"}
{"$type": "send_model_report", "flex": True, "id": 1, "name": "string", "url": "string", "scale_factor": 1, "category": "", "affordance_points": []}
ParameterTypeDescriptionDefault
"flex"boolIf True, we expect this model to be Flex-compatible.
"id"intThe unique ID of the object.
"scale_factor"floatThe default scale factor of a model.1
"category"stringThe model category.""
"affordance_points"Vector3 []A list of affordance points. Can be empty.[]
"name"stringThe name of the asset bundle.
"url"stringThe location of the asset bundle. If the asset bundle is remote, this must be a valid URL. If the asset is a local file, this must begin with the prefix "file:///"

AvatarCommand

Manipulate an avatar.


destroy_avatar

Destroy an avatar.

  • Expensive: This command is computationally expensive.
{"$type": "destroy_avatar"}
{"$type": "destroy_avatar", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"avatar_id"stringThe ID of the avatar."a"

enable_avatar_transparency

Enable transparency (the "alpha" channel, or "a" value in the color) on the avatar's visual materials. To set the color of an avatar, send set_avatar_color

{"$type": "enable_avatar_transparency"}
{"$type": "enable_avatar_transparency", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"avatar_id"stringThe ID of the avatar."a"

follow_object

Teleport the avatar to a position relative to a target. This must be sent per-frame to continuously follow the target.

{"$type": "follow_object"}
{"$type": "follow_object", "object_id": 0, "position": {"x": 0, "y": 0, "z": 0}, "rotation": False, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"object_id"intThe ID of the object that the avatar will follow.0
"position"Vector3The relative position to the avatar to the object.{"x": 0, "y": 0, "z": 0}
"rotation"boolIf True, set the avatar's rotation to the object's rotation.False
"avatar_id"stringThe ID of the avatar."a"

rotate_avatar_by

Rotate the avatar by a given angle around a given axis.

  • Non-physics motion: This command ignores the build's physics engine. If you send this command during a physics simulation (i.e. to a non-kinematic avatar), the physics might glitch.
{"$type": "rotate_avatar_by", "angle": 0.125}
{"$type": "rotate_avatar_by", "angle": 0.125, "axis": "yaw", "is_world": True, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"axis"AxisThe axis of rotation."yaw"
"angle"floatThe angle of rotation.
"is_world"boolIf true, the avatar will rotate via "global" directions and angles. If false, the avatar will rotate locally.True
"avatar_id"stringThe ID of the avatar."a"

Axis

An axis of rotation.

ValueDescription
"pitch"Nod your head "yes".
"yaw"Shake your head "no".
"roll"Put your ear to your shoulder.

rotate_avatar_to

Set the rotation quaternion of the avatar.

  • Non-physics motion: This command ignores the build's physics engine. If you send this command during a physics simulation (i.e. to a non-kinematic avatar), the physics might glitch.
{"$type": "rotate_avatar_to", "rotation": {"w": 0.6, "x": 3.5, "y": -45, "z": 0}}
{"$type": "rotate_avatar_to", "rotation": {"w": 0.6, "x": 3.5, "y": -45, "z": 0}, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"rotation"QuaternionThe rotation quaternion.
"avatar_id"stringThe ID of the avatar."a"

rotate_avatar_to_euler_angles

Set the rotation of the avatar with Euler angles.

  • Euler angles: Rotational behavior can become unpredictable if the Euler angles of an object are adjusted more than once. Consider sending this command only to initialize the orientation. See: [Rotation documentation)(../misc_frontend/rotation.md)
  • Non-physics motion: This command ignores the build's physics engine. If you send this command during a physics simulation (i.e. to a non-kinematic avatar), the physics might glitch.
{"$type": "rotate_avatar_to_euler_angles", "euler_angles": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "rotate_avatar_to_euler_angles", "euler_angles": {"x": 1.1, "y": 0.0, "z": 0}, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"euler_angles"Vector3The new Euler angles of the avatar.
"avatar_id"stringThe ID of the avatar."a"

scale_avatar

Scale the avatar's size by a factor from its current scale.

{"$type": "scale_avatar"}
{"$type": "scale_avatar", "scale_factor": {"x": 1, "y": 1, "z": 1}, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"scale_factor"Vector3Multiply the scale of the avatar by this vector. (For example, if scale_factor is (2,2,2), then the avatar's current size will double.){"x": 1, "y": 1, "z": 1}
"avatar_id"stringThe ID of the avatar."a"

set_avatar_collision_detection_mode

Set the collision mode of all of the avatar's Rigidbodies. This doesn't need to be sent continuously, but does need to be sent per avatar.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.
{"$type": "set_avatar_collision_detection_mode"}
{"$type": "set_avatar_collision_detection_mode", "mode": "continuous_dynamic", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"mode"DetectionModeThe collision detection mode."continuous_dynamic"
"avatar_id"stringThe ID of the avatar."a"

DetectionMode

The detection mode.

ValueDescription
"continuous_dynamic"(From Unity documentation:) Prevent this Rigidbody from passing through static mesh geometry, and through other Rigidbodies which have continuous collision detection enabled, when it is moving fast. This is the slowest collision detection mode, and should only be used for selected fast moving objects.
"continuous_speculative"(From Unity documentation:) This is a collision detection mode that can be used on both dynamic and kinematic objects. It is generally cheaper than other CCD modes. It also handles angular motion much better. However, in some cases, high speed objects may still tunneling through other geometries.
"discrete"(From Unity documentation: This is the fastest mode.)
"continuous"(From Unity documentation: Collisions will be detected for any static mesh geometry in the path of this Rigidbody, even if the collision occurs between two FixedUpdate steps. Static mesh geometry is any MeshCollider which does not have a Rigidbody attached. This also prevent Rigidbodies set to ContinuousDynamic mode from passing through this Rigidbody.

set_avatar_color

Set the color of an avatar. To allow transparency (the "alpha" channel, or "a" value in the color), first send enable_avatar_transparency

{"$type": "set_avatar_color", "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}}
{"$type": "set_avatar_color", "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"color"ColorThe color of the avatar.
"avatar_id"stringThe ID of the avatar."a"

set_avatar_forward

Set the forward directional vector of the avatar.

  • Non-physics motion: This command ignores the build's physics engine. If you send this command during a physics simulation (i.e. to a non-kinematic avatar), the physics might glitch.
{"$type": "set_avatar_forward"}
{"$type": "set_avatar_forward", "forward": {"x": 0, "y": 0, "z": 1}, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"forward"Vector3The new forward directional vector.{"x": 0, "y": 0, "z": 1}
"avatar_id"stringThe ID of the avatar."a"

set_camera_clipping_planes

Set the near and far clipping planes of the avatar's camera.

{"$type": "set_camera_clipping_planes"}
{"$type": "set_camera_clipping_planes", "near": 0.1, "far": 100, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"near"floatThe distance of the near clipping plane.0.1
"far"floatThe distance of the far clipping plane.100
"avatar_id"stringThe ID of the avatar."a"

set_field_of_view

Set the field of view of the avatar's camera. This will automatically set the focal length (see: set_focal_length).

{"$type": "set_field_of_view"}
{"$type": "set_field_of_view", "field_of_view": 54.43223, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"field_of_view"floatThe field of view.54.43223
"avatar_id"stringThe ID of the avatar."a"

set_focal_length

Set the focal length of the avatar's camera. This will automatically set the field of view (see: set_field_of_view).

{"$type": "set_focal_length"}
{"$type": "set_focal_length", "focal_length": 35, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"focal_length"floatThe focal length.35
"avatar_id"stringThe ID of the avatar."a"

set_pass_masks

Set which types of images the avatar will render. By default, the avatar will render, but not send, these images. See send_images in the Command API.

  • Expensive: This command is computationally expensive.
{"$type": "set_pass_masks", "pass_masks": ["_img"]}
{"$type": "set_pass_masks", "pass_masks": ["_img"], "avatar_id": "a"}
ParameterTypeDescriptionDefault
"pass_masks"PassMask[]The avatar will render each of these passes per frame.
"avatar_id"stringThe ID of the avatar."a"

PassMask

ValueDescription
_img Standard rendering of the scene.
_id The segmentation colors of each object.
_category The segmentation colors of each semantic object category (note that both jugs on the table have the same color).
_mask Similar to _id and _category but every object has the same color.
_depth Depth values per pixel. The image looks strange because it is using color rather than grayscale to encode more precisely. To decode the image, use TDWUtils.get_depth_values().
_depth_simple Depth values per pixel. This grayscale image is less precise than the _depth pass but is easier to use and doesn't require a conversion function, making it somewhat faster. The depth values aren't normalized.
_normals Surfaces are colored according to their orientation in relation to the camera.
_flow Pixels are colored according to their motion in relation to the camera.
_albedo Only color and texture, as if lit with only ambient light.

teleport_avatar_by

Teleport the avatar by a position offset.

  • Non-physics motion: This command ignores the build's physics engine. If you send this command during a physics simulation (i.e. to a non-kinematic avatar), the physics might glitch.
{"$type": "teleport_avatar_by", "position": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "teleport_avatar_by", "position": {"x": 1.1, "y": 0.0, "z": 0}, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"position"Vector3The position offset to teleport by.
"avatar_id"stringThe ID of the avatar."a"

teleport_avatar_to

Teleport the avatar to a position.

  • Non-physics motion: This command ignores the build's physics engine. If you send this command during a physics simulation (i.e. to a non-kinematic avatar), the physics might glitch.
{"$type": "teleport_avatar_to", "position": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "teleport_avatar_to", "position": {"x": 1.1, "y": 0.0, "z": 0}, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"position"Vector3The position to teleport to.
"avatar_id"stringThe ID of the avatar."a"

AddAudioSensorCommand

These commands add a type of audio sensor to the avatar.


add_audio_sensor

Add an AudioSensor component to the avatar, if it does not already have one.

{"$type": "add_audio_sensor"}
{"$type": "add_audio_sensor", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"avatar_id"stringThe ID of the avatar."a"

add_environ_audio_sensor

Add a ResonanceAudioListener component to the avatar, if it does not already have one.

{"$type": "add_environ_audio_sensor"}
{"$type": "add_environ_audio_sensor", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"avatar_id"stringThe ID of the avatar."a"

AvatarRigidbodyCommand

These commands affect the Rigidbody of the Avatar. Note: For the Sticky Mitten Avatar, the Rigidbody being manipulated is the torso.


apply_force_to_avatar

Apply a force to the avatar.

  • Physics motion: This command uses rigidbody physics. If you send this command to a kinematic avatar, nothing will happen. If you're running a physics simulation, you should only send commands with this tag to move and rotate an avatar.
{"$type": "apply_force_to_avatar", "magnitude": 0.125}
{"$type": "apply_force_to_avatar", "magnitude": 0.125, "direction": {"x": 0, "y": 0, "z": 1}, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"direction"Vector3The direction of the force.{"x": 0, "y": 0, "z": 1}
"magnitude"floatThe magnitude of the force.
"avatar_id"stringThe ID of the avatar."a"

move_avatar_forward_by

Apply a force along the avatar's forward directional vector.

  • Physics motion: This command uses rigidbody physics. If you send this command to a kinematic avatar, nothing will happen. If you're running a physics simulation, you should only send commands with this tag to move and rotate an avatar.
{"$type": "move_avatar_forward_by", "magnitude": 0.125}
{"$type": "move_avatar_forward_by", "magnitude": 0.125, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"magnitude"floatThe magnitude of the force.
"avatar_id"stringThe ID of the avatar."a"

move_avatar_to

Move the position of the avatar's rigidbody. This is very similar to teleport_avatar_to, but it is a physics-based motion, and will comply with physics interpolation.

  • Physics motion: This command uses rigidbody physics. If you send this command to a kinematic avatar, nothing will happen. If you're running a physics simulation, you should only send commands with this tag to move and rotate an avatar.
{"$type": "move_avatar_to", "position": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "move_avatar_to", "position": {"x": 1.1, "y": 0.0, "z": 0}, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"position"Vector3The new position of the avatar.
"avatar_id"stringThe ID of the avatar."a"

set_avatar_drag

Set the drag of the avatar's Rigidbody. Both drag and angular_drag can be safely changed on-the-fly.

  • Physics motion: This command uses rigidbody physics. If you send this command to a kinematic avatar, nothing will happen. If you're running a physics simulation, you should only send commands with this tag to move and rotate an avatar.
{"$type": "set_avatar_drag"}
{"$type": "set_avatar_drag", "drag": 0, "angular_drag": 0.05, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"drag"floatSet the drag of the Rigidbody. A higher drag value will cause the avatar slow down faster.0
"angular_drag"floatSet the angular drag of the Rigidbody. A higher angular drag will cause the avatar's rotation to slow down faster.0.05
"avatar_id"stringThe ID of the avatar."a"

set_avatar_kinematic_state

Set an avatars's Rigidbody to be kinematic or not. A kinematic object won't respond to PhysX physics.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.
{"$type": "set_avatar_kinematic_state"}
{"$type": "set_avatar_kinematic_state", "is_kinematic": False, "use_gravity": False, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"is_kinematic"boolIf true, the Rigidbody will be kinematic, and won't respond to physics.False
"use_gravity"boolIf true, the object will respond to gravity.False
"avatar_id"stringThe ID of the avatar."a"

set_avatar_mass

Set the mass of an avatar.

{"$type": "set_avatar_mass", "mass": 0.125}
{"$type": "set_avatar_mass", "mass": 0.125, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"mass"floatThe new mass of the avatar.
"avatar_id"stringThe ID of the avatar."a"

set_avatar_physic_material

Set the physic material of the avatar's main body collider and apply friction and bounciness values. Friction and bounciness don't affect physics as much as drag and angular_drag (see set_avatar_drag). LOW friction values and HIGH bounciness means that the avatar won't "climb" up other objects.

{"$type": "set_avatar_physic_material", "dynamic_friction": 0.125, "static_friction": 0.125, "bounciness": 0.125}
{"$type": "set_avatar_physic_material", "dynamic_friction": 0.125, "static_friction": 0.125, "bounciness": 0.125, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"dynamic_friction"floatFriction when the avatar is already moving. A higher value means that the avatar will come to rest very quickly. Must be between 0 and 1.
"static_friction"floatFriction when the avatar is not moving. A higher value means that a lot of force will be needed to make the avatar start moving. Must be between 0 and 1.
"bounciness"floatThe bounciness of the avatar. A higher value means that the avatar will bounce without losing much energy. Must be between 0 and 1.
"avatar_id"stringThe ID of the avatar."a"

turn_avatar_by

Apply a relative torque to the avatar.

  • Physics motion: This command uses rigidbody physics. If you send this command to a kinematic avatar, nothing will happen. If you're running a physics simulation, you should only send commands with this tag to move and rotate an avatar.
{"$type": "turn_avatar_by", "torque": 0.125}
{"$type": "turn_avatar_by", "torque": 0.125, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"torque"floatThe magnitude of the torque around the y axis.
"avatar_id"stringThe ID of the avatar."a"

AvatarTypeCommand

These commands work only for the specified avatar subclass.


set_first_person_avatar

Set the parameters of an A_First_Person avatar.

{"$type": "set_first_person_avatar"}
{"$type": "set_first_person_avatar", "height": 1.6, "camera_height": 1.4, "radius": 0.5, "slope_limit": 15, "detect_collisions": True, "move_speed": 1.5, "look_speed": 50, "look_x_limit": 45, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"height"floatThe height of the avatar.1.6
"camera_height"floatThe height of the camera.1.4
"radius"floatThe radius of the avatar.0.5
"slope_limit"floatThe avatar can only climb slopes up to this many degrees.15
"detect_collisions"boolIf True, the avatar will collide with other objects.True
"move_speed"floatThe move speed in meters per second.1.5
"look_speed"floatThe camera rotation speed in degrees per second.50
"look_x_limit"floatThe camera rotation limit around the x axis in degrees.45
"avatar_id"stringThe ID of the avatar."a"

SimpleBodyCommand

These commands are only valid for a SimpleBodyAvatar.


change_avatar_body

Change the body of a SimpleBodyAvatar.

{"$type": "change_avatar_body", "body_type": "Cube"}
{"$type": "change_avatar_body", "body_type": "Cube", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"body_type"SimpleBodyTypeThe body type of the avatar.
"avatar_id"stringThe ID of the avatar."a"

SimpleBodyType

Enum of body types for a SimpleBodyAvatar.

ValueDescription
"Cube"
"Capsule"
"Cylinder"
"Sphere"

MoveAvatarTowards

Move an after towards a target at a given speed per frame.


move_avatar_towards_object

Move the avatar towards an object.

  • Non-physics motion: This command ignores the build's physics engine. If you send this command during a physics simulation (i.e. to a non-kinematic avatar), the physics might glitch.
  • Motion is applied over time: This command will move, rotate, or otherwise adjust the avatar per-frame at a non-linear rate (smoothed at the start and end). This command must be sent per-frame to continuously update.
{"$type": "move_avatar_towards_object", "object_id": 1, "offset": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "move_avatar_towards_object", "object_id": 1, "offset": {"x": 1.1, "y": 0.0, "z": 0}, "use_centroid": True, "speed": 0.1, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"object_id"intThe ID of the object.
"offset"Vector3The offset the position of the avatar from the object.
"use_centroid"boolIf true, move towards the centroid of the object. If false, move towards the position of the object (y=0).True
"speed"floatMove a maximum of this many meters per frame towards the target.0.1
"avatar_id"stringThe ID of the avatar."a"

move_avatar_towards_position

Move the avatar towards the target position.

  • Non-physics motion: This command ignores the build's physics engine. If you send this command during a physics simulation (i.e. to a non-kinematic avatar), the physics might glitch.
  • Motion is applied over time: This command will move, rotate, or otherwise adjust the avatar per-frame at a non-linear rate (smoothed at the start and end). This command must be sent per-frame to continuously update.
{"$type": "move_avatar_towards_position"}
{"$type": "move_avatar_towards_position", "position": {"x": 0, "y": 0, "z": 0}, "speed": 0.1, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"position"Vector3The target position.{"x": 0, "y": 0, "z": 0}
"speed"floatMove a maximum of this many meters per frame towards the target.0.1
"avatar_id"stringThe ID of the avatar."a"

SensorContainerCommand

These commands adjust an avatar's image sensor container. All avatars have at least one sensor, which is named "SensorContainer". Sticky Mitten Avatars have an additional sensor named "FollowCamera". For a list of all image sensors attached to an avatar, send send_image_sensors.


add_visual_camera_mesh

Add a visual camera mesh to the sensor container. The visual mesh won't have colliders and won't respond to physics.

{"$type": "add_visual_camera_mesh"}
{"$type": "add_visual_camera_mesh", "position": {"x": 0, "y": 0, "z": -0.06}, "scale": {"x": 1, "y": 1, "z": 1}, "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"position"Vector3The position of the visual camera mesh relative to the sensor container.{"x": 0, "y": 0, "z": -0.06}
"scale"Vector3The scale of the visual camera mesh.{"x": 1, "y": 1, "z": 1}
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

enable_image_sensor

Turn a sensor on or off. The command set_pass_masks will override this command (i.e. it will turn on a camera that has been turned off),

{"$type": "enable_image_sensor"}
{"$type": "enable_image_sensor", "enable": True, "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"enable"boolIf true, enable the image sensor.True
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

look_at

Look at an object (rotate the image sensor to center the object in the frame).

{"$type": "look_at", "object_id": 1, "use_centroid": True}
{"$type": "look_at", "object_id": 1, "use_centroid": True, "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"object_id"intThe ID of the object we want the avatar to look at.
"use_centroid"boolIf true, look at the centroid of the object. If false, look at the position of the object (y=0).
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

look_at_avatar

Look at another avatar (rotate the image sensor to center the avatar in the frame).

{"$type": "look_at_avatar", "target_avatar_id": "string", "use_centroid": True}
{"$type": "look_at_avatar", "target_avatar_id": "string", "use_centroid": True, "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"target_avatar_id"stringThe ID of the avatar we want this avatar to look at.
"use_centroid"boolIf true, look at the centroid of the avatar. If false, look at the position of the avatar (y=0).
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

look_at_position

Look at a worldspace position (rotate the image sensor to center the position in the frame).

{"$type": "look_at_position", "position": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "look_at_position", "position": {"x": 1.1, "y": 0.0, "z": 0}, "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"position"Vector3The worldspace position that the avatar should look at.
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

reset_sensor_container_rotation

Reset the rotation of the avatar's sensor container.

{"$type": "reset_sensor_container_rotation"}
{"$type": "reset_sensor_container_rotation", "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

rotate_sensor_container_by

Rotate the sensor container of the avatar by a given angle along a given axis.

{"$type": "rotate_sensor_container_by", "axis": "pitch", "angle": 0.125}
{"$type": "rotate_sensor_container_by", "axis": "pitch", "angle": 0.125, "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"axis"AxisThe axis of rotation.
"angle"floatThe angle of rotation.
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

Axis

An axis of rotation.

ValueDescription
"pitch"Nod your head "yes".
"yaw"Shake your head "no".
"roll"Put your ear to your shoulder.

rotate_sensor_container_to

Set the rotation quaternion of the avatar's sensor container.

{"$type": "rotate_sensor_container_to", "rotation": {"w": 0.6, "x": 3.5, "y": -45, "z": 0}}
{"$type": "rotate_sensor_container_to", "rotation": {"w": 0.6, "x": 3.5, "y": -45, "z": 0}, "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"rotation"QuaternionThe rotation quaternion.
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

set_anti_aliasing

Set the anti-aliasing mode for the avatar's camera.

  • Expensive: This command is computationally expensive.
{"$type": "set_anti_aliasing"}
{"$type": "set_anti_aliasing", "mode": "subpixel", "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"mode"AntiAliasingModeThe anti-aliasing mode."subpixel"
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

AntiAliasingMode

The anti-aliasing mode for the camera.

ValueDescription
"fast"A computionally fast technique with lower image quality results.
"none"No antialiasing.
"subpixel"A higher quality, more expensive technique than fast. This is the default setting of all cameras in TDW.
"temporal"The highest-quality technique. Expensive. Adds motion blurring based on camera history. If you are frequently teleporting the avatar (and camera), do NOT use this mode.

set_render_order

Set the order in which this camera will render relative to other cameras in the scene. This can prevent flickering on the screen when there are multiple cameras. This doesn't affect image capture; it only affects what the simulation application screen is displaying at runtime.

{"$type": "set_render_order"}
{"$type": "set_render_order", "render_order": 0, "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"render_order"intThe render order. The highest number will the be camera rendered in the application window. By default, all TDW cameras have the same render order number.0
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

translate_sensor_container_by

Translate the sensor container relative to the avatar by a given directional vector.

{"$type": "translate_sensor_container_by"}
{"$type": "translate_sensor_container_by", "move_by": {"x": 0, "y": 0, "z": 0}, "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"move_by"Vector3How much to translate the container's local position by.{"x": 0, "y": 0, "z": 0}
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

FocusOnObjectCommand

These commands set the depth-of-field focus value based on the position of a target object.


focus_on_object

Set the post-process depth of field focus distance to equal the distance between the avatar and an object. This won't adjust the angle or position of the avatar's camera.

{"$type": "focus_on_object", "object_id": 1}
{"$type": "focus_on_object", "object_id": 1, "use_centroid": False, "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"object_id"intThe ID of the object.
"use_centroid"boolIf true, look at the centroid of the object. This is computationally expensive. If false, look at the position of the object (y=0).False
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

focus_towards_object

Focus towards the depth-of-field towards the position of an object.

  • Depth of Field: This command modifies the post-processing depth of field. See: Depth of Field and Image Blurriness.
  • Motion is applied over time: This command will move, rotate, or otherwise adjust the avatar per-frame at a non-linear rate (smoothed at the start and end). This command must be sent per-frame to continuously update.
{"$type": "focus_towards_object", "object_id": 1}
{"$type": "focus_towards_object", "object_id": 1, "speed": 0.3, "use_centroid": False, "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"speed"floatFocus towards the target distance at this speed.0.3
"object_id"intThe ID of the object.
"use_centroid"boolIf true, look at the centroid of the object. This is computationally expensive. If false, look at the position of the object (y=0).False
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

RotateSensorContainerTowards

These commands rotate the sensor container towards a target by a given angular speed per frame.


rotate_sensor_container_towards_object

Rotate the sensor container towards the current position of a target object.

  • Motion is applied over time: This command will move, rotate, or otherwise adjust the avatar per-frame at a non-linear rate (smoothed at the start and end). This command must be sent per-frame to continuously update.
{"$type": "rotate_sensor_container_towards_object", "object_id": 1}
{"$type": "rotate_sensor_container_towards_object", "object_id": 1, "use_centroid": True, "speed": 3, "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"object_id"intThe ID of the object we want the sensor container to rotate towards.
"use_centroid"boolIf true, rotate towards the centroid of the object. If false, rotate towards the position of the object (y=0).True
"speed"floatThe maximum angular speed that the sensor container will rotate per frame.3
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

rotate_sensor_container_towards_position

Rotate the sensor container towards a position at a given angular speed per frame.

  • Motion is applied over time: This command will move, rotate, or otherwise adjust the avatar per-frame at a non-linear rate (smoothed at the start and end). This command must be sent per-frame to continuously update.
{"$type": "rotate_sensor_container_towards_position"}
{"$type": "rotate_sensor_container_towards_position", "position": {"x": 0, "y": 0, "z": 0}, "speed": 3, "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"position"Vector3The target position to rotate towards.{"x": 0, "y": 0, "z": 0}
"speed"floatThe maximum angular speed that the sensor container will rotate per frame.3
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

rotate_sensor_container_towards_rotation

Rotate the sensor container towards a target rotation.

  • Motion is applied over time: This command will move, rotate, or otherwise adjust the avatar per-frame at a non-linear rate (smoothed at the start and end). This command must be sent per-frame to continuously update.
{"$type": "rotate_sensor_container_towards_rotation"}
{"$type": "rotate_sensor_container_towards_rotation", "rotation": {"w": 1, "x": 0, "y": 0, "z": 0}, "speed": 3, "sensor_name": "SensorContainer", "avatar_id": "a"}
ParameterTypeDescriptionDefault
"rotation"QuaternionThe target rotation.{"w": 1, "x": 0, "y": 0, "z": 0}
"speed"floatThe maximum angular speed that the sensor container will rotate per frame.3
"sensor_name"stringThe name of the target sensor."SensorContainer"
"avatar_id"stringThe ID of the avatar."a"

CompassRoseCommand

These commands add or remove a non-physical compass rose to the scene.


add_compass_rose

Add a visual compass rose to the scene. It will show which way is north, south, etc. as well as positive X, negative X, etc.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.
{"$type": "add_compass_rose"}
{"$type": "add_compass_rose", "position": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"position"Vector3Position of the compass rose.{"x": 0, "y": 0, "z": 0}

destroy_compass_rose

Destroy the compasss rose in the scene.

{"$type": "destroy_compass_rose"}

CreateReverbSpaceCommand

Base class to create a ResonanceAudio Room, sized to the dimensions of the current room environment.


set_reverb_space_expert

Create a ResonanceAudio Room, sized to the dimensions of the current room environment. All values are passed in as parameters.

{"$type": "set_reverb_space_expert"}
{"$type": "set_reverb_space_expert", "reflectivity": 1.0, "reverb_brightness": 0.5, "reverb_gain": 0, "reverb_time": 1.0, "region_id": -1, "reverb_floor_material": "parquet", "reverb_ceiling_material": "acousticTile", "reverb_front_wall_material": "smoothPlaster", "reverb_back_wall_material": "smoothPlaster", "reverb_left_wall_material": "smoothPlaster", "reverb_right_wall_material": "smoothPlaster"}
ParameterTypeDescriptionDefault
"reflectivity"floatStrength of early reflections in a Resonance Audio Room, to simulate the size and shape of the room.1.0
"reverb_brightness"floatBalance the amount of low or high frequencies by providing different reverb decay rates at different frequencies.0.5
"reverb_gain"floatAdjust room effect loudness, compared to direct sound coming from Resonance Audio sources in a scene.0
"reverb_time"floatIncreases or decreases reverb length; the value is a multiplier on the reverb time calculated from the surface materials and room dimensions of the room.1.0
"region_id"intThe ID of the scene region (room) to enable reverberation in. If -1, the reverb space will encapsulate the entire scene instead of a single room.-1
"reverb_floor_material"SurfaceMaterialThe surface material of the reverb space floor."parquet"
"reverb_ceiling_material"SurfaceMaterialThe surface material of the reverb space ceiling."acousticTile"
"reverb_front_wall_material"SurfaceMaterialThe surface material of the reverb space front wall."smoothPlaster"
"reverb_back_wall_material"SurfaceMaterialThe surface material of the reverb space back wall."smoothPlaster"
"reverb_left_wall_material"SurfaceMaterialThe surface material of the reverb space left wall."smoothPlaster"
"reverb_right_wall_material"SurfaceMaterialThe surface material of the reverb space right wall."smoothPlaster"

SurfaceMaterial

List of surface material types.

ValueDescription
"smoothPlaster"
"roughPlaster"
"glass"
"parquet"
"marble"
"grass"
"concrete"
"brick"
"tile"
"acousticTile"
"metal"
"wood"

set_reverb_space_simple

Create a ResonanceAudio Room, sized to the dimensions of the current room environment. Reflectivity (early reflections) and reverb brightness (late reflections) calculated automatically based on size of space and percentage filled with objects.

{"$type": "set_reverb_space_simple"}
{"$type": "set_reverb_space_simple", "min_room_volume": 27.0, "max_room_volume": 1000.0, "region_id": -1, "reverb_floor_material": "parquet", "reverb_ceiling_material": "acousticTile", "reverb_front_wall_material": "smoothPlaster", "reverb_back_wall_material": "smoothPlaster", "reverb_left_wall_material": "smoothPlaster", "reverb_right_wall_material": "smoothPlaster"}
ParameterTypeDescriptionDefault
"min_room_volume"floatMinimum possible volume of a room (i.e. 1 x 1 x 1 room).27.0
"max_room_volume"floatMaximum room volume purely for range-setting for reflectivity calculation.1000.0
"region_id"intThe ID of the scene region (room) to enable reverberation in. If -1, the reverb space will encapsulate the entire scene instead of a single room.-1
"reverb_floor_material"SurfaceMaterialThe surface material of the reverb space floor."parquet"
"reverb_ceiling_material"SurfaceMaterialThe surface material of the reverb space ceiling."acousticTile"
"reverb_front_wall_material"SurfaceMaterialThe surface material of the reverb space front wall."smoothPlaster"
"reverb_back_wall_material"SurfaceMaterialThe surface material of the reverb space back wall."smoothPlaster"
"reverb_left_wall_material"SurfaceMaterialThe surface material of the reverb space left wall."smoothPlaster"
"reverb_right_wall_material"SurfaceMaterialThe surface material of the reverb space right wall."smoothPlaster"

SurfaceMaterial

List of surface material types.

ValueDescription
"smoothPlaster"
"roughPlaster"
"glass"
"parquet"
"marble"
"grass"
"concrete"
"brick"
"tile"
"acousticTile"
"metal"
"wood"

DirectionalLightCommand

These commands adjust the directional light(s) in the scene. There is always at least one directional light in the scene (the sun).


adjust_directional_light_intensity_by

Adjust the intensity of the directional light (the sun) by a value.

{"$type": "adjust_directional_light_intensity_by", "intensity": 0.125}
{"$type": "adjust_directional_light_intensity_by", "intensity": 0.125, "index": 0}
ParameterTypeDescriptionDefault
"intensity"floatAdjust the intensity of the sunlight by this value.
"index"intThe index of the light. This should almost always be 0. The scene "archviz_house" has two directional lights; for this scene, index can be 0 or 1.0

reset_directional_light_rotation

Reset the rotation of the directional light (the sun).

{"$type": "reset_directional_light_rotation"}
{"$type": "reset_directional_light_rotation", "index": 0}
ParameterTypeDescriptionDefault
"index"intThe index of the light. This should almost always be 0. The scene "archviz_house" has two directional lights; for this scene, index can be 0 or 1.0

rotate_directional_light_by

Rotate the directional light (the sun) by an angle and axis. This command will change the direction of cast shadows, which could adversely affect lighting that uses an HDRI skybox, Therefore this command should only be used for interior scenes where the effect of the skybox is less apparent. The original relationship between directional (sun) light and HDRI skybox can be restored by using the reset_directional_light_rotation command.

{"$type": "rotate_directional_light_by", "angle": 0.125}
{"$type": "rotate_directional_light_by", "angle": 0.125, "axis": "yaw", "index": 0}
ParameterTypeDescriptionDefault
"axis"AxisThe axis of rotation."yaw"
"angle"floatThe angle of rotation in degrees.
"index"intThe index of the light. This should almost always be 0. The scene "archviz_house" has two directional lights; for this scene, index can be 0 or 1.0

Axis

An axis of rotation.

ValueDescription
"pitch"Nod your head "yes".
"yaw"Shake your head "no".
"roll"Put your ear to your shoulder.

set_directional_light_color

Set the color of the directional light (the sun).

{"$type": "set_directional_light_color", "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}}
{"$type": "set_directional_light_color", "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}, "index": 0}
ParameterTypeDescriptionDefault
"color"ColorThe color of the sunlight.
"index"intThe index of the light. This should almost always be 0. The scene "archviz_house" has two directional lights; for this scene, index can be 0 or 1.0

FlexContainerCommand

These commands affect an NVIDIA Flex container.


create_flex_container

Create a Flex Container. The ID of this container is the quantity of containers in the scene prior to adding it.

  • Expensive: This command is computationally expensive.
  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
{"$type": "create_flex_container"}
{"$type": "create_flex_container", "radius": 0.1875, "solid_rest": 0.125, "fluid_rest": 0.1125, "static_friction": 0.5, "dynamic_friction": 0.5, "particle_friction": 0.5, "collision_distance": 0.0625, "substep_count": 3, "iteration_count": 8, "damping": 1, "drag": 0.0, "shape_collision_margin": 0.0, "planes": [], "cohesion": 0.025, "surface_tension": 0.0, "viscocity": 0.001, "vorticity": 0.0, "buoyancy": 1.0, "adhesion": 0.0, "anisotropy_scale": 2.0, "max_particles": 10000, "max_neighbors": 100, "sleep_threshold": 0.0, "restitution": 0}
ParameterTypeDescriptionDefault
"radius"floatThe maximum interaction radius for particles.0.1875
"solid_rest"floatThe distance non-fluid particles attempt to maintain from each other, must be in the range (0, radius].0.125
"fluid_rest"floatThe distance fluid particles are spaced at the rest density, must be in the range (0, radius], typically 50%-70% of radius.0.1125
"static_friction"floatThe coefficient of static friction used when colliding against shapes.0.5
"dynamic_friction"floatThe coefficient of dynamic friction used when colliding against shapes.0.5
"particle_friction"floatThe coefficient of friction used when colliding particles.0.5
"collision_distance"floatThe Distance particles maintain against shapes. Note that for robust collision against triangle meshes this distance should be greater than zero.0.0625
"substep_count"intThe time dt will be divided into the number of sub-steps given by this parameter.3
"iteration_count"intThe number of solver iterations to perform per-substep.8
"damping"floatThe viscous drag force. This applies a force proportional, and opposite to, the particle velocity.1
"drag"floatThe drag force applied to cloth particles.0.0
"shape_collision_margin"floatIncreases the radius used during contact finding against kinematic shapes.0.0
"planes"Vector4 []Defines the boundary planes within which the particles can move.[]
"cohesion"floatControls how strongly particles hold each other together.0.025
"surface_tension"floatControls how strongly particles attempt to minimize surface area.0.0
"viscocity"floatSmoothes particle velocity using XSPH viscocity.0.001
"vorticity"floatIncreases vorticity by appying rotational foces to particles.0.0
"buoyancy"floatGravity is scaled by this value for fluid particles.1.0
"adhesion"floatControls how strongly particles stick to surfaces they hit.0.0
"anisotropy_scale"floatControls level of anisotropy when rendering ellipsoids. Useful for fluids.2.0
"max_particles"intMaximum number of particles for the container.10000
"max_neighbors"intMaximum number of neighbors for the container.100
"sleep_threshold"floatParticles with a velocity magnitude greater than this threshold will be considered fixed.0.0
"restitution"floatCoefficient of restitution used when colliding against shapes. Particle collisions are always inelastic.0

destroy_flex_container

Destroy an existing Flex container. Only send this command after destroying all Flex objects in the scene.

  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
{"$type": "destroy_flex_container"}
{"$type": "destroy_flex_container", "id": 0}
ParameterTypeDescriptionDefault
"id"intThe ID of the existing container.0

FloorCommand

These commands adjust the floor in the scene. To do so, they look for an object that in the backend is tagged "floor". Most, but not all scenes that have a floor have a tagged floor. If there is no tagged floor, these commands fail silently and log a warning. These commands will always work with the ProcGen room.


create_floor_obi_colliders

Create Obi colliders for the floor if there aren't any.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "create_floor_obi_colliders"}

set_floor_color

Set the albedo color of the floor.

{"$type": "set_floor_color", "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}}
ParameterTypeDescriptionDefault
"color"ColorThe new albedo RGBA color of the floor.

set_floor_material

Set the material of the floor.

  • Requires a material asset bundle: To use this command, you must first download an load a material. Send the add_material command first.
{"$type": "set_floor_material", "name": "string"}
ParameterTypeDescriptionDefault
"name"stringThe name of the material. The material must already be loaded in memory.

set_floor_obi_collision_material

Set the Obi collision material of the floor.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "set_floor_obi_collision_material"}
{"$type": "set_floor_obi_collision_material", "dynamic_friction": 0.3, "static_friction": 0.3, "stickiness": 0, "stick_distance": 0, "friction_combine": "average", "stickiness_combine": "average"}
ParameterTypeDescriptionDefault
"dynamic_friction"floatPercentage of relative tangential velocity removed in a collision, once the static friction threshold has been surpassed and the particle is moving relative to the surface. 0 means things will slide as if made of ice, 1 will result in total loss of tangential velocity.0.3
"static_friction"floatPercentage of relative tangential velocity removed in a collision. 0 means things will slide as if made of ice, 1 will result in total loss of tangential velocity.0.3
"stickiness"floatAmount of inward normal force applied between objects in a collision. 0 means no force will be applied, 1 will keep objects from separating once they collide.0
"stick_distance"floatMaximum distance between objects at which sticky forces are applied. Since contacts will be generated between bodies within the stick distance, it should be kept as small as possible to reduce the amount of contacts generated.0
"friction_combine"MaterialCombineModeHow is the friction coefficient calculated when two objects involved in a collision have different coefficients. If both objects have different friction combine modes, the mode with the lowest enum index is used."average"
"stickiness_combine"MaterialCombineModeHow is the stickiness coefficient calculated when two objects involved in a collision have different coefficients. If both objects have different stickiness combine modes, the mode with the lowest enum index is used."average"

MaterialCombineMode

Obi collision maerial combine modes.

ValueDescription
"average"
"minimum"
"multiply"
"maximum"

set_floor_physic_material

Set the physic material of the floor. These settings can be overriden by sending the command again. When an object contacts the floor, the floor's physic material values are averaged with an object's values.

{"$type": "set_floor_physic_material", "dynamic_friction": 0.125, "static_friction": 0.125, "bounciness": 0.125}
ParameterTypeDescriptionDefault
"dynamic_friction"floatA higher value means that an object on the floor will come to rest very quickly. Must be between 0 and 1.
"static_friction"floatA higher value means that a lot of force will be needed to make an object on the floor start moving. Must be between 0 and 1.
"bounciness"floatA higher value means that an object on the floor will bounce without losing much energy. Must be between 0 and 1.

set_floor_texture_scale

Set the scale of the tiling of the floor material's main texture.

{"$type": "set_floor_texture_scale"}
{"$type": "set_floor_texture_scale", "scale": {"x": 1, "y": 1}}
ParameterTypeDescriptionDefault
"scale"Vector2The tiling scale of the material. Generally (but by no means always), the default tiling scale of a texture is {"x": 1, "y": 1}{"x": 1, "y": 1}

GlobalBooleanCommand

Command with a single toggle-able boolean that affects the build globally. These commands always have a default value, and are cached as singleton instances.


set_img_pass_encoding

Toggle the _img pass of all avatars' cameras to be either png or jpg. True = png, False = jpg, Initial value = True (png)

{"$type": "set_img_pass_encoding", "value": True}
ParameterTypeDescriptionDefault
"value"boolBoolean value.

set_legacy_shaders

Set whether TDW should use legacy shaders. Prior to TDW v1.8 there was a bug and this command would result in lower image quality. Since then, TDW has far better rendering quality (at no speed penalty). Send this command only if you began your project in an earlier version of TDW and need to ensure that the rendering doesn't change. Initial value = False. (TDW will correctly set each object's shaders.)

{"$type": "set_legacy_shaders", "value": True}
ParameterTypeDescriptionDefault
"value"boolBoolean value.

set_network_logging

If True, the build will log every message received from the controller and will log every command that is executed. Initial value = False

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.
{"$type": "set_network_logging", "value": True}
ParameterTypeDescriptionDefault
"value"boolBoolean value.

set_post_process

Toggle whether post-processing is enabled in the scene. Disabling post-processing will make rendered images "flatter". Initial value = True (post-processing is enabled)

{"$type": "set_post_process", "value": True}
ParameterTypeDescriptionDefault
"value"boolBoolean value.

simulate_physics

Toggle whether to simulate physics per list of sent commands (i.e. per frame). If false, the simulation won't step the physics forward. Initial value = True (simulate physics per frame).

{"$type": "simulate_physics", "value": True}
ParameterTypeDescriptionDefault
"value"boolBoolean value.

use_pre_signed_urls

Toggle whether to download asset bundles (models, scenes, etc.) directly from byte streams of S3 objects, or from temporary URLs that expire after ten minutes. Only send this command and set this to True if you're experiencing segfaults when downloading models from models_full.json Initial value = On Linux: True (use temporary URLs). On Windows and OS X: False (download S3 objects directly, without using temporary URLs).

{"$type": "use_pre_signed_urls", "value": True}
ParameterTypeDescriptionDefault
"value"boolBoolean value.

LoadFromResources

Load something of type T from resources.

LoadGameObjectFromResources

Load a GameObject from resources.


load_flex_fluid_from_resources

Load a FlexFluidPrimitive from resources.

  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
  • Deprecated: This command has been deprecated. In the next major TDW update (1.x.0), this command will be removed.
{"$type": "load_flex_fluid_from_resources", "id": 1}
{"$type": "load_flex_fluid_from_resources", "id": 1, "position": {"x": 0, "y": 0, "z": 0}, "orientation": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"position"Vector3Position of the object.{"x": 0, "y": 0, "z": 0}
"orientation"Vector3Orientation of the object, in Euler angles.{"x": 0, "y": 0, "z": 0}
"id"intThe unique ID of the object.

load_flex_fluid_source_from_resources

Load a FlexFluidSource mesh from resources.

  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
  • Deprecated: This command has been deprecated. In the next major TDW update (1.x.0), this command will be removed.
{"$type": "load_flex_fluid_source_from_resources", "id": 1}
{"$type": "load_flex_fluid_source_from_resources", "id": 1, "position": {"x": 0, "y": 0, "z": 0}, "orientation": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"position"Vector3Position of the object.{"x": 0, "y": 0, "z": 0}
"orientation"Vector3Orientation of the object, in Euler angles.{"x": 0, "y": 0, "z": 0}
"id"intThe unique ID of the object.

load_primitive_from_resources

Load a primitive object from resources.

{"$type": "load_primitive_from_resources", "primitive_type": "Cylinder", "id": 1}
{"$type": "load_primitive_from_resources", "primitive_type": "Cylinder", "id": 1, "position": {"x": 0, "y": 0, "z": 0}, "orientation": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"primitive_type"PrimitiveTypeThe type of primitive.
"position"Vector3Position of the object.{"x": 0, "y": 0, "z": 0}
"orientation"Vector3Orientation of the object, in Euler angles.{"x": 0, "y": 0, "z": 0}
"id"intThe unique ID of the object.

PrimitiveType

Types of primitives, which correspond to filenames.

ValueDescription
"Cylinder"
"Cube"
"Sphere"
"Plane"

NavMeshCommand

These commands utilize Unity's built-in NavMesh pathfinding system. Send bake_nav_mesh before sending any other Nav Mesh Commands.


bake_nav_mesh

Bake the NavMesh, enabling Unity pathfinding. This must be sent before any other Nav Mesh Commands, and after creating the scene environment (e.g. the procedurally generated room).

  • Expensive: This command is computationally expensive.
{"$type": "bake_nav_mesh"}
{"$type": "bake_nav_mesh", "voxel_size": 0.1666667, "carve_type": "all", "ignore": []}
ParameterTypeDescriptionDefault
"voxel_size"floatThe voxel size. A lower value means higher fidelity and a longer bake.0.1666667
"carve_type"CarveTypeHow each object in the scene will "carve" holes in the NavMesh."all"
"ignore"int []A list of object or robot IDs that will be ignored when baking the NavMesh.[]

CarveType

How objects in the scene will "carve" the NavMesh.

ValueDescription
"all"Each object will carve a large hole in the NavMesh. If an object moves, the hole will move too. This is the most performance-intensive option.
"stationary"Each object will initially carve a large hole in the NavMesh. If an objects moves, it won't "re-carve" the NavMesh. A small hole will remain in its original position.
"none"Each object will carve small holes in the NavMesh. If an objects moves, it won't "re-carve" the NavMesh. A small hole will remain in its original position.

send_is_on_nav_mesh

Given a position, try to get the nearest position on the NavMesh.

  • Requires a NavMesh: This command requires a NavMesh.Scenes created via add_scene already have NavMeshes.Proc-gen scenes don't; send bake_nav_mesh to create one.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_is_on_nav_mesh", "position": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "send_is_on_nav_mesh", "position": {"x": 1.1, "y": 0.0, "z": 0}, "max_distance": 1.0, "id": 0}
ParameterTypeDescriptionDefault
"position"Vector3The position being tested. Its y value will be normalized to the y value of the NavMesh at the (x, z) coordinate.
"max_distance"floatRadius of the search for a valid point. A large value will result in an expensive calculation; try to keep the value below 5.1.0
"id"intThe ID of this output data. This is useful if this command is sent more than once.0

NonPhysicsObjectCommand

These commands add or affect non-physics objects.

LineRendererCommand

These commands show, remove, or adjust 3D lines in the scene.


add_line_renderer

Add a 3D line to the scene.

{"$type": "add_line_renderer", "points": [{"x": 1.1, "y": 0.0, "z": 0}, {"x": 2, "y": 0, "z": -1}], "start_color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}, "end_color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}, "id": 1}
{"$type": "add_line_renderer", "points": [{"x": 1.1, "y": 0.0, "z": 0}, {"x": 2, "y": 0, "z": -1}], "start_color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}, "end_color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}, "id": 1, "start_width": 1, "end_width": 1, "loop": False, "position": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"points"Vector3 []The points or vertices along the line. This must have at least 2 elements.
"start_color"ColorThe start color of the line.
"end_color"ColorThe end color of the line. If it's different than start_color, the colors will have an even gradient along the line.
"start_width"floatThe start width of the line in meters.1
"end_width"floatThe end width of the line in meters.1
"loop"boolIf True, the start and end positions of the line will connect together to form a continuous loop.False
"position"Vector3The position of the line.{"x": 0, "y": 0, "z": 0}
"id"intThe ID of the non-physics object.

destroy_line_renderer

Destroy an existing line in the scene from the scene.

{"$type": "destroy_line_renderer", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe ID of the non-physics object.

AdjustLineRendererCommand

These commands adjust rendered lines in the scene.


add_points_to_line_renderer

Add points to an existing line in the scene.

{"$type": "add_points_to_line_renderer", "points": [{"x": 1.1, "y": 0.0, "z": 0}, {"x": 2, "y": 0, "z": -1}], "id": 1}
ParameterTypeDescriptionDefault
"points"Vector3 []Additional points on the line.
"id"intThe ID of the non-physics object.

remove_points_from_line_renderer

Remove points from an existing line in the scene.

{"$type": "remove_points_from_line_renderer", "id": 1}
{"$type": "remove_points_from_line_renderer", "id": 1, "count": 0}
ParameterTypeDescriptionDefault
"count"intRemove this many points from the end of the line.0
"id"intThe ID of the non-physics object.

simplify_line_renderer

Simplify a 3D line to the scene by removing intermediate points.

{"$type": "simplify_line_renderer", "id": 1}
{"$type": "simplify_line_renderer", "id": 1, "tolerance": 0}
ParameterTypeDescriptionDefault
"tolerance"floatA value greater than 0 used to simplify the line. Points within the tolerance parameter will be removed. A value of 0 means that all points will be included.0
"id"intThe ID of the non-physics object.

PositionMarkerCommand

These commands show or hide position markers. They can be useful for debugging.


add_position_marker

Create a non-physics, non-interactive marker at a position in the scene.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.
{"$type": "add_position_marker", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1}
{"$type": "add_position_marker", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "scale": 0.05, "color": {"r": 1, "g": 0, "b": 0, "a": 1}, "shape": "sphere"}
ParameterTypeDescriptionDefault
"position"Vector3Add a marker at this position.
"scale"floatThe scale of the marker. If the scale is 1, a cube and square will be 1 meter wide and a sphere and circle will be 1 meter in diameter.0.05
"color"ColorThe color of the marker. The default color is red.{"r": 1, "g": 0, "b": 0, "a": 1}
"shape"ShapeThe shape of the position marker object."sphere"
"id"intThe ID of the non-physics object.

Shape

The shape of the marker.

ValueDescription
"cube"
"sphere"
"circle"
"square"

remove_position_markers

Remove all position markers from the scene.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.
{"$type": "remove_position_markers", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe ID of the non-physics object.

TexturedQuadCommand

These commands allow you to create and edit static quad meshes (a rectangle with four vertices) with textures. To create a textured quad, send the command create_textured_quad. To edit a textured quad, send set_textured_quad.


create_textured_quad

Create a blank quad (a rectangular mesh with four vertices) in the scene.

{"$type": "create_textured_quad", "position": {"x": 1.1, "y": 0.0, "z": 0}, "size": {"x": 1.1, "y": 0}, "euler_angles": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1}
ParameterTypeDescriptionDefault
"position"Vector3The position of the quad. This will always be anchored in the bottom-center point of the object.
"size"Vector2The width and height of the quad.
"euler_angles"Vector3The orientation of the quad, in Euler angles.
"id"intThe ID of the non-physics object.

destroy_textured_quad

Destroy an existing textured quad.

{"$type": "destroy_textured_quad", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe ID of the non-physics object.

AdjustTexturedQuadCommand

These commands adjust an existing textured quad.


parent_textured_quad_to_object

Parent a textured quad to an object in the scene. The textured quad will always be at a fixed local position and rotation relative to the object.

{"$type": "parent_textured_quad_to_object", "object_id": 1, "id": 1}
ParameterTypeDescriptionDefault
"object_id"intThe ID of the parent object in the scene.
"id"intThe ID of the non-physics object.

rotate_textured_quad_by

Rotate a textured quad by a given angle around a given axis.

{"$type": "rotate_textured_quad_by", "angle": 0.125, "id": 1}
{"$type": "rotate_textured_quad_by", "angle": 0.125, "id": 1, "axis": "yaw", "is_world": True}
ParameterTypeDescriptionDefault
"axis"AxisThe axis of rotation."yaw"
"angle"floatThe angle of rotation.
"is_world"boolIf true, the quad will rotate via "global" directions and angles. If false, the quad will rotate locally.True
"id"intThe ID of the non-physics object.

Axis

An axis of rotation.

ValueDescription
"pitch"Nod your head "yes".
"yaw"Shake your head "no".
"roll"Put your ear to your shoulder.

rotate_textured_quad_to

Set the rotation of a textured quad.

{"$type": "rotate_textured_quad_to", "rotation": {"w": 0.6, "x": 3.5, "y": -45, "z": 0}, "id": 1}
ParameterTypeDescriptionDefault
"rotation"QuaternionThe rotation quaternion.
"id"intThe ID of the non-physics object.

scale_textured_quad

Scale a textured quad by a factor.

{"$type": "scale_textured_quad", "id": 1}
{"$type": "scale_textured_quad", "id": 1, "scale_factor": {"x": 1, "y": 1, "z": 1}}
ParameterTypeDescriptionDefault
"scale_factor"Vector3Multiply the scale of the quad by this vector. (For example, if scale_factor is (2,2,2), then the quad's current size will double.){"x": 1, "y": 1, "z": 1}
"id"intThe ID of the non-physics object.

set_textured_quad

Apply a texture to a pre-existing quad.

  • Expensive: This command is computationally expensive.
{"$type": "set_textured_quad", "dimensions": {"x": 0, "y": 1}, "image": "string", "id": 1}
ParameterTypeDescriptionDefault
"dimensions"GridPointThe expected dimensions of the image in pixels.
"image"stringbase64 string representation of the image byte array.
"id"intThe ID of the non-physics object.

show_textured_quad

Show or hide a textured quad.

{"$type": "show_textured_quad", "id": 1}
{"$type": "show_textured_quad", "id": 1, "show": True}
ParameterTypeDescriptionDefault
"show"boolIf True, show the quad. If False, hide it.True
"id"intThe ID of the non-physics object.

teleport_textured_quad

Teleport a textured quad to a new position.

{"$type": "teleport_textured_quad", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1}
ParameterTypeDescriptionDefault
"position"Vector3New position of the quad.
"id"intThe ID of the non-physics object.

unparent_textured_quad

Unparent a textured quad from a parent object. If the textured quad doesn't have a parent object, this command doesn't do anything.

{"$type": "unparent_textured_quad", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe ID of the non-physics object.

VisualEffectCommand

These commands can be used for non-physical visual effects in the scene.


destroy_visual_effect

Destroy a non-physical effect object.

{"$type": "destroy_visual_effect", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe ID of the non-physics object.

AdjustVisualEffectCommand

These commands adjust non-physical visual effects.


parent_visual_effect_to_object

Parent a non-physical visual effect to a standard TDW physically-embodied object.

{"$type": "parent_visual_effect_to_object", "object_id": 1, "id": 1}
ParameterTypeDescriptionDefault
"object_id"intThe ID of the physically-embodied TDW object.
"id"intThe ID of the non-physics object.

rotate_visual_effect_by

Rotate a non-physical visual effect by a given angle around a given axis.

{"$type": "rotate_visual_effect_by", "angle": 0.125, "id": 1}
{"$type": "rotate_visual_effect_by", "angle": 0.125, "id": 1, "axis": "yaw", "is_world": True}
ParameterTypeDescriptionDefault
"axis"AxisThe axis of rotation."yaw"
"angle"floatThe angle of rotation.
"is_world"boolIf True, the visual effect will rotate via "global" directions and angles. If False, the visual effect will rotate locally.True
"id"intThe ID of the non-physics object.

Axis

An axis of rotation.

ValueDescription
"pitch"Nod your head "yes".
"yaw"Shake your head "no".
"roll"Put your ear to your shoulder.

rotate_visual_effect_to

Set the rotation of a non-physical visual effect.

{"$type": "rotate_visual_effect_to", "rotation": {"w": 0.6, "x": 3.5, "y": -45, "z": 0}, "id": 1}
ParameterTypeDescriptionDefault
"rotation"QuaternionThe rotation quaternion.
"id"intThe ID of the non-physics object.

scale_visual_effect

Scale a non-physical visual effect by a factor.

{"$type": "scale_visual_effect", "id": 1}
{"$type": "scale_visual_effect", "id": 1, "scale_factor": {"x": 1, "y": 1, "z": 1}}
ParameterTypeDescriptionDefault
"scale_factor"Vector3Multiply the scale of the object by this vector. (For example, if scale_factor is (2,2,2), then the object's current size will double.){"x": 1, "y": 1, "z": 1}
"id"intThe ID of the non-physics object.

teleport_visual_effect

Teleport a non-physical visual effect to a new position.

{"$type": "teleport_visual_effect", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1}
ParameterTypeDescriptionDefault
"position"Vector3The new position of the visual effect.
"id"intThe ID of the non-physics object.

unparent_visual_effect

Unparent a non-physical visual effect from a parent object. If the visual effect doesn't have a parent object, this command doesn't do anything.

{"$type": "unparent_visual_effect", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe ID of the non-physics object.

ObiCommand

These commands are used for aspects of an Obi simulation. There are other Obi-related commands as well; search for "obi" in this document.


create_obi_solver

Create an Obi Solver. The solver has a unique ID that is generated sequentially: The first solver's ID is 0, the second solver's ID is 1, and so on.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "create_obi_solver"}
{"$type": "create_obi_solver", "backend": "burst"}
ParameterTypeDescriptionDefault
"backend"ObiBackendThe backend used for this solver."burst"

ObiBackend

Obi solver backends.

ValueDescription
"burst"The optimized backend. You should almost always use this.
"oni"The unoptimized legacy backend. This should only be used for ongoing projects. It doesn't work on Apple Silicon.

destroy_obi_solver

Destroy an Obi solver.

{"$type": "destroy_obi_solver"}
{"$type": "destroy_obi_solver", "solver_id": 0}
ParameterTypeDescriptionDefault
"solver_id"intThe solver ID.0

set_obi_solver_scale

Set an Obi solver's scale. This will uniformly scale the physical size of the simulation, without affecting its behavior.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "set_obi_solver_scale"}
{"$type": "set_obi_solver_scale", "solver_id": 0, "scale_factor": 1.0}
ParameterTypeDescriptionDefault
"solver_id"intThe solver ID.0
"scale_factor"floatThe factor to scale XYZ by.1.0

set_obi_solver_substeps

Set an Obi solver's number of substeps. Performing more substeps will greatly improve the accuracy/convergence speed of the simulation at the cost of speed.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "set_obi_solver_substeps"}
{"$type": "set_obi_solver_substeps", "solver_id": 0, "substeps": 1}
ParameterTypeDescriptionDefault
"solver_id"intThe solver ID.0
"substeps"intThe number of substeps.1

CreateObiActorCommand

These commands add Obi actor objects to the scene.


create_obi_fluid

Create an Obi fluid. Obi fluids have three components: The emitter, the fluid, and the shape of the emitter.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "create_obi_fluid", "fluid": {'$type': 'fluid', 'capacity': 1500, 'resolution': 1.0, 'color': {'a': 0.5, 'b': 0.15, 'g': 0.986, 'r': 1.0}, 'rest_density': 1000.0, 'radius_scale': 2.0, 'random_velocity': 0.15, 'smoothing': 3.0, 'surface_tension': 1.0, 'viscosity': 1.5, 'vorticity': 0.7, 'reflection': 0.2, 'transparency': 0.875, 'refraction': 0.0, 'buoyancy': -1, 'diffusion': 0, 'diffusion_data': {'w': 0, 'x': 0, 'y': 0, 'z': 0}, 'atmospheric_drag': 0, 'atmospheric_pressure': 0, 'particle_z_write': False, 'thickness_cutoff': 1.2, 'thickness_downsample': 2, 'blur_radius': 0.02, 'surface_downsample': 1, 'render_smoothness': 0.8, 'metalness': 0, 'ambient_multiplier': 1, 'absorption': 5, 'refraction_downsample': 1, 'foam_downsample': 1}, "shape": {'$type': 'cube_emitter', 'size': {'x': 0.1, 'y': 0.1, 'z': 0.1}, 'sampling_method': 'volume'}}
{"$type": "create_obi_fluid", "fluid": {'$type': 'fluid', 'capacity': 1500, 'resolution': 1.0, 'color': {'a': 0.5, 'b': 0.15, 'g': 0.986, 'r': 1.0}, 'rest_density': 1000.0, 'radius_scale': 2.0, 'random_velocity': 0.15, 'smoothing': 3.0, 'surface_tension': 1.0, 'viscosity': 1.5, 'vorticity': 0.7, 'reflection': 0.2, 'transparency': 0.875, 'refraction': 0.0, 'buoyancy': -1, 'diffusion': 0, 'diffusion_data': {'w': 0, 'x': 0, 'y': 0, 'z': 0}, 'atmospheric_drag': 0, 'atmospheric_pressure': 0, 'particle_z_write': False, 'thickness_cutoff': 1.2, 'thickness_downsample': 2, 'blur_radius': 0.02, 'surface_downsample': 1, 'render_smoothness': 0.8, 'metalness': 0, 'ambient_multiplier': 1, 'absorption': 5, 'refraction_downsample': 1, 'foam_downsample': 1}, "shape": {'$type': 'cube_emitter', 'size': {'x': 0.1, 'y': 0.1, 'z': 0.1}, 'sampling_method': 'volume'}, "lifespan": 4, "minimum_pool_size": 0.5, "speed": 0, "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0}, "id": 0, "solver_id": 0}
ParameterTypeDescriptionDefault
"fluid"FluidBaseA ../python/obi_data/fluid.md "Fluid" or ../python/obi_data/granular_fluid.md "GranularFluid"
"shape"EmitterShapeBaseA ../python/obi_data/emitter_shape/cube_emitter.md "CubeEmitter", ../python/obi_data/emitter_shape/disk_emitter.md "DiskEmitter", ../python/obi_data/emitter_shape/edge_emitter.md "EdgeEmitter", or ../python/obi_data/emitter_shape/sphere_emitter.md "SphereEmitter".
"lifespan"floatThe particle lifespan in seconds.4
"minimum_pool_size"floatThe minimum amount of inactive particles available before the emitter is allowed to resume emission.0.5
"speed"floatThe speed of the fluid emission. If 0, there is no emission.0
"position"Vector3The position of the Obi actor.{"x": 0, "y": 0, "z": 0}
"rotation"Vector3The rotation of the Obi actor in Euler angles.{"x": 0, "y": 0, "z": 0}
"id"intThe unique ID of the emitter.0
"solver_id"intThe ID of the Obi solver.0

CreateObiClothCommand

These commands add cloth objects to the scene.


create_obi_cloth_sheet

Create an Obi cloth sheet object.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
  • Requires a material asset bundle: To use this command, you must first download an load a material. Send the add_material command first.
{"$type": "create_obi_cloth_sheet", "sheet_type": "cloth", "cloth_material": {'$type': 'cloth_material', 'visual_material': 'cotton_canvas_washed_out', 'texture_scale': {'x': 4, 'y': 4}, 'visual_smoothness': 0, 'stretching_scale': 1.0, 'stretch_compliance': 0, 'max_compression': 0, 'max_bending': 0.04, 'bend_compliance': 0, 'drag': 0.0, 'lift': 0.0, 'tether_compliance': 0, 'tether_scale': 1.0}}
{"$type": "create_obi_cloth_sheet", "sheet_type": "cloth", "cloth_material": {'$type': 'cloth_material', 'visual_material': 'cotton_canvas_washed_out', 'texture_scale': {'x': 4, 'y': 4}, 'visual_smoothness': 0, 'stretching_scale': 1.0, 'stretch_compliance': 0, 'max_compression': 0, 'max_bending': 0.04, 'bend_compliance': 0, 'drag': 0.0, 'lift': 0.0, 'tether_compliance': 0, 'tether_scale': 1.0}, "tether_positions": {TetherParticleGroup.four_corners: {"object_id": 0, "is_static": True}}, "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0}, "id": 0, "solver_id": 0}
ParameterTypeDescriptionDefault
"sheet_type"ObiClothSheetTypeThe type of cloth sheet to create.
"tether_positions"Dictionary< TetherParticleGroup, TetherType >An dictionary of tether positions. Key = The particle group. Value = The tether position.{TetherParticleGroup.four_corners: {"object_id": 0, "is_static": True}}
"cloth_material"ClothMaterialThe type of cloth "material", as defined by constraint settings.
"position"Vector3The position of the Obi actor.{"x": 0, "y": 0, "z": 0}
"rotation"Vector3The rotation of the Obi actor in Euler angles.{"x": 0, "y": 0, "z": 0}
"id"intThe unique ID of the emitter.0
"solver_id"intThe ID of the Obi solver.0

ObiClothSheetType

The type of Obi cloth sheet to add to the scene.

ValueDescription
"cloth"A low-resolution cloth sheet.
"cloth_hd"A medium-resolution cloth sheet.
"cloth_vhd"A high-resolution cloth sheet.

create_obi_cloth_volume

Create an Obi cloth volume object.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
  • Requires a material asset bundle: To use this command, you must first download an load a material. Send the add_material command first.
{"$type": "create_obi_cloth_volume", "volume_type": "sphere", "cloth_material": {'$type': 'cloth_material', 'visual_material': 'cotton_canvas_washed_out', 'texture_scale': {'x': 4, 'y': 4}, 'visual_smoothness': 0, 'stretching_scale': 1.0, 'stretch_compliance': 0, 'max_compression': 0, 'max_bending': 0.04, 'bend_compliance': 0, 'drag': 0.0, 'lift': 0.0, 'tether_compliance': 0, 'tether_scale': 1.0}}
{"$type": "create_obi_cloth_volume", "volume_type": "sphere", "cloth_material": {'$type': 'cloth_material', 'visual_material': 'cotton_canvas_washed_out', 'texture_scale': {'x': 4, 'y': 4}, 'visual_smoothness': 0, 'stretching_scale': 1.0, 'stretch_compliance': 0, 'max_compression': 0, 'max_bending': 0.04, 'bend_compliance': 0, 'drag': 0.0, 'lift': 0.0, 'tether_compliance': 0, 'tether_scale': 1.0}, "scale_factor": {"x": 0, "y": 0, "z": 0}, "pressure": 0.5, "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0}, "id": 0, "solver_id": 0}
ParameterTypeDescriptionDefault
"scale_factor"Vector3The scale factor of the cloth object.{"x": 0, "y": 0, "z": 0}
"volume_type"ObiClothVolumeTypeThe type of cloth sheet to create.
"pressure"floatThe amount of "inflation" of this cloth volume.0.5
"cloth_material"ClothMaterialThe type of cloth "material", as defined by constraint settings.
"position"Vector3The position of the Obi actor.{"x": 0, "y": 0, "z": 0}
"rotation"Vector3The rotation of the Obi actor in Euler angles.{"x": 0, "y": 0, "z": 0}
"id"intThe unique ID of the emitter.0
"solver_id"intThe ID of the Obi solver.0

ObiClothVolumeType

The type of Obi cloth volume to add to the scene.

ValueDescription
"sphere"
"cube"

ObjectCommand

Manipulate an object that is already in the scene.


add_trigger_collider

Add a trigger collider to an object. Trigger colliders are non-physics colliders that will merely detect if they intersect with something. You can use this to detect whether one object is inside another. The side, position, and rotation of the trigger collider always matches that of the parent object. Per trigger event, the trigger collider will send output data depending on which of the enter, stay, and exit booleans are True.

  • Sends data: This command instructs the build to send output data.

{"$type": "add_trigger_collider", "id": 1}
{"$type": "add_trigger_collider", "id": 1, "shape": "cube", "enter": False, "stay": False, "exit": False, "trigger_id": 0, "scale": {"x": 1, "y": 1, "z": 1}, "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"shape"TriggerShapeThe shape of the collider."cube"
"enter"boolIf True, this collider will listen for enter events.False
"stay"boolIf True, this collider will listen for stay events.False
"exit"boolIf True, this collider will listen for exit events.False
"trigger_id"intThe ID of this trigger collider. This can be used to differentiate between multiple trigger colliders attached to the same object.0
"scale"Vector3The scale of the trigger collider.{"x": 1, "y": 1, "z": 1}
"position"Vector3The position of the trigger collider relative to the parent object.{"x": 0, "y": 0, "z": 0}
"rotation"Vector3The rotation of the trigger collider in Euler angles relative to the parent object.{"x": 0, "y": 0, "z": 0}
"id"intThe unique object ID.

TriggerShape

The shape of the trigger collider.

ValueDescription
"cube"
"sphere"
"cylinder"

clatterize_object

Make an object respond to Clatter audio by setting its audio values and adding a ClatterObject component. You must send ClatterizeObject for each object prior to sending InitializeClatter (though they can all be in the same list of commands).

{"$type": "clatterize_object", "impact_material": "wood_medium", "size": 1, "amp": 0.125, "resonance": 0.125, "fake_mass": 0.125, "id": 1}
{"$type": "clatterize_object", "impact_material": "wood_medium", "size": 1, "amp": 0.125, "resonance": 0.125, "fake_mass": 0.125, "id": 1, "has_scrape_material": False, "scrape_material": "ceramic", "set_fake_mass": False}
ParameterTypeDescriptionDefault
"impact_material"ImpactMaterialUnsizedThe impact material. See: tdw.physics_audio.audio_material (which is the same thing as an impact material).
"size"intThe size bucket value (0-5); smaller objects should use smaller values.
"amp"floatThe audio amplitude (0-1).
"resonance"floatThe resonance value (0-1).
"has_scrape_material"boolIf true, the object has a scrape material.False
"scrape_material"ScrapeMaterialThe object's scrape material. Ignored if has_scrape_material == False. See: tdw.physics_audio.scrape_material"ceramic"
"set_fake_mass"boolIf True, set a fake audio mass (see below).False
"fake_mass"floatIf set_fake_mass == True, this is the fake mass, which will be used for audio synthesis instead of the true mass.
"id"intThe unique object ID.

create_obi_colliders

Create Obi colliders for an object if there aren't any.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "create_obi_colliders", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe unique object ID.

destroy_object

Destroy an object.

  • Expensive: This command is computationally expensive.
  • Cached in memory: When this object is destroyed, the asset bundle remains in memory.If you want to recreate the object, the build will be able to instantiate it more or less instantly. To free up memory, send the command unload_asset_bundles.
{"$type": "destroy_object", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe unique object ID.

enable_nav_mesh_obstacle

Enable or disable an object's NavMeshObstacle. If the object doesn't have a NavMeshObstacle, this command does nothing.

{"$type": "enable_nav_mesh_obstacle", "enable": True, "id": 1}
ParameterTypeDescriptionDefault
"enable"boolIf True, enable the NavMeshObstacle. If False, disable the NavMeshObstacle.
"id"intThe unique object ID.

ignore_collisions

Set whether one object should ignore collisions with another object. By default, objects never ignore any collisions.

{"$type": "ignore_collisions", "other_id": 1, "id": 1}
{"$type": "ignore_collisions", "other_id": 1, "id": 1, "ignore": True}
ParameterTypeDescriptionDefault
"other_id"intThe ID of the other object.
"ignore"boolIf True, ignore collisions with the other object. If False, listen for collisions with the other object.True
"id"intThe unique object ID.

ignore_leap_motion_physics_helpers

Make the object ignore a Leap Motion rig's physics helpers. This is useful for objects that shouldn't be moved, such as kinematic objects.

  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "ignore_leap_motion_physics_helpers", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe unique object ID.

make_nav_mesh_obstacle

Make a specific object a NavMesh obstacle. If it is already a NavMesh obstacle, change its properties. An object is already a NavMesh obstacle if you've sent the bake_nav_mesh or make_nav_mesh_obstacle command.

  • Requires a NavMesh: This command requires a NavMesh.Scenes created via add_scene already have NavMeshes.Proc-gen scenes don't; send bake_nav_mesh to create one.
{"$type": "make_nav_mesh_obstacle", "id": 1}
{"$type": "make_nav_mesh_obstacle", "id": 1, "carve_type": "all", "scale": 1, "shape": "box"}
ParameterTypeDescriptionDefault
"carve_type"CarveTypeHow the object will "carve" holes in the NavMesh."all"
"scale"floatThe scale of the obstacle relative to the size of the object. Set this lower to account for the additional space that the object will carve.1
"shape"CarveShapeThe shape of the carver."box"
"id"intThe unique object ID.

CarveShape

The shape of a NavMesh carver.

ValueDescription
"box"
"capsule"

CarveType

How objects in the scene will "carve" the NavMesh.

ValueDescription
"all"Each object will carve a large hole in the NavMesh. If an object moves, the hole will move too. This is the most performance-intensive option.
"stationary"Each object will initially carve a large hole in the NavMesh. If an objects moves, it won't "re-carve" the NavMesh. A small hole will remain in its original position.
"none"Each object will carve small holes in the NavMesh. If an objects moves, it won't "re-carve" the NavMesh. A small hole will remain in its original position.

object_look_at

Set the object's rotation such that its forward directional vector points towards another object's position.

{"$type": "object_look_at", "other_object_id": 1, "id": 1}
ParameterTypeDescriptionDefault
"other_object_id"intThe ID of the object that this object should look at.
"id"intThe unique object ID.

object_look_at_position

Set the object's rotation such that its forward directional vector points towards another position.

{"$type": "object_look_at_position", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1}
ParameterTypeDescriptionDefault
"position"Vector3The target position that the object will look at.
"id"intThe unique object ID.

parent_object_to_avatar

Parent an object to an avatar. The object won't change its position or rotation relative to the avatar. Only use this command in non-physics simulations.

{"$type": "parent_object_to_avatar", "id": 1}
{"$type": "parent_object_to_avatar", "id": 1, "avatar_id": "a", "sensor": True}
ParameterTypeDescriptionDefault
"avatar_id"stringThe ID of the avatar in the scene."a"
"sensor"boolIf true, parent the object to the camera rather than the root object of the avatar.True
"id"intThe unique object ID.

parent_object_to_object

Parent an object to an object. In a non-physics simulation or on the frame that the two objects are first created, rotating or moving the parent object will rotate or move the child object. In subsequent physics steps, the child will move independently of the parent object (like any object).

{"$type": "parent_object_to_object", "parent_id": 1, "id": 1}
ParameterTypeDescriptionDefault
"parent_id"intThe ID of the parent object in the scene.
"id"intThe unique object ID.

remove_nav_mesh_obstacle

Remove a NavMesh obstacle from an object (see make_nav_mesh_obstacle).

  • Requires a NavMesh: This command requires a NavMesh.Scenes created via add_scene already have NavMeshes.Proc-gen scenes don't; send bake_nav_mesh to create one.
{"$type": "remove_nav_mesh_obstacle", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe unique object ID.

rotate_object_around

Rotate an object by a given angle and axis around a position.

{"$type": "rotate_object_around", "angle": 0.125, "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1}
{"$type": "rotate_object_around", "angle": 0.125, "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "axis": "yaw"}
ParameterTypeDescriptionDefault
"axis"AxisThe axis of rotation."yaw"
"angle"floatThe angle of rotation in degrees.
"position"Vector3Rotate around this position in world space coordinates.
"id"intThe unique object ID.

Axis

An axis of rotation.

ValueDescription
"pitch"Nod your head "yes".
"yaw"Shake your head "no".
"roll"Put your ear to your shoulder.

rotate_object_by

Rotate an object by a given angle around a given axis.

{"$type": "rotate_object_by", "angle": 0.125, "id": 1}
{"$type": "rotate_object_by", "angle": 0.125, "id": 1, "axis": "yaw", "is_world": True, "use_centroid": False}
ParameterTypeDescriptionDefault
"axis"AxisThe axis of rotation."yaw"
"angle"floatThe angle of rotation in degrees.
"is_world"boolIf True, the object will rotate around global axes. If False, the object will around local axes. Ignored if use_centroid == True.True
"use_centroid"boolIf True, rotate around the object's centroid. If False, rotate around the bottom-center position of the object.False
"id"intThe unique object ID.

Axis

An axis of rotation.

ValueDescription
"pitch"Nod your head "yes".
"yaw"Shake your head "no".
"roll"Put your ear to your shoulder.

rotate_object_to

Set the rotation quaternion of the object.

{"$type": "rotate_object_to", "rotation": {"w": 0.6, "x": 3.5, "y": -45, "z": 0}, "id": 1}
{"$type": "rotate_object_to", "rotation": {"w": 0.6, "x": 3.5, "y": -45, "z": 0}, "id": 1, "physics": False, "use_centroid": False}
ParameterTypeDescriptionDefault
"rotation"QuaternionThe rotation quaternion.
"physics"boolThis should almost always be False (the default). If True, apply a "physics-based" rotation to the object. This only works if the object has a rigidbody (i.e. is a model from a model library) and is slightly slower than a non-physics rotation. Set this to True only if you are having persistent and rare physics glitches.False
"use_centroid"boolIf false, rotate around the bottom-center position of the object. If true, rotate around the bottom-center position of the object and then teleport the object to its centroid (such that it rotates around the centroid).False
"id"intThe unique object ID.

rotate_object_to_euler_angles

Set the rotation of the object with Euler angles.

  • Euler angles: Rotational behavior can become unpredictable if the Euler angles of an object are adjusted more than once. Consider sending this command only to initialize the orientation. See: [Rotation documentation)(../misc_frontend/rotation.md)
{"$type": "rotate_object_to_euler_angles", "euler_angles": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1}
{"$type": "rotate_object_to_euler_angles", "euler_angles": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "use_centroid": False}
ParameterTypeDescriptionDefault
"euler_angles"Vector3The new Euler angles of the object.
"use_centroid"boolIf false, rotate around the bottom-center position of the object. If true, rotate around the bottom-center position of the object and then teleport the object to its centroid (such that it rotates around the centroid).False
"id"intThe unique object ID.

scale_object

Scale the object by a factor from its current scale.

{"$type": "scale_object", "id": 1}
{"$type": "scale_object", "id": 1, "scale_factor": {"x": 1, "y": 1, "z": 1}}
ParameterTypeDescriptionDefault
"scale_factor"Vector3Multiply the scale of the object by this vector. (For example, if scale_factor is (2,2,2), then the object's current size will double.){"x": 1, "y": 1, "z": 1}
"id"intThe unique object ID.

scale_object_to

Scale the object to the given value. This is only useful if you know the model scale beforehand, which is not always (1, 1, 1). This command is only useful when used with send_scales, because ObjectScales output data will return the actual scale of each object.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: scale_object
{"$type": "scale_object_to", "id": 1}
{"$type": "scale_object_to", "id": 1, "scale": {"x": 1, "y": 1, "z": 1}}
ParameterTypeDescriptionDefault
"scale"Vector3The object's new scale.{"x": 1, "y": 1, "z": 1}
"id"intThe unique object ID.

set_color

Set the albedo RGBA color of an object.

  • Expensive: This command is computationally expensive.
{"$type": "set_color", "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}, "id": 1}
ParameterTypeDescriptionDefault
"color"ColorThe new albedo RGBA color of the object.
"id"intThe unique object ID.

set_obi_collision_material

Set the Obi collision material of an object.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "set_obi_collision_material", "id": 1}
{"$type": "set_obi_collision_material", "id": 1, "dynamic_friction": 0.3, "static_friction": 0.3, "stickiness": 0, "stick_distance": 0, "friction_combine": "average", "stickiness_combine": "average"}
ParameterTypeDescriptionDefault
"dynamic_friction"floatPercentage of relative tangential velocity removed in a collision, once the static friction threshold has been surpassed and the particle is moving relative to the surface. 0 means things will slide as if made of ice, 1 will result in total loss of tangential velocity.0.3
"static_friction"floatPercentage of relative tangential velocity removed in a collision. 0 means things will slide as if made of ice, 1 will result in total loss of tangential velocity.0.3
"stickiness"floatAmount of inward normal force applied between objects in a collision. 0 means no force will be applied, 1 will keep objects from separating once they collide.0
"stick_distance"floatMaximum distance between objects at which sticky forces are applied. Since contacts will be generated between bodies within the stick distance, it should be kept as small as possible to reduce the amount of contacts generated.0
"friction_combine"MaterialCombineModeHow is the friction coefficient calculated when two objects involved in a collision have different coefficients. If both objects have different friction combine modes, the mode with the lowest enum index is used."average"
"stickiness_combine"MaterialCombineModeHow is the stickiness coefficient calculated when two objects involved in a collision have different coefficients. If both objects have different stickiness combine modes, the mode with the lowest enum index is used."average"
"id"intThe unique object ID.

MaterialCombineMode

Obi collision maerial combine modes.

ValueDescription
"average"
"minimum"
"multiply"
"maximum"

set_object_visibility

Toggle whether an object is visible. An invisible object will still have physics colliders and respond to physics events.

{"$type": "set_object_visibility", "id": 1}
{"$type": "set_object_visibility", "id": 1, "visible": True}
ParameterTypeDescriptionDefault
"visible"boolToggles whether or not the object is visible.True
"id"intThe unique object ID.

set_physic_material

Set the physic material of an object and apply friction and bounciness values to the object. These settings can be overriden by sending the command again, or by assigning a semantic material via set_semantic_material_to.

{"$type": "set_physic_material", "dynamic_friction": 0.125, "static_friction": 0.125, "bounciness": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"dynamic_friction"floatFriction when the object is already moving. A higher value means that the object will come to rest very quickly. Must be between 0 and 1.
"static_friction"floatFriction when the object is not moving. A higher value means that a lot of force will be needed to make the object start moving. Must be between 0 and 1.
"bounciness"floatThe bounciness of the object. A higher value means that the object will bounce without losing much energy. Must be between 0 and 1.
"id"intThe unique object ID.

set_rigidbody_constraints

Set the constraints of an object's Rigidbody.

{"$type": "set_rigidbody_constraints", "id": 1}
{"$type": "set_rigidbody_constraints", "id": 1, "freeze_position_axes": {"x": 0, "y": 0, "z": 0}, "freeze_rotation_axes": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"freeze_position_axes"Vector3IntFreeze motion along these axes. For example, {"x": 0, "y": 1, "z": 0} freezes motion along the Y-axis.{"x": 0, "y": 0, "z": 0}
"freeze_rotation_axes"Vector3IntFreeze rotation along these axes. For example, {"x": 0, "y": 1, "z": 0} freezes rotation around the Y-axis. Rotation axes are in worldspace coordinates, not relative to an object's forward directional vector..{"x": 0, "y": 0, "z": 0}
"id"intThe unique object ID.

set_vr_graspable

Make an object graspable for a VR rig, with Oculus touch controllers. Uses the AutoHand plugin for grasping and physics interaction behavior.

  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "set_vr_graspable", "id": 1}
{"$type": "set_vr_graspable", "id": 1, "joint_break_force": 3500}
ParameterTypeDescriptionDefault
"joint_break_force"floatThe joint break force for this graspable object. Lower values mean it's easier to break the joint.3500
"id"intThe unique object ID.

teleport_object

Teleport an object to a new position.

{"$type": "teleport_object", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1}
{"$type": "teleport_object", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "physics": False, "absolute": True, "use_centroid": False}
ParameterTypeDescriptionDefault
"position"Vector3New position of the object.
"physics"boolThis should almost always be False (the default). If True, apply a "physics-based" teleportation to the object. This only works if the object has a rigidbody (i.e. is a model from a model library) and is slightly slower than a non-physics teleport. Set this to True only if you are having persistent and rare physics glitches.False
"absolute"boolIf True, set the position in world coordinate space. If False, set the position in local coordinate space.True
"use_centroid"boolIf True, teleport from the centroid of the object instead of the pivot.False
"id"intThe unique object ID.

teleport_object_by

Translate an object by an amount, optionally in local or world space.

{"$type": "teleport_object_by", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1}
{"$type": "teleport_object_by", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "absolute": True, "use_centroid": False}
ParameterTypeDescriptionDefault
"position"Vector3The positional offset.
"absolute"boolIf True, set the position in world coordinate space. If False, set the position in local coordinate space.True
"use_centroid"boolIf True, teleport from the centroid of the object instead of the pivot.False
"id"intThe unique object ID.

unparent_object

Unparent an object from an object. If the textured quad doesn't have a parent, this command doesn't do anything.

{"$type": "unparent_object", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe unique object ID.

AddContainerShapeCommand

These commands add container shapes to an object. Container shapes will check each frame for whether their container shapes overlap with other objects and send output data accordingly.


add_box_container

Add a box container shape to an object. The object will send output data whenever other objects overlap with this volume.

  • Sends data: This command instructs the build to send output data.

{"$type": "add_box_container", "tag": "on", "id": 1}
{"$type": "add_box_container", "tag": "on", "id": 1, "half_extents": {"x": 1, "y": 1, "z": 1}, "rotation": {"x": 0, "y": 0, "z": 0}, "container_id": 0, "position": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"half_extents"Vector3The half extents of the box.{"x": 1, "y": 1, "z": 1}
"rotation"Vector3The rotation of the box in Euler angles relative to the parent object.{"x": 0, "y": 0, "z": 0}
"container_id"intThe ID of this container shape. This can be used to differentiate between multiple container shapes belonging to the same object.0
"position"Vector3The position of the container shape relative to the parent object.{"x": 0, "y": 0, "z": 0}
"tag"ContainerTagThe container tag.
"id"intThe unique object ID.

ContainerTag

A tag for a container shape.

ValueDescription
"on"An object on top of a surface, for example a plate on a table.
"inside"An object inside a cavity or basin, for example a toy in a basket or a plate in a sink.
"enclosed"An object inside an enclosed cavity, for example a pan in an oven.

add_cylinder_container

Add a cylindrical container shape to an object. The object will send output data whenever other objects overlap with this volume.

  • Sends data: This command instructs the build to send output data.

{"$type": "add_cylinder_container", "tag": "on", "id": 1}
{"$type": "add_cylinder_container", "tag": "on", "id": 1, "radius": 0.5, "height": 1, "rotation": {"x": 0, "y": 0, "z": 0}, "container_id": 0, "position": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"radius"floatThe radius of the cylinder.0.5
"height"floatThe height of the cylinder.1
"rotation"Vector3The rotation of the cylinder in Euler angles relative to the parent object.{"x": 0, "y": 0, "z": 0}
"container_id"intThe ID of this container shape. This can be used to differentiate between multiple container shapes belonging to the same object.0
"position"Vector3The position of the container shape relative to the parent object.{"x": 0, "y": 0, "z": 0}
"tag"ContainerTagThe container tag.
"id"intThe unique object ID.

ContainerTag

A tag for a container shape.

ValueDescription
"on"An object on top of a surface, for example a plate on a table.
"inside"An object inside a cavity or basin, for example a toy in a basket or a plate in a sink.
"enclosed"An object inside an enclosed cavity, for example a pan in an oven.

add_sphere_container

Add a spherical container shape to an object. The object will send output data whenever other objects overlap with this volume.

  • Sends data: This command instructs the build to send output data.

{"$type": "add_sphere_container", "tag": "on", "id": 1}
{"$type": "add_sphere_container", "tag": "on", "id": 1, "radius": 0.5, "container_id": 0, "position": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"radius"floatThe radius of the sphere.0.5
"container_id"intThe ID of this container shape. This can be used to differentiate between multiple container shapes belonging to the same object.0
"position"Vector3The position of the container shape relative to the parent object.{"x": 0, "y": 0, "z": 0}
"tag"ContainerTagThe container tag.
"id"intThe unique object ID.

ContainerTag

A tag for a container shape.

ValueDescription
"on"An object on top of a surface, for example a plate on a table.
"inside"An object inside a cavity or basin, for example a toy in a basket or a plate in a sink.
"enclosed"An object inside an enclosed cavity, for example a pan in an oven.

EmptyObjectCommand

These commands add or adjust an empty object attached to an object.


attach_empty_object

Attach an empty object to an object in the scene. This is useful for tracking local space positions as the object rotates. See: send_empty_objects

{"$type": "attach_empty_object", "position": {"x": 1.1, "y": 0.0, "z": 0}, "empty_object_id": 1, "id": 1}
ParameterTypeDescriptionDefault
"position"Vector3The position of the empty object relative to the parent object, in the parent object's local coordinate space.
"empty_object_id"intThe ID of the empty object. This doesn't have to be the same as the object ID.
"id"intThe unique object ID.

teleport_empty_object

Teleport an empty object to a new position.

{"$type": "teleport_empty_object", "position": {"x": 1.1, "y": 0.0, "z": 0}, "empty_object_id": 1, "id": 1}
{"$type": "teleport_empty_object", "position": {"x": 1.1, "y": 0.0, "z": 0}, "empty_object_id": 1, "id": 1, "rotation": {"w": 1, "x": 0, "y": 0, "z": 0}, "absolute": True}
ParameterTypeDescriptionDefault
"position"Vector3The location to teleport to.
"rotation"QuaternionThe new local rotation of the empty object.{"w": 1, "x": 0, "y": 0, "z": 0}
"absolute"boolIf True, teleport the empty object in world coordinate space. If False, teleport the empty object in local coordinate space.True
"empty_object_id"intThe ID of the empty object. This doesn't have to be the same as the object ID.
"id"intThe unique object ID.

FlexObjectCommand

These commands apply only to objects that already have FlexActor components.


apply_forces_to_flex_object_base64

Apply a directional force to the FlexActor object.

  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
{"$type": "apply_forces_to_flex_object_base64", "forces_and_ids_base64": "string", "id": 1}
ParameterTypeDescriptionDefault
"forces_and_ids_base64"stringA list of directional forces [x,y,z] and ids of particles to which each force is applied. Format is [[f1_x, f1_y, f1_z, f1_id], [f2_x, f2_y, f2_z, f2_id], ...].
"id"intThe unique object ID.

apply_force_to_flex_object

Apply a directional force to the FlexActor object.

  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
{"$type": "apply_force_to_flex_object", "force": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1}
{"$type": "apply_force_to_flex_object", "force": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "particle": -1}
ParameterTypeDescriptionDefault
"force"Vector3The directional force.
"particle"intThe particle index. Must be smaller than the total number of particles in the Flex actor. If -1, force is applied to all object particles.-1
"id"intThe unique object ID.

assign_flex_container

Assign the FlexContainer of the object.

  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
{"$type": "assign_flex_container", "container_id": 1, "id": 1}
{"$type": "assign_flex_container", "container_id": 1, "id": 1, "fluid_container": False, "fluid_type": "water"}
ParameterTypeDescriptionDefault
"container_id"intThe unique ID of the container.
"fluid_container"boolIs this a fluid container?False
"fluid_type"stringType of fluid to use for this container."water"
"id"intThe unique object ID.

destroy_flex_object

Destroy the Flex object. This will leak memory (due to a bug in the Flex library that we can't fix), but will leak less memory than destroying a Flex-enabled object with destroy_object.

  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
  • Cached in memory: When this object is destroyed, the asset bundle remains in memory.If you want to recreate the object, the build will be able to instantiate it more or less instantly. To free up memory, send the command unload_asset_bundles.
{"$type": "destroy_flex_object", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe unique object ID.

set_flex_object_mass

Set the mass of the Flex object. The mass is distributed equally across all particles. Thus the particle mass equals mass divided by number of particles.

  • Expensive: This command is computationally expensive.
  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
{"$type": "set_flex_object_mass", "mass": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"mass"floatSet the mass of the Flex object to this value.
"id"intThe unique object ID.

set_flex_particles_mass

Set the mass of all particles in the Flex object. Thus, the total object mass equals the number of particles times the particle mass.

  • Expensive: This command is computationally expensive.
  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
{"$type": "set_flex_particles_mass", "mass": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"mass"floatSet the mass of all particles in the Flex object to this value.
"id"intThe unique object ID.

set_flex_particle_fixed

Fix the particle in the Flex object, such that it does not move.

  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
{"$type": "set_flex_particle_fixed", "is_fixed": True, "particle_id": 1, "id": 1}
ParameterTypeDescriptionDefault
"is_fixed"boolSet whether particle is fixed or not.
"particle_id"intThe ID of the particle.
"id"intThe unique object ID.

ObjectTypeCommand

These commands affect only objects of a specific type.


add_constant_force

Add a constant force to an object. Every frame, this force will be applied to the Rigidbody. Unlike other force commands, this command will provide gradual acceleration rather than immediate impulse; it is thus more useful for animation than a deterministic physics simulation.

{"$type": "add_constant_force", "id": 1}
{"$type": "add_constant_force", "id": 1, "force": {"x": 0, "y": 0, "z": 0}, "relative_force": {"x": 0, "y": 0, "z": 0}, "torque": {"x": 0, "y": 0, "z": 0}, "relative_torque": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"force"Vector3The vector of a force to be applied in world space.{"x": 0, "y": 0, "z": 0}
"relative_force"Vector3The vector of a force to be applied in the object's local space.{"x": 0, "y": 0, "z": 0}
"torque"Vector3The vector of a torque, applied in world space.{"x": 0, "y": 0, "z": 0}
"relative_torque"Vector3The vector of a torque, applied in local space.{"x": 0, "y": 0, "z": 0}
"id"intThe unique object ID.

add_fixed_joint

Attach the object to a parent object using a FixedJoint.

{"$type": "add_fixed_joint", "parent_id": 1, "id": 1}
{"$type": "add_fixed_joint", "parent_id": 1, "id": 1, "break_force": -1, "break_torque": -1}
ParameterTypeDescriptionDefault
"parent_id"intThe ID of the parent object.
"break_force"floatThe break force. If -1, defaults to infinity.-1
"break_torque"floatThe break torque. If -1, defaults to infinity.-1
"id"intThe unique object ID.

add_floorplan_flood_buoyancy

Make an object capable of floating in a floorplan-flooded room. This is meant to be used only with the FloorplanFlood add-on.

  • Expensive: This command is computationally expensive.
{"$type": "add_floorplan_flood_buoyancy", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe unique object ID.

apply_force_at_position

Apply a force to an object from a position. From Unity documentation: For realistic effects position should be approximately in the range of the surface of the rigidbody. Note that when position is far away from the center of the rigidbody the applied torque will be unrealistically large.

{"$type": "apply_force_at_position", "id": 1}
{"$type": "apply_force_at_position", "id": 1, "force": {"x": 0, "y": 0, "z": 0}, "position": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"force"Vector3The vector of a force to be applied in world space.{"x": 0, "y": 0, "z": 0}
"position"Vector3The origin of the force in world coordinates.{"x": 0, "y": 0, "z": 0}
"id"intThe unique object ID.

apply_force_magnitude_to_object

Apply a force of a given magnitude along the forward directional vector of the object.

{"$type": "apply_force_magnitude_to_object", "magnitude": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"magnitude"floatThe magnitude of the force.
"id"intThe unique object ID.

apply_force_to_obi_cloth

Apply a uniform force to an Obi cloth actor.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "apply_force_to_obi_cloth", "id": 1}
{"$type": "apply_force_to_obi_cloth", "id": 1, "force": {"x": 0, "y": 0, "z": 0}, "force_mode": "impulse"}
ParameterTypeDescriptionDefault
"force"Vector3The force.{"x": 0, "y": 0, "z": 0}
"force_mode"ForceModeThe force mode."impulse"
"id"intThe unique object ID.

ForceMode

Force modes for Obi actors.

ValueDescription
"force"Add a continuous force to the object, using its mass.
"impulse"Add an instant force impulse to the object, using its mass.
"velocity"Add an instant velocity change to the object, ignoring its mass.
"acceleration"Add a continuous acceleration to the object, ignoring its mass.

apply_force_to_object

Applies a directional force to the object's rigidbody.

{"$type": "apply_force_to_object", "id": 1}
{"$type": "apply_force_to_object", "id": 1, "force": {"x": 0, "y": 0, "z": 1}}
ParameterTypeDescriptionDefault
"force"Vector3The directional force.{"x": 0, "y": 0, "z": 1}
"id"intThe unique object ID.

apply_torque_to_obi_cloth

Apply a uniform torque to an Obi cloth actor.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "apply_torque_to_obi_cloth", "id": 1}
{"$type": "apply_torque_to_obi_cloth", "id": 1, "torque": {"x": 0, "y": 0, "z": 0}, "force_mode": "impulse"}
ParameterTypeDescriptionDefault
"torque"Vector3The torque.{"x": 0, "y": 0, "z": 0}
"force_mode"ForceModeThe force mode."impulse"
"id"intThe unique object ID.

ForceMode

Force modes for Obi actors.

ValueDescription
"force"Add a continuous force to the object, using its mass.
"impulse"Add an instant force impulse to the object, using its mass.
"velocity"Add an instant velocity change to the object, ignoring its mass.
"acceleration"Add a continuous acceleration to the object, ignoring its mass.

apply_torque_to_object

Apply a torque to the object's rigidbody.

{"$type": "apply_torque_to_object", "id": 1}
{"$type": "apply_torque_to_object", "id": 1, "torque": {"x": 1, "y": 1, "z": 1}}
ParameterTypeDescriptionDefault
"torque"Vector3The torque force.{"x": 1, "y": 1, "z": 1}
"id"intThe unique object ID.

scale_object_and_mass

Scale the object by a factor from its current scale. Scale its mass proportionally. This command assumes that a canonical mass has already been set.

{"$type": "scale_object_and_mass", "id": 1}
{"$type": "scale_object_and_mass", "id": 1, "scale_factor": {"x": 1, "y": 1, "z": 1}}
ParameterTypeDescriptionDefault
"scale_factor"Vector3Multiply the scale of the object by this vector. (For example, if scale_factor is (2,2,2), then the object's current size will double.){"x": 1, "y": 1, "z": 1}
"id"intThe unique object ID.

set_angular_velocity

Set an object's angular velocity. This should ONLY be used on the same communicate() call in which the object is created. Otherwise, sending this command can cause physics glitches.

{"$type": "set_angular_velocity", "id": 1}
{"$type": "set_angular_velocity", "id": 1, "velocity": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"velocity"Vector3The angular velocity in radians per second.{"x": 0, "y": 0, "z": 0}
"id"intThe unique object ID.

set_color_in_substructure

Set the color of a specific child object in the model's substructure. See: ModelRecord.substructure in the ModelLibrarian API.

{"$type": "set_color_in_substructure", "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}, "object_name": "string", "id": 1}
ParameterTypeDescriptionDefault
"color"ColorSet the object to this color.
"object_name"stringThe name of the sub-object.
"id"intThe unique object ID.

set_composite_object_kinematic_state

Set the top-level Rigidbody of a composite object to be kinematic or not. Optionally, set the same state for all of its sub-objects. A kinematic object won't respond to PhysX physics.

{"$type": "set_composite_object_kinematic_state", "id": 1}
{"$type": "set_composite_object_kinematic_state", "id": 1, "is_kinematic": False, "use_gravity": False, "sub_objects": False}
ParameterTypeDescriptionDefault
"is_kinematic"boolIf True, the top-level Rigidbody will be kinematic, and won't respond to physics.False
"use_gravity"boolIf True, the top-level object will respond to gravity.False
"sub_objects"boolIf True, apply the values for is_kinematic and use_gravity to each of the composite object's sub-objects.False
"id"intThe unique object ID.

set_kinematic_state

Set an object's Rigidbody to be kinematic or not. A kinematic object won't respond to PhysX physics.

{"$type": "set_kinematic_state", "id": 1}
{"$type": "set_kinematic_state", "id": 1, "is_kinematic": False, "use_gravity": False}
ParameterTypeDescriptionDefault
"is_kinematic"boolIf True, the Rigidbody will be kinematic, and won't respond to physics.False
"use_gravity"boolIf True, the object will respond to gravity.False
"id"intThe unique object ID.

set_mass

Set the mass of an object.

{"$type": "set_mass", "mass": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"mass"floatThe new mass of the object.
"id"intThe unique object ID.

set_object_collision_detection_mode

Set the collision mode of an objects's Rigidbody. This doesn't need to be sent continuously, but does need to be sent per object.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.
{"$type": "set_object_collision_detection_mode", "id": 1}
{"$type": "set_object_collision_detection_mode", "id": 1, "mode": "continuous_dynamic"}
ParameterTypeDescriptionDefault
"mode"DetectionModeThe collision detection mode."continuous_dynamic"
"id"intThe unique object ID.

DetectionMode

The detection mode.

ValueDescription
"continuous_dynamic"(From Unity documentation:) Prevent this Rigidbody from passing through static mesh geometry, and through other Rigidbodies which have continuous collision detection enabled, when it is moving fast. This is the slowest collision detection mode, and should only be used for selected fast moving objects.
"continuous_speculative"(From Unity documentation:) This is a collision detection mode that can be used on both dynamic and kinematic objects. It is generally cheaper than other CCD modes. It also handles angular motion much better. However, in some cases, high speed objects may still tunneling through other geometries.
"discrete"(From Unity documentation: This is the fastest mode.)
"continuous"(From Unity documentation: Collisions will be detected for any static mesh geometry in the path of this Rigidbody, even if the collision occurs between two FixedUpdate steps. Static mesh geometry is any MeshCollider which does not have a Rigidbody attached. This also prevent Rigidbodies set to ContinuousDynamic mode from passing through this Rigidbody.

set_object_drag

Set the drag of an object's RigidBody. Both drag and angular_drag can be safely changed on-the-fly.

{"$type": "set_object_drag", "id": 1}
{"$type": "set_object_drag", "id": 1, "drag": 0, "angular_drag": 0.05}
ParameterTypeDescriptionDefault
"drag"floatSet the drag of the object's Rigidbody. A higher drag value will cause the object to slow down faster.0
"angular_drag"floatSet the angular drag of the object's Rigidbody. A higher angular drag will cause the object's rotation to slow down faster.0.05
"id"intThe unique object ID.

set_object_physics_solver_iterations

Set the physics solver iterations for an object, which affects its overall accuracy of the physics engine. See also: set_physics_solver_iterations which sets the global default number of solver iterations.

{"$type": "set_object_physics_solver_iterations", "id": 1}
{"$type": "set_object_physics_solver_iterations", "id": 1, "iterations": 12}
ParameterTypeDescriptionDefault
"iterations"intNumber of physics solver iterations. A higher number means better physics accuracy and somewhat reduced framerate.12
"id"intThe unique object ID.

set_primitive_visual_material

Set the material of an object created via load_primitive_from_resources

  • Requires a material asset bundle: To use this command, you must first download an load a material. Send the add_material command first.
{"$type": "set_primitive_visual_material", "name": "string", "id": 1}
ParameterTypeDescriptionDefault
"name"stringThe name of the material.
"id"intThe unique object ID.

set_semantic_material_to

Sets or creates the semantic material category of an object.

  • Expensive: This command is computationally expensive.
{"$type": "set_semantic_material_to", "material_type": "Ceramic", "id": 1}
ParameterTypeDescriptionDefault
"material_type"SemanticMaterialTypeThe semantic material type.
"id"intThe unique object ID.

SemanticMaterialType

An enum value representation of a semantic material category.

ValueDescription
"Ceramic"
"Concrete"
"Wood"
"Plastic"
"Metal"
"Stone"
"Fabric"
"Leather"
"Rubber"
"Paper"
"Organic"
"Glass"
"undefined"Never assign a semantic material to this type!

set_sub_object_id

Set the ID of a composite sub-object. This can be useful when loading saved data that contains sub-object IDs. Note that the id parameter is for the parent object, not the sub-object. The sub-object is located via sub_object_name. Accordingly, this command only works when all of the names of a composite object's sub-objects are unique.

  • Deprecated: This command has been deprecated. In the next major TDW update (1.x.0), this command will be removed.
{"$type": "set_sub_object_id", "sub_object_name": "string", "sub_object_id": 1, "id": 1}
ParameterTypeDescriptionDefault
"sub_object_name"stringThe expected name of the sub-object.
"sub_object_id"intThe new ID of the sub-object.
"id"intThe unique object ID.

set_velocity

Set an object's velocity. This should ONLY be used on the same communicate() call in which the object is created. Otherwise, sending this command can cause physics glitches.

{"$type": "set_velocity", "id": 1}
{"$type": "set_velocity", "id": 1, "velocity": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"velocity"Vector3The velocity in meters per second.{"x": 0, "y": 0, "z": 0}
"id"intThe unique object ID.

show_collider_hulls

Show the collider hulls of the object.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.
{"$type": "show_collider_hulls", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe unique object ID.

DroneCommand

These commands affect a drone currently in the scene.


apply_drone_drive

Fly a drone forwards or backwards, based on an input force value. Positive values fly forwards, negative values fly backwards. Zero value hovers drone.

{"$type": "apply_drone_drive", "id": 1}
{"$type": "apply_drone_drive", "id": 1, "force": 0}
ParameterTypeDescriptionDefault
"force"intThe force value. Must be -1, 0, or 1.0
"id"intThe unique object ID.

apply_drone_lift

Control the drone's elevation above the ground. Positive numbers cause the drone to rise, negative numbers cause it to descend. A zero value will cause it to maintain its current elevation.

{"$type": "apply_drone_lift", "id": 1}
{"$type": "apply_drone_lift", "id": 1, "force": 0}
ParameterTypeDescriptionDefault
"force"intThe force value. Must be -1, 0, or 1.0
"id"intThe unique object ID.

apply_drone_turn

Turn a drone left or right, based on an input force value. Positive values turn right, negative values turn left. Zero value flies straight.

{"$type": "apply_drone_turn", "id": 1}
{"$type": "apply_drone_turn", "id": 1, "force": 0}
ParameterTypeDescriptionDefault
"force"intThe force value. Must be -1, 0, or 1.0
"id"intThe unique object ID.

parent_avatar_to_drone

Parent an avatar to a drone. Usually you'll want to do this to add a camera to the drone.

{"$type": "parent_avatar_to_drone", "id": 1}
{"$type": "parent_avatar_to_drone", "id": 1, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"avatar_id"stringThe ID of the avatar. It must already exist in the scene."a"
"id"intThe unique object ID.

set_drone_motor

Turns the drone's motor on or off.

{"$type": "set_drone_motor", "id": 1}
{"$type": "set_drone_motor", "id": 1, "motor_on": True}
ParameterTypeDescriptionDefault
"motor_on"boolToggles whether the motor is on.True
"id"intThe unique object ID.

set_drone_speed

Set the forward and/or backward speed of the drone.

{"$type": "set_drone_speed", "id": 1}
{"$type": "set_drone_speed", "id": 1, "forward_speed": 3.0, "backward_speed": 3.0}
ParameterTypeDescriptionDefault
"forward_speed"floatThe drone's max forward speed.3.0
"backward_speed"floatThe drone's max backward speed.3.0
"id"intThe unique object ID.

HumanoidCommand

These commands affect humanoids currently in the scene. To add a humanoid, see add_humanoid in the Command API.


destroy_humanoid

Destroy a humanoid.

  • Cached in memory: When this object is destroyed, the asset bundle remains in memory.If you want to recreate the object, the build will be able to instantiate it more or less instantly. To free up memory, send the command unload_asset_bundles.
{"$type": "destroy_humanoid", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe unique object ID.

play_humanoid_animation

Play a motion capture animation on a humanoid. The animation must already be in memory via the add_humanoid_animation command.

{"$type": "play_humanoid_animation", "name": "string", "id": 1}
{"$type": "play_humanoid_animation", "name": "string", "id": 1, "framerate": -1, "forward": True}
ParameterTypeDescriptionDefault
"name"stringThe name of the animation clip to play.
"framerate"intIf greater than zero, play the animation at this framerate instead of the animation's framerate.-1
"forward"boolIf True, play the animation normally. If False, play the naimation in reverse.True
"id"intThe unique object ID.

stop_humanoid_animation

Stop a motion capture animation on a humanoid.

{"$type": "stop_humanoid_animation", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe unique object ID.

ObiActorCommand

These commands affect Obi actors in the scene.


rotate_obi_actor_by

Rotate an Obi actor by a given angle around a given axis.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "rotate_obi_actor_by", "angle": 0.125, "id": 1}
{"$type": "rotate_obi_actor_by", "angle": 0.125, "id": 1, "axis": "yaw", "is_world": True}
ParameterTypeDescriptionDefault
"axis"AxisThe axis of rotation."yaw"
"angle"floatThe angle of rotation in degrees.
"is_world"boolIf True, the object will rotate around global axes. If False, the object will around local axes. Ignored if use_centroid == False.True
"id"intThe unique object ID.

Axis

An axis of rotation.

ValueDescription
"pitch"Nod your head "yes".
"yaw"Shake your head "no".
"roll"Put your ear to your shoulder.

rotate_obi_actor_to

Set an Obi actor's rotation.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "rotate_obi_actor_to", "rotation": {"w": 0.6, "x": 3.5, "y": -45, "z": 0}, "id": 1}
ParameterTypeDescriptionDefault
"rotation"QuaternionThe rotation.
"id"intThe unique object ID.

teleport_obi_actor

Teleport an Obi actor to a new position.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "teleport_obi_actor", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1}
ParameterTypeDescriptionDefault
"position"Vector3The position.
"id"intThe unique object ID.

untether_obi_cloth_sheet

Untether a cloth sheet at a specified position.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "untether_obi_cloth_sheet", "tether_position": "four_corners", "id": 1}
ParameterTypeDescriptionDefault
"tether_position"TetherParticleGroupThe position that will be un-tethered.
"id"intThe unique object ID.

TetherParticleGroup

A group of particles from which an Obi cloth sheet can be tethered to another object. All directions are from the vantage point of looking down at a sheet spread out on the floor.

ValueDescription
"four_corners"
"north_corners"
"south_corners"
"east_corners"
"west_corners"
"north_edge"
"south_edge"
"east_edge"
"west_edge"
"center"

ObiFluidCommand

These commands affect and Obi fluid actor in the scene.


set_obi_fluid_capacity

Set a fluid emitter's particle capacity.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "set_obi_fluid_capacity", "capacity": 1000, "id": 1}
ParameterTypeDescriptionDefault
"capacity"uintThe maximum amount of emitted particles.
"id"intThe unique object ID.

set_obi_fluid_emission_speed

Set the emission speed of a fluid emitter. Larger values will cause more particles to be emitted.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "set_obi_fluid_emission_speed", "id": 1}
{"$type": "set_obi_fluid_emission_speed", "id": 1, "speed": 0}
ParameterTypeDescriptionDefault
"speed"floatThe speed of emitted particles in meters per second. Set this to 0 to stop emission.0
"id"intThe unique object ID.

set_obi_fluid_lifespan

Set a fluid emitter's particle lifespan.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "set_obi_fluid_lifespan", "id": 1}
{"$type": "set_obi_fluid_lifespan", "id": 1, "lifespan": 4}
ParameterTypeDescriptionDefault
"lifespan"floatThe particle lifespan in seconds.4
"id"intThe unique object ID.

set_obi_fluid_random_velocity

Set a fluid emitter's random velocity.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "set_obi_fluid_random_velocity", "id": 1}
{"$type": "set_obi_fluid_random_velocity", "id": 1, "random_velocity": 0}
ParameterTypeDescriptionDefault
"random_velocity"floatRandom velocity of emitted particles.0
"id"intThe unique object ID.

set_obi_fluid_resolution

Set a fluid emitter's resolution.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "set_obi_fluid_resolution", "resolution": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"resolution"floatThe size and amount of particles in 1 cubic meter. A value of 1 will use 1000 particles per cubic meter.
"id"intThe unique object ID.

ObiFluidFluidCommand

These (admittedly awkwardly-named) commands affect an Obi fluid emitter's fluid. They can't be used if the emitter has a granular fluid.


set_obi_fluid_smoothing

Set a fluid's smoothing value.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "set_obi_fluid_smoothing", "smoothing": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"smoothing"floatA percentage of the particle radius used to define the radius of the zone around each particle when calculating fluid density. Larger values will create smoother fluids, which are also less performant.
"id"intThe unique object ID.

set_obi_fluid_vorticity

Set a fluid's vorticity.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "set_obi_fluid_vorticity", "vorticity": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"vorticity"floatAmount of vorticity confinement, it will contribute to maintain vortical details in the fluid. This value should always be between approximately 0 and 0.5.
"id"intThe unique object ID.

ReplicantBaseCommand

These commands affect a Replicant currently in the scene.


parent_avatar_to_replicant

Parent an avatar to a Replicant. The avatar's position and rotation will always be relative to the Replicant's head. Usually you'll want to do this to add a camera to the Replicant.

{"$type": "parent_avatar_to_replicant", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1}
{"$type": "parent_avatar_to_replicant", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "avatar_id": "a"}
ParameterTypeDescriptionDefault
"avatar_id"stringThe ID of the avatar. It must already exist in the scene."a"
"position"Vector3The position of the avatar relative to the Replicant's head.
"id"intThe unique object ID.

replicant_resolve_collider_intersections

Try to resolve intersections between the Replicant's colliders and any other colliders. If there are other objects intersecting with the Replicant, the objects will be moved away along a given directional vector.

{"$type": "replicant_resolve_collider_intersections", "direction": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1}
ParameterTypeDescriptionDefault
"direction"Vector3The direction along which objects should be moved.
"id"intThe unique object ID.

replicant_step

Advance the Replicant's IK solvers by 1 frame.

{"$type": "replicant_step", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe unique object ID.

ReplicantBaseArmCommand

These commands involve a Replicant's arm.


replicant_drop_object

Drop a held object.

  • Replicant status: This command will sometimes set the action status of the Replicant in the Replicant output data. This is usually desirable. In some cases, namely when you're calling several of these commands in sequence, you might want only the last command to set the status. See the set_status parameter, below.
{"$type": "replicant_drop_object", "arm": "left", "id": 1}
{"$type": "replicant_drop_object", "arm": "left", "id": 1, "offset_distance": 0.1, "set_status": True}
ParameterTypeDescriptionDefault
"offset_distance"floatPrior to being dropped, the object will be moved by this distance along its forward directional vector.0.1
"set_status"boolIf True, when this command ends, it will set the Replicant output data's status.True
"arm"ArmThe arm doing the action.
"id"intThe unique object ID.

Arm

A left or right arm.

ValueDescription
"left"
"right"

replicant_grasp_object

Grasp a target object.

  • Replicant status: This command will sometimes set the action status of the Replicant in the Replicant output data. This is usually desirable. In some cases, namely when you're calling several of these commands in sequence, you might want only the last command to set the status. See the set_status parameter, below.
{"$type": "replicant_grasp_object", "object_id": 1, "offset": 0.125, "arm": "left", "id": 1}
{"$type": "replicant_grasp_object", "object_id": 1, "offset": 0.125, "arm": "left", "id": 1, "set_status": True}
ParameterTypeDescriptionDefault
"object_id"intThe target object ID.
"set_status"boolIf True, when this command ends, it will set the Replicant output data's status.True
"offset"floatOffset the object from the hand by this distance.
"arm"ArmThe arm doing the action.
"id"intThe unique object ID.

Arm

A left or right arm.

ValueDescription
"left"
"right"

replicant_set_grasped_object_rotation

Start to rotate a grasped object relative to the rotation of the hand. This will update per communicate() call until the object is dropped.

  • Replicant status: This command will sometimes set the action status of the Replicant in the Replicant output data. This is usually desirable. In some cases, namely when you're calling several of these commands in sequence, you might want only the last command to set the status. See the set_status parameter, below.
{"$type": "replicant_set_grasped_object_rotation", "angle": 0.125, "axis": "pitch", "arm": "left", "id": 1}
{"$type": "replicant_set_grasped_object_rotation", "angle": 0.125, "axis": "pitch", "arm": "left", "id": 1, "relative_to_hand": True, "set_status": True}
ParameterTypeDescriptionDefault
"angle"floatRotate the object by this many degrees relative to the hand's rotation.
"axis"AxisRotate the object around this axis relative to the hand's rotation.
"relative_to_hand"boolIf True, rotate the object relative to the hand that is holding it. If false, rotate relative to the Replicant.True
"set_status"boolIf True, when this command ends, it will set the Replicant output data's status.True
"arm"ArmThe arm doing the action.
"id"intThe unique object ID.

Arm

A left or right arm.

ValueDescription
"left"
"right"

Axis

An axis of rotation.

ValueDescription
"pitch"Nod your head "yes".
"yaw"Shake your head "no".
"roll"Put your ear to your shoulder.

ReplicantArmCommand

These commands involve a Replicant's arm.

ReplicantArmMotionCommand

These commands involve the motion of a Replicant's arm.


replicant_reset_arm

Tell the Replicant to start to reset the arm to its neutral position.

  • Replicant motion: This tells the Replicant to begin a motion. The Replicant will continue the motion per communicate() call until the motion is complete.
  • Replicant status: This command will sometimes set the action status of the Replicant in the Replicant output data. This is usually desirable. In some cases, namely when you're calling several of these commands in sequence, you might want only the last command to set the status. See the set_status parameter, below.
{"$type": "replicant_reset_arm", "duration": 0.125, "arm": "left", "id": 1}
{"$type": "replicant_reset_arm", "duration": 0.125, "arm": "left", "id": 1, "set_status": True}
ParameterTypeDescriptionDefault
"set_status"boolIf True, when this command ends, it will set the Replicant output data's status.True
"duration"floatThe duration of the motion in seconds.
"arm"ArmThe arm doing the action.
"id"intThe unique object ID.

Arm

A left or right arm.

ValueDescription
"left"
"right"

ReplicantReachForCommand

These commands instruct a replicant to start to reach for a target.


replicant_reach_for_object

Tell the Replicant to start to reach for a target object. The Replicant will try to reach for the nearest empty object attached to the target. If there aren't any empty objects, the Replicant will reach for the nearest bounds position.

  • Replicant motion: This tells the Replicant to begin a motion. The Replicant will continue the motion per communicate() call until the motion is complete.
  • Replicant status: This command will sometimes set the action status of the Replicant in the Replicant output data. This is usually desirable. In some cases, namely when you're calling several of these commands in sequence, you might want only the last command to set the status. See the set_status parameter, below.
{"$type": "replicant_reach_for_object", "object_id": 1, "duration": 0.125, "arm": "left", "id": 1}
{"$type": "replicant_reach_for_object", "object_id": 1, "duration": 0.125, "arm": "left", "id": 1, "max_distance": 1.5, "arrived_at": 0.02, "set_status": True, "offset": {"x": 0, "y": 0, "z": 0}, "offhand_follows": False}
ParameterTypeDescriptionDefault
"object_id"intThe target object ID.
"max_distance"floatThe maximum distance that the Replicant can reach.1.5
"arrived_at"floatIf the hand is this distance from the target position or less, the action succeeded.0.02
"set_status"boolIf True, when this command ends, it will set the Replicant output data's status.True
"offset"Vector3This offset will be applied to the target position.{"x": 0, "y": 0, "z": 0}
"offhand_follows"boolIf True, the offhand will follow the primary hand, meaning that it will maintain the same relative position.False
"duration"floatThe duration of the motion in seconds.
"arm"ArmThe arm doing the action.
"id"intThe unique object ID.

Arm

A left or right arm.

ValueDescription
"left"
"right"

replicant_reach_for_position

Tell a Replicant to start to reach for a target position.

  • Replicant motion: This tells the Replicant to begin a motion. The Replicant will continue the motion per communicate() call until the motion is complete.
  • Replicant status: This command will sometimes set the action status of the Replicant in the Replicant output data. This is usually desirable. In some cases, namely when you're calling several of these commands in sequence, you might want only the last command to set the status. See the set_status parameter, below.
{"$type": "replicant_reach_for_position", "position": {"x": 1.1, "y": 0.0, "z": 0}, "duration": 0.125, "arm": "left", "id": 1}
{"$type": "replicant_reach_for_position", "position": {"x": 1.1, "y": 0.0, "z": 0}, "duration": 0.125, "arm": "left", "id": 1, "max_distance": 1.5, "arrived_at": 0.02, "set_status": True, "offset": {"x": 0, "y": 0, "z": 0}, "offhand_follows": False}
ParameterTypeDescriptionDefault
"position"Vector3The target position.
"max_distance"floatThe maximum distance that the Replicant can reach.1.5
"arrived_at"floatIf the hand is this distance from the target position or less, the action succeeded.0.02
"set_status"boolIf True, when this command ends, it will set the Replicant output data's status.True
"offset"Vector3This offset will be applied to the target position.{"x": 0, "y": 0, "z": 0}
"offhand_follows"boolIf True, the offhand will follow the primary hand, meaning that it will maintain the same relative position.False
"duration"floatThe duration of the motion in seconds.
"arm"ArmThe arm doing the action.
"id"intThe unique object ID.

Arm

A left or right arm.

ValueDescription
"left"
"right"

replicant_reach_for_relative_position

Instruct a Replicant to start to reach for a target position relative to the Replicant.

  • Replicant motion: This tells the Replicant to begin a motion. The Replicant will continue the motion per communicate() call until the motion is complete.
  • Replicant status: This command will sometimes set the action status of the Replicant in the Replicant output data. This is usually desirable. In some cases, namely when you're calling several of these commands in sequence, you might want only the last command to set the status. See the set_status parameter, below.
{"$type": "replicant_reach_for_relative_position", "position": {"x": 1.1, "y": 0.0, "z": 0}, "duration": 0.125, "arm": "left", "id": 1}
{"$type": "replicant_reach_for_relative_position", "position": {"x": 1.1, "y": 0.0, "z": 0}, "duration": 0.125, "arm": "left", "id": 1, "max_distance": 1.5, "arrived_at": 0.02, "set_status": True, "offset": {"x": 0, "y": 0, "z": 0}, "offhand_follows": False}
ParameterTypeDescriptionDefault
"position"Vector3The target position relative to the Replicant.
"max_distance"floatThe maximum distance that the Replicant can reach.1.5
"arrived_at"floatIf the hand is this distance from the target position or less, the action succeeded.0.02
"set_status"boolIf True, when this command ends, it will set the Replicant output data's status.True
"offset"Vector3This offset will be applied to the target position.{"x": 0, "y": 0, "z": 0}
"offhand_follows"boolIf True, the offhand will follow the primary hand, meaning that it will maintain the same relative position.False
"duration"floatThe duration of the motion in seconds.
"arm"ArmThe arm doing the action.
"id"intThe unique object ID.

Arm

A left or right arm.

ValueDescription
"left"
"right"

WheelchairReplicantArmCommand

These commands involve a WheelchairReplicant's arm.

WheelchairReplicantReachForCommand

These commands instruct a replicant to start to reach for a target.


wheelchair_replicant_reach_for_object

Tell a WheelchairReplicant to start to reach for a target object. The WheelchairReplicant will try to reach for the nearest empty object attached to the target. If there aren't any empty objects, the Replicant will reach for the nearest bounds position.

  • Replicant motion: This tells the Replicant to begin a motion. The Replicant will continue the motion per communicate() call until the motion is complete.
  • Replicant status: This command will sometimes set the action status of the Replicant in the Replicant output data. This is usually desirable. In some cases, namely when you're calling several of these commands in sequence, you might want only the last command to set the status. See the set_status parameter, below.
{"$type": "wheelchair_replicant_reach_for_object", "object_id": 1, "duration": 0.125, "arm": "left", "id": 1}
{"$type": "wheelchair_replicant_reach_for_object", "object_id": 1, "duration": 0.125, "arm": "left", "id": 1, "max_distance": 1.5, "arrived_at": 0.02, "set_status": True, "offset": {"x": 0, "y": 0, "z": 0}, "offhand_follows": False}
ParameterTypeDescriptionDefault
"object_id"intThe target object ID.
"max_distance"floatThe maximum distance that the Replicant can reach.1.5
"arrived_at"floatIf the hand is this distance from the target position or less, the action succeeded.0.02
"set_status"boolIf True, when this command ends, it will set the Replicant output data's status.True
"offset"Vector3This offset will be applied to the target position.{"x": 0, "y": 0, "z": 0}
"duration"floatThe duration of the motion in seconds.
"offhand_follows"boolIf True, the offhand will follow the primary hand, meaning that it will maintain the same relative position.False
"arm"ArmThe arm doing the action.
"id"intThe unique object ID.

Arm

A left or right arm.

ValueDescription
"left"
"right"

wheelchair_replicant_reach_for_position

Tell a WheelchairReplicant to start to reach for a target position.

  • Replicant motion: This tells the Replicant to begin a motion. The Replicant will continue the motion per communicate() call until the motion is complete.
  • Replicant status: This command will sometimes set the action status of the Replicant in the Replicant output data. This is usually desirable. In some cases, namely when you're calling several of these commands in sequence, you might want only the last command to set the status. See the set_status parameter, below.
{"$type": "wheelchair_replicant_reach_for_position", "position": {"x": 1.1, "y": 0.0, "z": 0}, "absolute": True, "duration": 0.125, "arm": "left", "id": 1}
{"$type": "wheelchair_replicant_reach_for_position", "position": {"x": 1.1, "y": 0.0, "z": 0}, "absolute": True, "duration": 0.125, "arm": "left", "id": 1, "max_distance": 1.5, "arrived_at": 0.02, "set_status": True, "offset": {"x": 0, "y": 0, "z": 0}, "offhand_follows": False}
ParameterTypeDescriptionDefault
"position"Vector3The target position.
"absolute"boolIf True, the target position is in absolute world space coordinates. If False, it's in local space coordinates.
"max_distance"floatThe maximum distance that the Replicant can reach.1.5
"arrived_at"floatIf the hand is this distance from the target position or less, the action succeeded.0.02
"set_status"boolIf True, when this command ends, it will set the Replicant output data's status.True
"offset"Vector3This offset will be applied to the target position.{"x": 0, "y": 0, "z": 0}
"duration"floatThe duration of the motion in seconds.
"offhand_follows"boolIf True, the offhand will follow the primary hand, meaning that it will maintain the same relative position.False
"arm"ArmThe arm doing the action.
"id"intThe unique object ID.

Arm

A left or right arm.

ValueDescription
"left"
"right"

wheelchair_replicant_reset_arm

Tell a WheelchairReplicant to start to reset the arm to its neutral position.

  • Replicant motion: This tells the Replicant to begin a motion. The Replicant will continue the motion per communicate() call until the motion is complete.
  • Replicant status: This command will sometimes set the action status of the Replicant in the Replicant output data. This is usually desirable. In some cases, namely when you're calling several of these commands in sequence, you might want only the last command to set the status. See the set_status parameter, below.
{"$type": "wheelchair_replicant_reset_arm", "duration": 0.125, "arm": "left", "id": 1}
{"$type": "wheelchair_replicant_reset_arm", "duration": 0.125, "arm": "left", "id": 1, "max_distance": 1.5, "arrived_at": 0.02, "set_status": True, "offset": {"x": 0, "y": 0, "z": 0}, "offhand_follows": False}
ParameterTypeDescriptionDefault
"max_distance"floatThe maximum distance that the Replicant can reach.1.5
"arrived_at"floatIf the hand is this distance from the target position or less, the action succeeded.0.02
"set_status"boolIf True, when this command ends, it will set the Replicant output data's status.True
"offset"Vector3This offset will be applied to the target position.{"x": 0, "y": 0, "z": 0}
"duration"floatThe duration of the motion in seconds.
"offhand_follows"boolIf True, the offhand will follow the primary hand, meaning that it will maintain the same relative position.False
"arm"ArmThe arm doing the action.
"id"intThe unique object ID.

Arm

A left or right arm.

ValueDescription
"left"
"right"

ReplicantLookAtCommand

These commands tell a Replicant to look at a target position or object.


replicant_look_at_object

Tell the Replicant to start to look at an object.

  • Replicant motion: This tells the Replicant to begin a motion. The Replicant will continue the motion per communicate() call until the motion is complete.
  • Replicant status: This command will sometimes set the action status of the Replicant in the Replicant output data. This is usually desirable. In some cases, namely when you're calling several of these commands in sequence, you might want only the last command to set the status. See the set_status parameter, below.
{"$type": "replicant_look_at_object", "object_id": 1, "id": 1}
{"$type": "replicant_look_at_object", "object_id": 1, "id": 1, "use_centroid": True, "duration": 0.1, "set_status": True}
ParameterTypeDescriptionDefault
"object_id"intThe ID of the target object.
"use_centroid"boolIf True, look at the centroid of the object. If False, look at the position of the object (y=0).True
"duration"floatThe duration of the motion.0.1
"set_status"boolIf True, when this command ends, it will set the Replicant output data's status.True
"id"intThe unique object ID.

replicant_look_at_position

Tell the Replicant to start to look at a position.

  • Replicant motion: This tells the Replicant to begin a motion. The Replicant will continue the motion per communicate() call until the motion is complete.
  • Replicant status: This command will sometimes set the action status of the Replicant in the Replicant output data. This is usually desirable. In some cases, namely when you're calling several of these commands in sequence, you might want only the last command to set the status. See the set_status parameter, below.
{"$type": "replicant_look_at_position", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1}
{"$type": "replicant_look_at_position", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "duration": 0.1, "set_status": True}
ParameterTypeDescriptionDefault
"position"Vector3The position.
"duration"floatThe duration of the motion.0.1
"set_status"boolIf True, when this command ends, it will set the Replicant output data's status.True
"id"intThe unique object ID.

replicant_reset_head

Tell the Replicant to start to reset its head to its neutral position.

  • Replicant motion: This tells the Replicant to begin a motion. The Replicant will continue the motion per communicate() call until the motion is complete.
  • Replicant status: This command will sometimes set the action status of the Replicant in the Replicant output data. This is usually desirable. In some cases, namely when you're calling several of these commands in sequence, you might want only the last command to set the status. See the set_status parameter, below.
{"$type": "replicant_reset_head", "id": 1}
{"$type": "replicant_reset_head", "id": 1, "duration": 0.1, "set_status": True}
ParameterTypeDescriptionDefault
"duration"floatThe duration of the motion.0.1
"set_status"boolIf True, when this command ends, it will set the Replicant output data's status.True
"id"intThe unique object ID.

replicant_rotate_head_by

Rotate the Replicant's head by an angle around an axis.

{"$type": "replicant_rotate_head_by", "angle": 0.125, "id": 1}
{"$type": "replicant_rotate_head_by", "angle": 0.125, "id": 1, "axis": "yaw", "duration": 0.1, "set_status": True}
ParameterTypeDescriptionDefault
"axis"AxisThe axis of rotation."yaw"
"angle"floatThe angle of rotation in degrees.
"duration"floatThe duration of the motion.0.1
"set_status"boolIf True, when this command ends, it will set the Replicant output data's status.True
"id"intThe unique object ID.

Axis

An axis of rotation.

ValueDescription
"pitch"Nod your head "yes".
"yaw"Shake your head "no".
"roll"Put your ear to your shoulder.

ReplicantCommand

These commands affect a Replicant currently in the scene.


add_replicant_rigidbody

Add a Rigidbody to a Replicant.

{"$type": "add_replicant_rigidbody", "id": 1}
{"$type": "add_replicant_rigidbody", "id": 1, "is_kinematic": True, "use_gravity": False}
ParameterTypeDescriptionDefault
"is_kinematic"boolIf True, the Rigidbody will be kinematic, and won't respond to physics.True
"use_gravity"boolIf True, the object will respond to gravity.False
"id"intThe unique object ID.

play_replicant_animation

Play a Replicant animation. Optionally, maintain the positions and rotations of specified body parts as set in the IK sub-step prior to the animation sub-step.

{"$type": "play_replicant_animation", "name": "string", "loop": True, "id": 1}
{"$type": "play_replicant_animation", "name": "string", "loop": True, "id": 1, "framerate": -1, "forward": True, "ik_body_parts": []}
ParameterTypeDescriptionDefault
"name"stringThe name of the animation clip to play.
"framerate"intIf greater than zero, play the animation at this framerate instead of the animation's framerate.-1
"forward"boolIf True, play the animation normally. If False, play the naimation in reverse.True
"ik_body_parts"ReplicantBodyPart []These body parts will maintain their positions based on inverse kinematics (IK).[]
"loop"boolIf True, this animation will loop without announcing that it's done.
"id"intThe unique object ID.

stop_replicant_animation

Stop an ongoing Replicant animation.

{"$type": "stop_replicant_animation", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe unique object ID.

SubObjectCommand

These commands can only be used for sub-objects of a composite object. Additionally, these commands may require the object to be a particular "machine type". To determine which objects are sub-objects of a given parent, send send_composite_objects to receive CompositeObjects output data.


set_hinge_limits

Set the angle limits of a hinge joint. This will work with hinges, motors, and springs.

  • Sub-Object: This command will only work with a sub-object of a Composite Object. The sub-object must be of the correct type. To determine which Composite Objects are currently in the scene, and the types of their sub-objects, send the send_composite_objects command.

    • Type: hinge
{"$type": "set_hinge_limits", "id": 1}
{"$type": "set_hinge_limits", "id": 1, "min_limit": 0, "max_limit": 0}
ParameterTypeDescriptionDefault
"min_limit"floatThe minimum angle in degrees.0
"max_limit"floatThe maximum angle in degrees.0
"id"intThe unique object ID.

set_motor_force

Set the force a motor.

  • Sub-Object: This command will only work with a sub-object of a Composite Object. The sub-object must be of the correct type. To determine which Composite Objects are currently in the scene, and the types of their sub-objects, send the send_composite_objects command.

    • Type: motor
{"$type": "set_motor_force", "force": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"force"floatThe force of the motor.
"id"intThe unique object ID.

set_motor_target_velocity

Set the target velocity a motor.

  • Sub-Object: This command will only work with a sub-object of a Composite Object. The sub-object must be of the correct type. To determine which Composite Objects are currently in the scene, and the types of their sub-objects, send the send_composite_objects command.

    • Type: motor
{"$type": "set_motor_target_velocity", "target_velocity": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"target_velocity"floatThe target velocity of the motor.
"id"intThe unique object ID.

set_spring_damper

Set the damper value of a spring.

  • Sub-Object: This command will only work with a sub-object of a Composite Object. The sub-object must be of the correct type. To determine which Composite Objects are currently in the scene, and the types of their sub-objects, send the send_composite_objects command.

    • Type: spring
{"$type": "set_spring_damper", "damper": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"damper"floatThe damper value of the spring.
"id"intThe unique object ID.

set_spring_force

Set the force of a spring.

  • Sub-Object: This command will only work with a sub-object of a Composite Object. The sub-object must be of the correct type. To determine which Composite Objects are currently in the scene, and the types of their sub-objects, send the send_composite_objects command.

    • Type: spring
{"$type": "set_spring_force", "spring_force": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"spring_force"floatThe force of the spring.
"id"intThe unique object ID.

set_spring_target_position

Set the target position of a spring.

  • Sub-Object: This command will only work with a sub-object of a Composite Object. The sub-object must be of the correct type. To determine which Composite Objects are currently in the scene, and the types of their sub-objects, send the send_composite_objects command.

    • Type: spring
{"$type": "set_spring_target_position", "target_position": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"target_position"floatThe target position of the spring, expressed as degrees in a circle.
"id"intThe unique object ID.

set_sub_object_light

Turn a light on or off.

  • Sub-Object: This command will only work with a sub-object of a Composite Object. The sub-object must be of the correct type. To determine which Composite Objects are currently in the scene, and the types of their sub-objects, send the send_composite_objects command.

    • Type: light
{"$type": "set_sub_object_light", "is_on": True, "id": 1}
ParameterTypeDescriptionDefault
"is_on"boolIf true, the light will be on.
"id"intThe unique object ID.

VehicleCommand

These commands affect a vehicle currently in the scene.


apply_vehicle_brake

Set the vehicle's brake value.

{"$type": "apply_vehicle_brake", "id": 1}
{"$type": "apply_vehicle_brake", "id": 1, "force": 0}
ParameterTypeDescriptionDefault
"force"floatThe force value. Must be between -1 and 1.0
"id"intThe unique object ID.

apply_vehicle_drive

Move the vehicle forward or backward.

{"$type": "apply_vehicle_drive", "id": 1}
{"$type": "apply_vehicle_drive", "id": 1, "force": 0}
ParameterTypeDescriptionDefault
"force"floatThe force value. Must be between -1 and 1.0
"id"intThe unique object ID.

apply_vehicle_turn

Turn the vehicle left or right.

{"$type": "apply_vehicle_turn", "id": 1}
{"$type": "apply_vehicle_turn", "id": 1, "force": 0}
ParameterTypeDescriptionDefault
"force"floatThe force value. Must be between -1 and 1.0
"id"intThe unique object ID.

parent_avatar_to_vehicle

Parent an avatar to the vehicle. Usually you'll want to do this to add a camera to the vehicle.

{"$type": "parent_avatar_to_vehicle", "id": 1}
{"$type": "parent_avatar_to_vehicle", "id": 1, "avatar_id": "a", "position": {"x": 0, "y": 0, "z": 0}}
ParameterTypeDescriptionDefault
"avatar_id"stringThe ID of the avatar. It must already exist in the scene."a"
"position"Vector3The camera position.{"x": 0, "y": 0, "z": 0}
"id"intThe unique object ID.

VisualMaterialCommand

Commands that involve the visual material(s) of an object. See MongoDBRecord.ObjectMaterialData for data of the object's hierarchical substructure.


set_texture_scale

Set the scale of the tiling of the material's main texture.

{"$type": "set_texture_scale", "object_name": "string", "id": 1}
{"$type": "set_texture_scale", "object_name": "string", "id": 1, "scale": {"x": 1, "y": 1}}
ParameterTypeDescriptionDefault
"scale"Vector2The tiling scale of the material. Generally (but by no means always), the default tiling scale of a texture is {"x": 1, "y": 1}{"x": 1, "y": 1}
"object_name"stringThe name of the sub-object.
"id"intThe unique object ID.

set_visual_material

Set a visual material of an object or one of its sub-objects.

  • Requires a material asset bundle: To use this command, you must first download an load a material. Send the add_material command first.
{"$type": "set_visual_material", "material_index": 1, "material_name": "string", "object_name": "string", "id": 1}
ParameterTypeDescriptionDefault
"material_index"intThe index of the material in the sub-object's list of materials.
"material_name"stringThe name of the material.
"object_name"stringThe name of the sub-object.
"id"intThe unique object ID.

set_visual_material_smoothness

Set the smoothness (glossiness) of an object's visual material.

{"$type": "set_visual_material_smoothness", "object_name": "string", "id": 1}
{"$type": "set_visual_material_smoothness", "object_name": "string", "id": 1, "smoothness": 0, "material_index": 0}
ParameterTypeDescriptionDefault
"smoothness"floatThe material smoothness. Must be between 0 and 1.0
"material_index"intThe index of the material in the sub-object's list of materials.0
"object_name"stringThe name of the sub-object.
"id"intThe unique object ID.

set_wireframe_material

Set the visual material of an object or one of its sub-objects to wireframe.

  • Requires a material asset bundle: To use this command, you must first download an load a material. Send the add_material command first.
{"$type": "set_wireframe_material", "material_index": 1, "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}, "object_name": "string", "id": 1}
{"$type": "set_wireframe_material", "material_index": 1, "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}, "object_name": "string", "id": 1, "thickness": 0.02}
ParameterTypeDescriptionDefault
"material_index"intThe index of the material in the sub-object's list of materials.
"thickness"floatThe thickness of the wireframe lines.0.02
"color"ColorThe new RGBA color of the wireframe.
"object_name"stringThe name of the sub-object.
"id"intThe unique object ID.

WheelchairReplicantCommand

These commands affect a WheelchairReplicant currently in the scene.


set_wheelchair_brake_torque

Set the brake torque of the wheelchair's wheels.

{"$type": "set_wheelchair_brake_torque", "torque": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"torque"floatThe torque.
"id"intThe unique object ID.

set_wheelchair_motor_torque

Set the motor torque of the wheelchair's rear wheels.

{"$type": "set_wheelchair_motor_torque", "left": 0.125, "right": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"left"floatThe torque for the left rear wheel.
"right"floatThe torque for the right rear wheel.
"id"intThe unique object ID.

set_wheelchair_steer_angle

Set the steer angle of the wheelchair's front wheels.

{"$type": "set_wheelchair_steer_angle", "angle": 0.125, "id": 1}
ParameterTypeDescriptionDefault
"angle"floatThe angle in degrees.
"id"intThe unique object ID.

SetFlexActor

These commands create a new FlexActor of type T with a FlexAsset of type U, or to modify an object that already has a component of type T. This command must be sent before applying any other Flex commands to an object. You probably will want to send set_kinematic_state prior to sending this command.


set_flex_cloth_actor

Create or adjust a FlexClothActor for the object.

  • Expensive: This command is computationally expensive.
  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
  • Deprecated: This command has been deprecated. In the next major TDW update (1.x.0), this command will be removed.
{"$type": "set_flex_cloth_actor", "id": 1}
{"$type": "set_flex_cloth_actor", "id": 1, "mesh_tesselation": 1, "stretch_stiffness": 0.1, "bend_stiffness": 0.1, "tether_stiffness": 0.0, "tether_give": 0.0, "pressure": 0.0, "self_collide": False, "mass_scale": 1, "draw_particles": False}
ParameterTypeDescriptionDefault
"mesh_tesselation"intThe Tesselation factor for the cloth.1
"stretch_stiffness"floatThe stiffness coefficient for stretch constraints.0.1
"bend_stiffness"floatThe stiffness coefficient used for bending constraints.0.1
"tether_stiffness"floatIf > 0.0f then the function will create tethers attached to particles with zero inverse mass. These are unilateral, long-range attachments, which can greatly reduce stretching even at low iteration counts.0.0
"tether_give"floatBecause tether constraints are so effective at reducing stiffness, it can be useful to allow a small amount of extension before the constraint activates.0.0
"pressure"floatIf > 0.0f then a volume (pressure) constraint will also be added to the asset. The rest volume and stiffness will be automatically computed by this function.0.0
"self_collide"boolIf true, the object will handle self-collisions.False
"mass_scale"floatThe mass scale factor.1
"draw_particles"boolDebug drawing of particles.False
"id"intThe unique object ID.

set_flex_fluid_actor

Create or adjust a FlexArrayActor as a fluid object.

  • Expensive: This command is computationally expensive.
  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
  • Deprecated: This command has been deprecated. In the next major TDW update (1.x.0), this command will be removed.
{"$type": "set_flex_fluid_actor", "id": 1}
{"$type": "set_flex_fluid_actor", "id": 1, "mesh_expansion": 0, "max_particles": 10000, "particle_spacing": 0.125, "mass_scale": 1, "draw_particles": False}
ParameterTypeDescriptionDefault
"mesh_expansion"floatMesh local scale of the FlexArrayAsset.0
"max_particles"intMaximum number of particles for the Flex Asset.10000
"particle_spacing"floatParticle spacing of the Flex Asset.0.125
"mass_scale"floatThe mass scale factor.1
"draw_particles"boolDebug drawing of particles.False
"id"intThe unique object ID.

set_flex_fluid_source_actor

Create or adjust a FlexSourceActor as a fluid "hose pipe" source.

  • Expensive: This command is computationally expensive.
  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
  • Deprecated: This command has been deprecated. In the next major TDW update (1.x.0), this command will be removed.
{"$type": "set_flex_fluid_source_actor", "id": 1}
{"$type": "set_flex_fluid_source_actor", "id": 1, "start_speed": 10.0, "lifetime": 2.0, "mesh_tesselation": 2, "mass_scale": 1, "draw_particles": False}
ParameterTypeDescriptionDefault
"start_speed"floatRate of fluid particle generation.10.0
"lifetime"floatLifetime of fluid particles.2.0
"mesh_tesselation"intMesh tesselation of the FlexSourceAsset.2
"mass_scale"floatThe mass scale factor.1
"draw_particles"boolDebug drawing of particles.False
"id"intThe unique object ID.

set_flex_soft_actor

Create or adjust a FlexSoftActor for the object.

  • Expensive: This command is computationally expensive.
  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
{"$type": "set_flex_soft_actor", "id": 1}
{"$type": "set_flex_soft_actor", "id": 1, "volume_sampling": 2.0, "surface_sampling": 0, "cluster_spacing": 0.2, "cluster_radius": 0.2, "cluster_stiffness": 0.2, "link_radius": 0.1, "link_stiffness": 0.5, "particle_spacing": 0.02, "skinning_falloff": 1.0, "mass_scale": 1, "draw_particles": False}
ParameterTypeDescriptionDefault
"volume_sampling"floatThe volumne sampling factor.2.0
"surface_sampling"floatThe surface sampling factor.0
"cluster_spacing"floatThe cluster spacing.0.2
"cluster_radius"floatThe cluster radius.0.2
"cluster_stiffness"floatThe cluster stiffness.0.2
"link_radius"floatThe link radius.0.1
"link_stiffness"floatThe link stiffness.0.5
"particle_spacing"floatParticle spacing of the Flex Asset.0.02
"skinning_falloff"floatSkinning falloff of the FlexSoftSkinning component.1.0
"mass_scale"floatThe mass scale factor.1
"draw_particles"boolDebug drawing of particles.False
"id"intThe unique object ID.

set_flex_solid_actor

Create or adjust a FlexSolidActor for the object.

  • Expensive: This command is computationally expensive.
  • NVIDIA Flex: This command initializes Flex, or requires Flex to be initialized. See: Flex documentation
{"$type": "set_flex_solid_actor", "id": 1}
{"$type": "set_flex_solid_actor", "id": 1, "mesh_expansion": 0, "particle_spacing": 0.125, "mass_scale": 1, "draw_particles": False}
ParameterTypeDescriptionDefault
"mesh_expansion"floatMesh local scale of the FlexSolidAsset.0
"particle_spacing"floatParticle spacing of the Flex Asset.0.125
"mass_scale"floatThe mass scale factor.1
"draw_particles"boolDebug drawing of particles.False
"id"intThe unique object ID.

ShowHideObject

Show or hide and object.


hide_object

Hide the object.

{"$type": "hide_object", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe unique object ID.

show_object

Show the object.

{"$type": "show_object", "id": 1}
ParameterTypeDescriptionDefault
"id"intThe unique object ID.

PlayAudioCommand

These commands create audio clips and play them.

PlayAudioDataCommand

Play audio at a position.


play_audio_data

Play a sound at a position using audio sample data sent over from the controller.

{"$type": "play_audio_data", "wav_data": "string", "num_frames": 1, "id": 1}
{"$type": "play_audio_data", "wav_data": "string", "num_frames": 1, "id": 1, "spatialize": True, "frame_rate": 44100, "num_channels": 1, "position": {"x": 0, "y": 0, "z": 0}, "loop": False}
ParameterTypeDescriptionDefault
"spatialize"boolIf True, the audio is spatialized. If False, the audio is environment audio and the position is ignored.True
"wav_data"stringBase64 string representation of an audio data byte array.
"num_frames"intThe number of audio frames in the audio data.
"frame_rate"intThe sample rate of the audio data (default = 44100).44100
"num_channels"intThe number of audio channels (1 or 2; default = 1).1
"id"intA unique ID for this audio source.
"position"Vector3The position of the audio source.{"x": 0, "y": 0, "z": 0}
"loop"boolIf True, play the audio in a continuous loop.False

play_audio_from_streaming_assets

Load an audio clip from the StreamingAssets directory and play it.

{"$type": "play_audio_from_streaming_assets", "path": "string", "wav_data": "string", "num_frames": 1, "id": 1}
{"$type": "play_audio_from_streaming_assets", "path": "string", "wav_data": "string", "num_frames": 1, "id": 1, "spatialize": True, "frame_rate": 44100, "num_channels": 1, "position": {"x": 0, "y": 0, "z": 0}, "loop": False}
ParameterTypeDescriptionDefault
"path"stringThe path to the file relative to streaming assets, for example "audio/sound.wav". The file must be a .wav file.
"spatialize"boolIf True, the audio is spatialized. If False, the audio is environment audio and the position is ignored.True
"wav_data"stringBase64 string representation of an audio data byte array.
"num_frames"intThe number of audio frames in the audio data.
"frame_rate"intThe sample rate of the audio data (default = 44100).44100
"num_channels"intThe number of audio channels (1 or 2; default = 1).1
"id"intA unique ID for this audio source.
"position"Vector3The position of the audio source.{"x": 0, "y": 0, "z": 0}
"loop"boolIf True, play the audio in a continuous loop.False

play_point_source_data

Make this object a ResonanceAudioSoundSource and play the audio data.

{"$type": "play_point_source_data", "wav_data": "string", "num_frames": 1, "id": 1}
{"$type": "play_point_source_data", "wav_data": "string", "num_frames": 1, "id": 1, "frame_rate": 44100, "num_channels": 1, "position": {"x": 0, "y": 0, "z": 0}, "loop": False}
ParameterTypeDescriptionDefault
"wav_data"stringBase64 string representation of an audio data byte array.
"num_frames"intThe number of audio frames in the audio data.
"frame_rate"intThe sample rate of the audio data (default = 44100).44100
"num_channels"intThe number of audio channels (1 or 2; default = 1).1
"id"intA unique ID for this audio source.
"position"Vector3The position of the audio source.{"x": 0, "y": 0, "z": 0}
"loop"boolIf True, play the audio in a continuous loop.False

PostProcessCommand

These commands adjust post-processing values.


set_ambient_occlusion_intensity

Set the intensity (darkness) of the Ambient Occlusion effect.

{"$type": "set_ambient_occlusion_intensity"}
{"$type": "set_ambient_occlusion_intensity", "intensity": 0.25}
ParameterTypeDescriptionDefault
"intensity"floatThe intensity (darkness) of the ambient occlusion.0.25

set_ambient_occlusion_thickness_modifier

Set the Thickness Modifier for the Ambient Occlusion effect controls "spread" of the effect out from corners.

{"$type": "set_ambient_occlusion_thickness_modifier"}
{"$type": "set_ambient_occlusion_thickness_modifier", "thickness": 1.25}
ParameterTypeDescriptionDefault
"thickness"floatThickness modifer for ambient occlusion.1.25

set_aperture

Set the depth-of-field aperture in post processing volume.

{"$type": "set_aperture"}
{"$type": "set_aperture", "aperture": 4.0}
ParameterTypeDescriptionDefault
"aperture"floatAperture for depth of field.4.0

set_contrast

Set the contrast value of the post-processing color grading.

{"$type": "set_contrast"}
{"$type": "set_contrast", "contrast": 20}
ParameterTypeDescriptionDefault
"contrast"floatThe contrast of the post-processing.20

set_focus_distance

Set the depth-of-field focus distance in post processing volume.

{"$type": "set_focus_distance"}
{"$type": "set_focus_distance", "focus_distance": 2.0}
ParameterTypeDescriptionDefault
"focus_distance"floatFocus distance for depth of field.2.0

set_post_exposure

Set the post-exposure value of the post-processing. A higher value will create a brighter image. We don't recommend values less than 0, or greater than 2.

{"$type": "set_post_exposure"}
{"$type": "set_post_exposure", "post_exposure": 0}
ParameterTypeDescriptionDefault
"post_exposure"floatThe post-exposure value.0

set_saturation

Set the saturation value of the post-processing color grading.

{"$type": "set_saturation"}
{"$type": "set_saturation", "saturation": -20}
ParameterTypeDescriptionDefault
"saturation"floatThe saturation of the post-processing.-20

set_screen_space_reflections

Turn ScreenSpaceReflections on or off.

{"$type": "set_screen_space_reflections"}
{"$type": "set_screen_space_reflections", "enabled": True}
ParameterTypeDescriptionDefault
"enabled"boolIf true, screen space reflections are enabled.True

set_vignette

Enable or disable the vignette, which darkens the image at the edges.

{"$type": "set_vignette"}
{"$type": "set_vignette", "enabled": False}
ParameterTypeDescriptionDefault
"enabled"boolIf true, vignette is enabled.False

ProcGenRoomCommand

These commands can be used to procedurally create a room on a spatial grid. You must initialize a room by sending create_exterior_walls. The procedural generation of the room's layout must be handled in the controller, but the build will handle how corners, floor, ceiling, etc. are placed.


convexify_proc_gen_room

Set all environment colliders (walls, ceilings, and floor) to convex. This command only affects existing objects, and won't continuously convexify new objects. You should only use this command when using Flex objects, as some objects with convex colliders won't behave as expected.

  • Expensive: This command is computationally expensive.
{"$type": "convexify_proc_gen_room"}

create_proc_gen_ceiling

Create a ceiling for the procedurally generated room. The ceiling is divided into 1x1 "tiles", which can be manipulated with Proc Gen Ceiling Tiles Commands (see below).

  • Expensive: This command is computationally expensive.
{"$type": "create_proc_gen_ceiling"}

destroy_proc_gen_ceiling

Destroy all ceiling tiles in a procedurally-generated room.

{"$type": "destroy_proc_gen_ceiling"}

set_proc_gen_ceiling_color

Set the albedo RGBA color of the ceiling.

  • Expensive: This command is computationally expensive.
{"$type": "set_proc_gen_ceiling_color", "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}}
ParameterTypeDescriptionDefault
"color"ColorThe new albedo RGBA color of the ceiling.

set_proc_gen_ceiling_height

Set the height of all ceiling tiles in a proc-gen room.

{"$type": "set_proc_gen_ceiling_height"}
{"$type": "set_proc_gen_ceiling_height", "height": 2.85}
ParameterTypeDescriptionDefault
"height"floatThe y value of all ceiling tiles.2.85

set_proc_gen_ceiling_texture_scale

Set the scale of the tiling of the ceiling material's main texture.

{"$type": "set_proc_gen_ceiling_texture_scale"}
{"$type": "set_proc_gen_ceiling_texture_scale", "scale": {"x": 1, "y": 1}}
ParameterTypeDescriptionDefault
"scale"Vector2The tiling scale of the material. Generally (but by no means always), the default tiling scale of a texture is {"x": 1, "y": 1}{"x": 1, "y": 1}

set_proc_gen_walls_color

Set the albedo RGBA color of the walls.

{"$type": "set_proc_gen_walls_color", "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}}
ParameterTypeDescriptionDefault
"color"ColorThe new albedo RGBA color of the walls.

set_proc_gen_walls_texture_scale

Set the texture scale of all walls in a proc-gen room.

{"$type": "set_proc_gen_walls_texture_scale"}
{"$type": "set_proc_gen_walls_texture_scale", "scale": {"x": 1, "y": 1}}
ParameterTypeDescriptionDefault
"scale"Vector2The tiling scale of the material. Generally (but by no means always), the default tiling scale of a texture is {"x": 1, "y": 1}{"x": 1, "y": 1}

ProcGenCeilingTilesCommand

These commands affect specific ceiling tiles. To use these commands, you must create a ceiling first by sending create_proc_gen_ceiling.


create_proc_gen_ceiling_tiles

Create new ceiling tiles in a procedurally generated room. If you just want to fill the ceiling with tiles, send the command create_ceiling instead.

  • Expensive: This command is computationally expensive.
{"$type": "create_proc_gen_ceiling_tiles", "ceiling_tiles": [{"x": 0, "y": 1}, {"x": 2, "y": 12}]}
ParameterTypeDescriptionDefault
"ceiling_tiles"GridPoint[]The list of ceiling tile positions.

destroy_proc_gen_ceiling_tiles

Destroy ceiling tiles from a procedurally-created ceiling.

  • Expensive: This command is computationally expensive.
{"$type": "destroy_proc_gen_ceiling_tiles", "ceiling_tiles": [{"x": 0, "y": 1}, {"x": 2, "y": 12}]}
ParameterTypeDescriptionDefault
"ceiling_tiles"GridPoint[]The list of ceiling tile positions.

ProcGenFloorCommand

These commands modify the floor of a procedurally-generated room.

ProcGenMaterialCommand

These commands add a material to part of the proc-gen room.


set_proc_gen_ceiling_material

Set the material of a procedurally-generated ceiling.

  • Requires a material asset bundle: To use this command, you must first download an load a material. Send the add_material command first.
{"$type": "set_proc_gen_ceiling_material", "name": "string"}
ParameterTypeDescriptionDefault
"name"stringThe name of the material. The material must already be loaded in memory.

set_proc_gen_walls_material

Set the material of all procedurally-generated walls.

  • Requires a material asset bundle: To use this command, you must first download an load a material. Send the add_material command first.
{"$type": "set_proc_gen_walls_material", "name": "string"}
ParameterTypeDescriptionDefault
"name"stringThe name of the material. The material must already be loaded in memory.

ProcGenWallsCommand

These commands involve placing walls in a procedural room. (See description for Proc Gen Room Command.)


create_exterior_walls

Create the exterior walls. This must be called before all other ProcGenRoomCommands.

  • Expensive: This command is computationally expensive.
{"$type": "create_exterior_walls", "walls": [{"x": 0, "y": 1}, {"x": 2, "y": 12}]}
ParameterTypeDescriptionDefault
"walls"GridPoint[]List of walls as (x, y) points on a grid.

create_interior_walls

Create the interior walls.

  • Expensive: This command is computationally expensive.
{"$type": "create_interior_walls", "walls": [{"x": 0, "y": 1}, {"x": 2, "y": 12}]}
ParameterTypeDescriptionDefault
"walls"GridPoint[]List of walls as (x, y) points on a grid.

set_proc_gen_walls_scale

Set the scale of proc-gen wall sections.

{"$type": "set_proc_gen_walls_scale", "walls": [{"x": 0, "y": 1}, {"x": 2, "y": 12}]}
{"$type": "set_proc_gen_walls_scale", "walls": [{"x": 0, "y": 1}, {"x": 2, "y": 12}], "scale": {"x": 1, "y": 1, "z": 1}}
ParameterTypeDescriptionDefault
"scale"Vector3The new scale of each wall section. By default, the scale of a wall section is (1, 1, 1).{"x": 1, "y": 1, "z": 1}
"walls"GridPoint[]List of walls as (x, y) points on a grid.

RobotCommand

These commands affect robots currently in the scene. To add a robot, send the add_robot command. For further documentation, see: Documentation/misc_frontend/robots.md


create_robot_obi_colliders

Create Obi colliders for a robot if there aren't any.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "create_robot_obi_colliders"}
{"$type": "create_robot_obi_colliders", "id": 0}
ParameterTypeDescriptionDefault
"id"intThe ID of the robot in the scene.0

destroy_robot

Destroy a robot in the scene.

{"$type": "destroy_robot"}
{"$type": "destroy_robot", "id": 0}
ParameterTypeDescriptionDefault
"id"intThe ID of the robot in the scene.0

make_robot_nav_mesh_obstacle

Make a specific robot a NavMesh obstacle. If it is already a NavMesh obstacle, change its properties.

  • Requires a NavMesh: This command requires a NavMesh.Scenes created via add_scene already have NavMeshes.Proc-gen scenes don't; send bake_nav_mesh to create one.
{"$type": "make_robot_nav_mesh_obstacle"}
{"$type": "make_robot_nav_mesh_obstacle", "carve_type": "all", "scale": 1, "shape": "box", "id": 0}
ParameterTypeDescriptionDefault
"carve_type"CarveTypeHow the robot will "carve" holes in the NavMesh."all"
"scale"floatThe scale of the obstacle relative to the size of the robot. Set this lower to account for the additional space that the robot will carve.1
"shape"CarveShapeThe shape of the carver."box"
"id"intThe ID of the robot in the scene.0

CarveShape

The shape of a NavMesh carver.

ValueDescription
"box"
"capsule"

CarveType

How objects in the scene will "carve" the NavMesh.

ValueDescription
"all"Each object will carve a large hole in the NavMesh. If an object moves, the hole will move too. This is the most performance-intensive option.
"stationary"Each object will initially carve a large hole in the NavMesh. If an objects moves, it won't "re-carve" the NavMesh. A small hole will remain in its original position.
"none"Each object will carve small holes in the NavMesh. If an objects moves, it won't "re-carve" the NavMesh. A small hole will remain in its original position.

parent_avatar_to_robot

Parent an avatar to a robot. The avatar's position and rotation will always be relative to the robot. Usually you'll want to do this to add a camera to the robot.

{"$type": "parent_avatar_to_robot", "position": {"x": 1.1, "y": 0.0, "z": 0}, "body_part_id": 1}
{"$type": "parent_avatar_to_robot", "position": {"x": 1.1, "y": 0.0, "z": 0}, "body_part_id": 1, "avatar_id": "a", "id": 0}
ParameterTypeDescriptionDefault
"avatar_id"stringThe ID of the avatar. It must already exist in the scene."a"
"position"Vector3The position of the avatar relative to the robot.
"body_part_id"intParent the avatar to a body part of this robot with this ID. Send send_static_robots to get the IDs and names of this robot's body parts.
"id"intThe ID of the robot in the scene.0

remove_robot_nav_mesh_obstacle

Remove a NavMesh obstacle from a robot (see make_robot_nav_mesh_obstacle).

  • Requires a NavMesh: This command requires a NavMesh.Scenes created via add_scene already have NavMeshes.Proc-gen scenes don't; send bake_nav_mesh to create one.
{"$type": "remove_robot_nav_mesh_obstacle"}
{"$type": "remove_robot_nav_mesh_obstacle", "id": 0}
ParameterTypeDescriptionDefault
"id"intThe ID of the robot in the scene.0

set_immovable

Set whether or not the root object of the robot is immovable. Its joints will still be moveable.

{"$type": "set_immovable"}
{"$type": "set_immovable", "immovable": True, "id": 0}
ParameterTypeDescriptionDefault
"immovable"boolIf true, the root object of the robot is immovable.True
"id"intThe ID of the robot in the scene.0

set_robot_color

Set the visual color of a robot in the scene.

{"$type": "set_robot_color", "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}}
{"$type": "set_robot_color", "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}, "id": 0}
ParameterTypeDescriptionDefault
"color"ColorThe new color of the robot.
"id"intThe ID of the robot in the scene.0

set_robot_joint_id

Set the ID of a robot joint. This can be useful when loading saved data that contains robot joint IDs. Note that the id parameter is for the parent robot, not the joint. The joint is located via joint_name. Accordingly, this command only works when all of the names of a robot's joints are unique.

  • Deprecated: This command has been deprecated. In the next major TDW update (1.x.0), this command will be removed.
{"$type": "set_robot_joint_id", "joint_name": "string", "joint_id": 1}
{"$type": "set_robot_joint_id", "joint_name": "string", "joint_id": 1, "id": 0}
ParameterTypeDescriptionDefault
"joint_name"stringThe exected name of the joint.
"joint_id"intThe new ID of the joint.
"id"intThe ID of the robot in the scene.0

set_robot_obi_collision_material

Set the Obi collision material of a robot.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
{"$type": "set_robot_obi_collision_material"}
{"$type": "set_robot_obi_collision_material", "dynamic_friction": 0.3, "static_friction": 0.3, "stickiness": 0, "stick_distance": 0, "friction_combine": "average", "stickiness_combine": "average", "id": 0}
ParameterTypeDescriptionDefault
"dynamic_friction"floatPercentage of relative tangential velocity removed in a collision, once the static friction threshold has been surpassed and the particle is moving relative to the surface. 0 means things will slide as if made of ice, 1 will result in total loss of tangential velocity.0.3
"static_friction"floatPercentage of relative tangential velocity removed in a collision. 0 means things will slide as if made of ice, 1 will result in total loss of tangential velocity.0.3
"stickiness"floatAmount of inward normal force applied between objects in a collision. 0 means no force will be applied, 1 will keep objects from separating once they collide.0
"stick_distance"floatMaximum distance between objects at which sticky forces are applied. Since contacts will be generated between bodies within the stick distance, it should be kept as small as possible to reduce the amount of contacts generated.0
"friction_combine"MaterialCombineModeHow is the friction coefficient calculated when two objects involved in a collision have different coefficients. If both objects have different friction combine modes, the mode with the lowest enum index is used."average"
"stickiness_combine"MaterialCombineModeHow is the stickiness coefficient calculated when two objects involved in a collision have different coefficients. If both objects have different stickiness combine modes, the mode with the lowest enum index is used."average"
"id"intThe ID of the robot in the scene.0

MaterialCombineMode

Obi collision maerial combine modes.

ValueDescription
"average"
"minimum"
"multiply"
"maximum"

teleport_robot

Teleport the robot to a new position and rotation. This is a sudden movement that might disrupt the physics simulation. You should only use this command if you really need to (for example, if the robot falls over).

{"$type": "teleport_robot"}
{"$type": "teleport_robot", "position": {"x": 0, "y": 0, "z": 0}, "rotation": {"w": 1, "x": 0, "y": 0, "z": 0}, "id": 0}
ParameterTypeDescriptionDefault
"position"Vector3The position of the robot.{"x": 0, "y": 0, "z": 0}
"rotation"QuaternionThe rotation of the robot.{"w": 1, "x": 0, "y": 0, "z": 0}
"id"intThe ID of the robot in the scene.0

MagnebotCommand

These commands are for a Magnebot currently in the scene. For further documentation, see: Documentation/misc_frontend/robots.md For a high-level API, see: https://github.com/alters-mit/magnebot


detach_from_magnet

Detach an object from a Magnebot magnet.

{"$type": "detach_from_magnet", "object_id": 1}
{"$type": "detach_from_magnet", "object_id": 1, "arm": "left", "id": 0}
ParameterTypeDescriptionDefault
"arm"ArmThe magnet's arm."left"
"object_id"intThe ID of the held object.
"id"intThe ID of the robot in the scene.0

Arm

A left or right arm.

ValueDescription
"left"
"right"

set_magnet_targets

Set the objects that the Magnebot magnet will try to pick up.

{"$type": "set_magnet_targets"}
{"$type": "set_magnet_targets", "arm": "left", "targets": [], "id": 0}
ParameterTypeDescriptionDefault
"arm"ArmThe magnet's arm."left"
"targets"int[]The IDs of the target objects. If a magnet collides with an object, it'll "stick" only if the object ID is in this list. If the magnet is holding an object not in this list, it will continue to do hold it.[]
"id"intThe ID of the robot in the scene.0

Arm

A left or right arm.

ValueDescription
"left"
"right"

MagnebotWheelsCommand

These commands set the friction coefficient of a Magnebot's wheels over time given the distance to a target. These commands must be sent per-frame. These commands will check if the Magnebot is at the target per PHYSICS frame, INCLUDING frames skipped by step_physics. This greatly increases the precision of a Magnebot simulation.


set_magnebot_wheels_during_move

Set the friction coefficients of the Magnebot's wheels during a move_by() or move_to() action, given a target position. The friction coefficients will increase as the Magnebot approaches the target position and the command will announce if the Magnebot arrives at the target position.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: set_robot_joint_friction
  • Sends data: This command instructs the build to send output data.

{"$type": "set_magnebot_wheels_during_move", "position": {"x": 1.1, "y": 0.0, "z": 0}, "origin": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "set_magnebot_wheels_during_move", "position": {"x": 1.1, "y": 0.0, "z": 0}, "origin": {"x": 1.1, "y": 0.0, "z": 0}, "brake_distance": 0.1, "arrived_at": 0.01, "minimum_friction": 0.05, "maximum_friction": 1, "id": 0}
ParameterTypeDescriptionDefault
"position"Vector3The target destination of the Magnebot.
"origin"Vector3The origin of the Magnebot at the start of the action (not its current position).
"brake_distance"floatThe distance at which the Magnebot should start to brake, in meters.0.1
"arrived_at"floatThe threshold for determining whether the Magnebot is at the target.0.01
"minimum_friction"floatThe minimum friction coefficient for the wheels. The default value (0.05) is also the default friction coefficient of the wheels.0.05
"maximum_friction"floatThe maximum friction coefficient for the wheels when slowing down.1
"id"intThe ID of the robot in the scene.0

MagnebotWheelsTurnCommand

These commands set the friction coefficients of the Magnebot's wheels during a turn action.


set_magnebot_wheels_during_turn_by

Set the friction coefficients of the Magnebot's wheels during a turn_by() action, given a target angle. The friction coefficients will increase as the Magnebot approaches the target angle and the command will announce if the Magnebot aligns with the target angle.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: set_robot_joint_friction
  • Sends data: This command instructs the build to send output data.

{"$type": "set_magnebot_wheels_during_turn_by", "angle": 0.125, "origin": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "set_magnebot_wheels_during_turn_by", "angle": 0.125, "origin": {"x": 1.1, "y": 0.0, "z": 0}, "brake_angle": 0.1, "arrived_at": 0.01, "minimum_friction": 0.05, "maximum_friction": 1, "id": 0}
ParameterTypeDescriptionDefault
"angle"floatThe target angle of the Magnebot in degrees.
"origin"Vector3The starting forward directional vector of the Magnebot at the start of the action (not its current forward directional vector).
"brake_angle"floatThe angle at which the Magnebot should start to brake, in degrees.0.1
"arrived_at"floatThe threshold for determining whether the Magnebot is at the target.0.01
"minimum_friction"floatThe minimum friction coefficient for the wheels. The default value (0.05) is also the default friction coefficient of the wheels.0.05
"maximum_friction"floatThe maximum friction coefficient for the wheels when slowing down.1
"id"intThe ID of the robot in the scene.0

set_magnebot_wheels_during_turn_to

Set the friction coefficients of the Magnebot's wheels during a turn_to() action, given a target angle. The friction coefficients will increase as the Magnebot approaches the target angle and the command will announce if the Magnebot aligns with the target angle. Because the Magnebot will move slightly while rotating, this command has an additional position parameter to re-check for alignment with the target.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: set_robot_joint_friction
  • Sends data: This command instructs the build to send output data.

{"$type": "set_magnebot_wheels_during_turn_to", "position": {"x": 1.1, "y": 0.0, "z": 0}, "angle": 0.125, "origin": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "set_magnebot_wheels_during_turn_to", "position": {"x": 1.1, "y": 0.0, "z": 0}, "angle": 0.125, "origin": {"x": 1.1, "y": 0.0, "z": 0}, "brake_angle": 0.1, "arrived_at": 0.01, "minimum_friction": 0.05, "maximum_friction": 1, "id": 0}
ParameterTypeDescriptionDefault
"position"Vector3The target position that the Magnebot is turning to.
"angle"floatThe target angle of the Magnebot in degrees.
"origin"Vector3The starting forward directional vector of the Magnebot at the start of the action (not its current forward directional vector).
"brake_angle"floatThe angle at which the Magnebot should start to brake, in degrees.0.1
"arrived_at"floatThe threshold for determining whether the Magnebot is at the target.0.01
"minimum_friction"floatThe minimum friction coefficient for the wheels. The default value (0.05) is also the default friction coefficient of the wheels.0.05
"maximum_friction"floatThe maximum friction coefficient for the wheels when slowing down.1
"id"intThe ID of the robot in the scene.0

RobotJointCommand

These commands set joint targets or parameters for a robot in the scene.


clatterize_robot_joint

Make a robot respond to Clatter audio by setting its audio values and adding a ClatterObject component. You must send ClatterizeObject for each robot prior to sending InitializeClatter (though they can all be in the same list of commands).

{"$type": "clatterize_robot_joint", "impact_material": "wood_medium", "size": 1, "amp": 0.125, "resonance": 0.125, "fake_mass": 0.125, "joint_id": 1}
{"$type": "clatterize_robot_joint", "impact_material": "wood_medium", "size": 1, "amp": 0.125, "resonance": 0.125, "fake_mass": 0.125, "joint_id": 1, "has_scrape_material": False, "scrape_material": "ceramic", "set_fake_mass": False, "id": 0}
ParameterTypeDescriptionDefault
"impact_material"ImpactMaterialUnsizedThe impact material. See: tdw.physics_audio.audio_material (which is the same thing as an impact material).
"size"intThe size bucket value (0-5); smaller objects should use smaller values.
"amp"floatThe audio amplitude (0-1).
"resonance"floatThe resonance value (0-1).
"has_scrape_material"boolIf true, the object has a scrape material.False
"scrape_material"ScrapeMaterialThe object's scrape material. Ignored if has_scrape_material == False. See: tdw.physics_audio.scrape_material"ceramic"
"set_fake_mass"boolIf True, set a fake audio mass (see below).False
"fake_mass"floatIf set_fake_mass == True, this is the fake mass, which will be used for audio synthesis instead of the true mass.
"joint_id"intThe ID of the joint.
"id"intThe ID of the robot in the scene.0

set_robot_joint_drive

Set static joint drive parameters for a robot joint. Use the StaticRobot output data to determine which drives (x, y, and z) the joint has and what their default values are.

{"$type": "set_robot_joint_drive", "joint_id": 1}
{"$type": "set_robot_joint_drive", "joint_id": 1, "axis": "x", "lower_limit": 0, "upper_limit": 0, "force_limit": 3, "stiffness": 1000, "damping": 300, "id": 0}
ParameterTypeDescriptionDefault
"axis"DriveAxisThe axis of the drive."x"
"lower_limit"floatThe lower limit of the drive in degrees. If this and upper_limit are 0, the joint movement is unlimited.0
"upper_limit"floatThe upper limit of the drive in degrees. If this and lower_limit are 0, the joint movement is unlimited.0
"force_limit"floatThe force limit.3
"stiffness"floatThe stiffness of the drive.1000
"damping"floatThe damping of the drive.300
"joint_id"intThe ID of the joint.
"id"intThe ID of the robot in the scene.0

DriveAxis

ValueDescription
"x"
"y"
"z"

set_robot_joint_friction

Set the friction coefficient of a robot joint.

{"$type": "set_robot_joint_friction", "joint_id": 1}
{"$type": "set_robot_joint_friction", "joint_id": 1, "friction": 0.05, "id": 0}
ParameterTypeDescriptionDefault
"friction"floatThe friction coefficient.0.05
"joint_id"intThe ID of the joint.
"id"intThe ID of the robot in the scene.0

set_robot_joint_mass

Set the mass of a robot joint. To get the default mass, see the StaticRobot output data.

{"$type": "set_robot_joint_mass", "mass": 0.125, "joint_id": 1}
{"$type": "set_robot_joint_mass", "mass": 0.125, "joint_id": 1, "id": 0}
ParameterTypeDescriptionDefault
"mass"floatThe mass of the joint.
"joint_id"intThe ID of the joint.
"id"intThe ID of the robot in the scene.0

set_robot_joint_physic_material

Set the physic material of a robot joint and apply friction and bounciness values to the joint. These settings can be overriden by sending the command again.

{"$type": "set_robot_joint_physic_material", "dynamic_friction": 0.125, "static_friction": 0.125, "bounciness": 0.125, "joint_id": 1}
{"$type": "set_robot_joint_physic_material", "dynamic_friction": 0.125, "static_friction": 0.125, "bounciness": 0.125, "joint_id": 1, "id": 0}
ParameterTypeDescriptionDefault
"dynamic_friction"floatFriction when the joint is already moving. A higher value means that the joint will come to rest very quickly. Must be between 0 and 1.
"static_friction"floatFriction when the joint is not moving. A higher value means that a lot of force will be needed to make the joint start moving. Must be between 0 and 1.
"bounciness"floatThe bounciness of the joint. A higher value means that the joint will bounce without losing much energy. Must be between 0 and 1.
"joint_id"intThe ID of the joint.
"id"intThe ID of the robot in the scene.0

RobotJointTargetCommand

These commands set target angles for each of the joint's drives. To get the type of joint and its drives, see the send_static_robots command and the StaticRobot output data.


add_force_to_prismatic

Add a force to a prismatic joint.

{"$type": "add_force_to_prismatic", "force": 0.125, "joint_id": 1}
{"$type": "add_force_to_prismatic", "force": 0.125, "joint_id": 1, "id": 0}
ParameterTypeDescriptionDefault
"force"floatThe force in Newtons.
"joint_id"intThe ID of the joint.
"id"intThe ID of the robot in the scene.0

add_torque_to_revolute

Add a torque to a revolute joint.

{"$type": "add_torque_to_revolute", "torque": 0.125, "joint_id": 1}
{"$type": "add_torque_to_revolute", "torque": 0.125, "joint_id": 1, "id": 0}
ParameterTypeDescriptionDefault
"torque"floatThe torque in Newtons.
"joint_id"intThe ID of the joint.
"id"intThe ID of the robot in the scene.0

add_torque_to_spherical

Add a torque to a spherical joint.

{"$type": "add_torque_to_spherical", "torque": {"x": 1.1, "y": 0.0, "z": 0}, "joint_id": 1}
{"$type": "add_torque_to_spherical", "torque": {"x": 1.1, "y": 0.0, "z": 0}, "joint_id": 1, "id": 0}
ParameterTypeDescriptionDefault
"torque"Vector3The (x, y, z) torques in Newtons.
"joint_id"intThe ID of the joint.
"id"intThe ID of the robot in the scene.0

set_prismatic_target

Set the target position of a prismatic robot joint. Per frame, the joint will move towards the target until it is either no longer possible to do so (i.e. due to physics) or because it has reached the target position.

{"$type": "set_prismatic_target", "target": 0.125, "joint_id": 1}
{"$type": "set_prismatic_target", "target": 0.125, "joint_id": 1, "id": 0}
ParameterTypeDescriptionDefault
"target"floatThe target position on the prismatic joint.
"joint_id"intThe ID of the joint.
"id"intThe ID of the robot in the scene.0

set_revolute_target

Set the target angle of a revolute robot joint. Per frame, the joint will revolve towards the target until it is either no longer possible to do so (i.e. due to physics) or because it has reached the target angle.

{"$type": "set_revolute_target", "target": 0.125, "joint_id": 1}
{"$type": "set_revolute_target", "target": 0.125, "joint_id": 1, "id": 0}
ParameterTypeDescriptionDefault
"target"floatThe target angle in degrees.
"joint_id"intThe ID of the joint.
"id"intThe ID of the robot in the scene.0

set_spherical_target

Set the target angles (x, y, z) of a spherical robot joint. Per frame, the joint will revolve towards the targets until it is either no longer possible to do so (i.e. due to physics) or because it has reached the target angles.

{"$type": "set_spherical_target", "target": {"x": 1.1, "y": 0.0, "z": 0}, "joint_id": 1}
{"$type": "set_spherical_target", "target": {"x": 1.1, "y": 0.0, "z": 0}, "joint_id": 1, "id": 0}
ParameterTypeDescriptionDefault
"target"Vector3The target angles in degrees for the (x, y, z) drives.
"joint_id"intThe ID of the joint.
"id"intThe ID of the robot in the scene.0

SetRobotJointPositionCommand

These commands instantaneously set the robot joint angles and positions. These commands SHOULD NOT be used in place of physics-based motion. Unity will interpret these commands as a VERY fast motion. These commands should only be used when a robot is first created in order to set an initial pose.


set_prismatic_position

Instantaneously set the position of a prismatic joint. Only use this command to set an initial pose for a robot.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: set_prismatic_target
{"$type": "set_prismatic_position", "position": 0.125, "joint_id": 1}
{"$type": "set_prismatic_position", "position": 0.125, "joint_id": 1, "id": 0}
ParameterTypeDescriptionDefault
"position"floatThe position in meters.
"joint_id"intThe ID of the joint.
"id"intThe ID of the robot in the scene.0

set_revolute_angle

Instantaneously set the angle of a revolute joint. Only use this command to set an initial pose for a robot.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: set_revolute_target
{"$type": "set_revolute_angle", "angle": 0.125, "joint_id": 1}
{"$type": "set_revolute_angle", "angle": 0.125, "joint_id": 1, "id": 0}
ParameterTypeDescriptionDefault
"angle"floatThe angle in degrees.
"joint_id"intThe ID of the joint.
"id"intThe ID of the robot in the scene.0

set_spherical_angles

Instantaneously set the angles of a spherical joint. Only use this command to set an initial pose for a robot.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: set_spherical_target
{"$type": "set_spherical_angles", "angles": {"x": 1.1, "y": 0.0, "z": 0}, "joint_id": 1}
{"$type": "set_spherical_angles", "angles": {"x": 1.1, "y": 0.0, "z": 0}, "joint_id": 1, "id": 0}
ParameterTypeDescriptionDefault
"angles"Vector3The angles in degrees.
"joint_id"intThe ID of the joint.
"id"intThe ID of the robot in the scene.0

SendMultipleDataOnceCommand

These commands send data exactly once to the controller (not per-frame). Unlike most output data such as Tranforms, there can be more than one output data object of this type in the build's response. For example, the build can send multiple Raycast objects in the same list.


send_nav_mesh_path

Tell the build to send data of a path on the NavMesh from the origin to the destination.

  • Requires a NavMesh: This command requires a NavMesh.Scenes created via add_scene already have NavMeshes.Proc-gen scenes don't; send bake_nav_mesh to create one.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_nav_mesh_path", "origin": {"x": 1.1, "y": 0.0, "z": 0}, "destination": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "send_nav_mesh_path", "origin": {"x": 1.1, "y": 0.0, "z": 0}, "destination": {"x": 1.1, "y": 0.0, "z": 0}, "id": 0}
ParameterTypeDescriptionDefault
"origin"Vector3The origin of the path.
"destination"Vector3The destination of the path.
"id"intThe ID of the output data object. This can be used to match the output data back to the command that created it.0

SendOverlapCommand

These commands create an overlap shape and then check which objects are within that shape.


send_overlap_box

Check which objects a box-shaped space overlaps with.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_overlap_box", "half_extents": {"x": 1.1, "y": 0.0, "z": 0}, "rotation": {"w": 0.6, "x": 3.5, "y": -45, "z": 0}, "position": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "send_overlap_box", "half_extents": {"x": 1.1, "y": 0.0, "z": 0}, "rotation": {"w": 0.6, "x": 3.5, "y": -45, "z": 0}, "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 0}
ParameterTypeDescriptionDefault
"half_extents"Vector3Half of the extents of the box (i.e. half the scale of an object).
"rotation"QuaternionThe rotation of the box.
"position"Vector3The center of the shape.
"id"intThe ID of the output data object. This can be used to match the output data back to the command that created it.0

send_overlap_capsule

Check which objects a capsule-shaped space overlaps with.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_overlap_capsule", "end": {"x": 1.1, "y": 0.0, "z": 0}, "radius": 0.125, "position": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "send_overlap_capsule", "end": {"x": 1.1, "y": 0.0, "z": 0}, "radius": 0.125, "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 0}
ParameterTypeDescriptionDefault
"end"Vector3The top of the capsule. (The position parameter is the bottom of the capsule).
"radius"floatThe radius of the capsule.
"position"Vector3The center of the shape.
"id"intThe ID of the output data object. This can be used to match the output data back to the command that created it.0

send_overlap_sphere

Check which objects a sphere-shaped space overlaps with.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_overlap_sphere", "radius": 0.125, "position": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "send_overlap_sphere", "radius": 0.125, "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 0}
ParameterTypeDescriptionDefault
"radius"floatThe radius of the sphere.
"position"Vector3The center of the shape.
"id"intThe ID of the output data object. This can be used to match the output data back to the command that created it.0

SendRaycastCommand

These commands cast different types of rays and send the results to the controller.


send_boxcast

Cast a box along a direction and return the results. The can be multiple hits, each of which will be sent to the controller as Raycast data.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_boxcast", "half_extents": {"x": 1.1, "y": 0.0, "z": 0}}
{"$type": "send_boxcast", "half_extents": {"x": 1.1, "y": 0.0, "z": 0}, "origin": {"x": 0, "y": 0, "z": 0}, "destination": {"x": 1, "y": 1, "z": 1}, "id": 0}
ParameterTypeDescriptionDefault
"half_extents"Vector3The half-extents of the box.
"origin"Vector3The origin of the raycast.{"x": 0, "y": 0, "z": 0}
"destination"Vector3The destination of the raycast.{"x": 1, "y": 1, "z": 1}
"id"intThe ID of the output data object. This can be used to match the output data back to the command that created it.0

send_mouse_raycast

Raycast from a camera through the mouse screen position.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_mouse_raycast"}
{"$type": "send_mouse_raycast", "avatar_id": "a", "origin": {"x": 0, "y": 0, "z": 0}, "destination": {"x": 1, "y": 1, "z": 1}, "id": 0}
ParameterTypeDescriptionDefault
"avatar_id"stringThe ID of the avatar of the rendering camera."a"
"origin"Vector3The origin of the raycast.{"x": 0, "y": 0, "z": 0}
"destination"Vector3The destination of the raycast.{"x": 1, "y": 1, "z": 1}
"id"intThe ID of the output data object. This can be used to match the output data back to the command that created it.0

send_raycast

Cast a ray from the origin to the destination.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_raycast"}
{"$type": "send_raycast", "origin": {"x": 0, "y": 0, "z": 0}, "destination": {"x": 1, "y": 1, "z": 1}, "id": 0}
ParameterTypeDescriptionDefault
"origin"Vector3The origin of the raycast.{"x": 0, "y": 0, "z": 0}
"destination"Vector3The destination of the raycast.{"x": 1, "y": 1, "z": 1}
"id"intThe ID of the output data object. This can be used to match the output data back to the command that created it.0

send_spherecast

Cast a sphere along a direction and return the results. The can be multiple hits, each of which will be sent to the controller as Raycast data.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_spherecast", "radius": 0.125}
{"$type": "send_spherecast", "radius": 0.125, "origin": {"x": 0, "y": 0, "z": 0}, "destination": {"x": 1, "y": 1, "z": 1}, "id": 0}
ParameterTypeDescriptionDefault
"radius"floatThe radius of the sphere.
"origin"Vector3The origin of the raycast.{"x": 0, "y": 0, "z": 0}
"destination"Vector3The destination of the raycast.{"x": 1, "y": 1, "z": 1}
"id"intThe ID of the output data object. This can be used to match the output data back to the command that created it.0

SingletonSubscriberCommand

These commands act as singletons and can subscribe to events.


send_collisions

Send collision data for all objects and avatars currently in the scene.

{"$type": "send_collisions"}
{"$type": "send_collisions", "enter": True, "stay": False, "exit": False, "collision_types": ["obj"]}
ParameterTypeDescriptionDefault
"enter"boolIf True, listen for when objects enter a collision.True
"stay"boolIf True, listen for when objects stay in a collision. WARNING: Setting this to True will generate a LOT of data.False
"exit"boolIf True, listen for when objects exit a collision.False
"collision_types"CollisionType []The types of collisions that objects will listen for per frame.["obj"]

send_log_messages

Send log messages to the controller.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_log_messages"}

SendDataCommand

These commands send data to the controller.


send_collider_intersections

Send data for collider intersections between pairs of objects and between single objects and the environment (e.g. walls). Note that each intersection is a separate output data object, and that each pair of objects/environment meshes might intersect more than once because they might have more than one collider.

{"$type": "send_collider_intersections"}
{"$type": "send_collider_intersections", "obj_intersection_ids": [], "env_intersection_ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"obj_intersection_ids"int []Pairs of object IDs, for example [[0, 1], [0, 2]]. Object IDs pairs in this array will be tested for collider intersections with each other.[]
"env_intersection_ids"int []A one-dimensional list of object IDs, for example [0, 1, 2]. Object IDs in this list will be tested for collider intersections with the environment.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_containment

Send containment data using container shapes. See: add_box_container, add_cylinder_container, and add_sphere_container. Container shapes will check for overlaps with other objects.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_containment"}
{"$type": "send_containment", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_magnebots

Send data for each Magnebot in the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_magnebots"}
{"$type": "send_magnebots", "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int[]The IDs of the Magnebots. If this list is undefined or empty, the build will return data for all Magnebots.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_occupancy_map

Request an occupancy map, which will divide the environment into a grid with values indicating whether each cell is occupied or free.

  • Expensive: This command is computationally expensive.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_occupancy_map"}
{"$type": "send_occupancy_map", "cell_size": 0.5, "raycast_y": 2.5, "ignore_objects": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"cell_size"floatThe size of each cell in meters.0.5
"raycast_y"floatWhen calculating the occupancy map, rays will be cast from this height in meters.2.5
"ignore_objects"int []Object IDs in this array won't cause a cell to be marked as occupied.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_robot_joint_velocities

Send velocity data for each joint of each robot in the scene. This is separate from DynamicRobots output data for the sake of speed in certain simulations.

  • Sends data: This command instructs the build to send output data.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: send_dynamic_robots
  • Deprecated: This command has been deprecated. In the next major TDW update (1.x.0), this command will be removed.

{"$type": "send_robot_joint_velocities"}
{"$type": "send_robot_joint_velocities", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_static_robots

Send static data that doesn't update per frame (such as segmentation colors) for each robot in the scene. See also: send_robots

  • Sends data: This command instructs the build to send output data.

{"$type": "send_static_robots"}
{"$type": "send_static_robots", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_substructure

Send visual material substructure data for a single object.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.

  • Sends data: This command instructs the build to send output data.

  • Expensive: This command is computationally expensive.

{"$type": "send_substructure", "id": 1}
{"$type": "send_substructure", "id": 1, "frequency": "once"}
ParameterTypeDescriptionDefault
"id"intThe unique ID of the object.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

SendAvatarsCommand

These commands send data about avatars in the scene.


send_avatars

Send data for avatars in the scene.

{"$type": "send_avatars"}
{"$type": "send_avatars", "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"string[]The IDs of the avatars. If this list is undefined or empty, the build will return data for all avatars.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_avatar_segmentation_colors

Send avatar segmentation color data.

{"$type": "send_avatar_segmentation_colors"}
{"$type": "send_avatar_segmentation_colors", "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"string[]The IDs of the avatars. If this list is undefined or empty, the build will return data for all avatars.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_camera_matrices

Send camera matrix data for each camera.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_camera_matrices"}
{"$type": "send_camera_matrices", "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"string[]The IDs of the avatars. If this list is undefined or empty, the build will return data for all avatars.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_field_of_view

Send field of view for each camera.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_field_of_view"}
{"$type": "send_field_of_view", "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"string[]The IDs of the avatars. If this list is undefined or empty, the build will return data for all avatars.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_id_pass_grayscale

Send the average grayscale value of an _id pass.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_id_pass_grayscale"}
{"$type": "send_id_pass_grayscale", "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"string[]The IDs of the avatars. If this list is undefined or empty, the build will return data for all avatars.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_id_pass_segmentation_colors

Send all unique colors in an _id pass.

{"$type": "send_id_pass_segmentation_colors"}
{"$type": "send_id_pass_segmentation_colors", "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"string[]The IDs of the avatars. If this list is undefined or empty, the build will return data for all avatars.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_images

Send images and metadata.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_images"}
{"$type": "send_images", "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"string[]The IDs of the avatars. If this list is undefined or empty, the build will return data for all avatars.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_image_sensors

Send data about each of the avatar's ImageSensors.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_image_sensors"}
{"$type": "send_image_sensors", "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"string[]The IDs of the avatars. If this list is undefined or empty, the build will return data for all avatars.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_occlusion

Send the extent to which the scene environment is occluding objects in the frame.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_occlusion"}
{"$type": "send_occlusion", "object_ids": [], "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"object_ids"int []If None or empty, all objects in the camera viewport will be tested for occlusion. Otherwise, if an object isn't in this list, it will be treated as an occluder (if this was a _mask pass, it would appear black instead of red). This parameter can be used to test occlusion for specific objects, but it is somewhat slower than testing for all.[]
"ids"string[]The IDs of the avatars. If this list is undefined or empty, the build will return data for all avatars.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_screen_positions

Given a list of worldspace positions, return the screenspace positions according to each of the avatar's camera.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_screen_positions", "position_ids": [0, 1, 2], "positions": [{"x": 1.1, "y": 0.0, "z": 0}, {"x": 2, "y": 0, "z": -1}]}
{"$type": "send_screen_positions", "position_ids": [0, 1, 2], "positions": [{"x": 1.1, "y": 0.0, "z": 0}, {"x": 2, "y": 0, "z": -1}], "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"position_ids"int []The unique IDs of each screen position output data. Use this to map the output data to the original worldspace position.
"positions"Vector3 []The worldspace positions.
"ids"string[]The IDs of the avatars. If this list is undefined or empty, the build will return data for all avatars.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

SendFixedLengthDataCommand

These commands send fixed-length data, meaning that the output byte array size is always the same if the send frequency is "always". The output byte array is resized whenever these commands are sent. This means that these commands are significantly slower if they are sent per-communicate call with frequency "once".


send_mouse

Send mouse output data.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_mouse"}
{"$type": "send_mouse", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_version

Receive data about the build version.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_version"}
{"$type": "send_version", "log": True, "frequency": "once"}
ParameterTypeDescriptionDefault
"log"boolIf True, log the TDW version in the Player or Editor log.True
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

SendFixedLengthAvatarsDataCommand

Abstract base class for sending avatar data where the size of the output data is the same on every communicate call.


send_avatar_ids

Send the IDs of each avatar in the scene.

  • Sends data: This command instructs the build to send output data.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: send_avatars
{"$type": "send_avatar_ids"}
{"$type": "send_avatar_ids", "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"string []The avatar IDs. If empty, data for all avatars in the scene will be sent.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_fast_avatars

Send the position and rotation of each avatar in the scene. This is slightly faster than SendAvatars, and FastAvatars compresses much better than Avatars. However, FastAvatars doesn't contain avatar IDs, which makes it harder to use. See: send_avatar_ids which serializes the avatar IDs in the same order as the data in FastAvatars.

  • Sends data: This command instructs the build to send output data.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: send_avatars
{"$type": "send_fast_avatars"}
{"$type": "send_fast_avatars", "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"string []The avatar IDs. If empty, data for all avatars in the scene will be sent.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_fast_image_sensors

Send the and rotation of each avatar's camera in the scene. This is slightly faster than SendImageSensors, and FastImageSensors compresses much better than ImageSensors. However, FastImageSensors is missing a lot of information contained in ImageSensors, including avatar IDs, making it harder to use. See: send_avatar_ids which serializes the avatar IDs in the same order as the data in FastImageSensors.

  • Sends data: This command instructs the build to send output data.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: send_image_sensors
{"$type": "send_fast_image_sensors"}
{"$type": "send_fast_image_sensors", "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"string []The avatar IDs. If empty, data for all avatars in the scene will be sent.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

SendFixedLengthObjectDataCommand

Abstract base class for sending object data where the size of the output data is the same on every communicate call.


send_fast_transforms

Send FastTransforms output data. This is slightly faster than SendTransforms, and FastTransforms compresses much better than Transforms. However, FastTransforms excludes some data (see output data documentation) and it is also harder to use. See: send_object_ids which serializes the object IDs in the same order as the data in FastTransforms.

  • Sends data: This command instructs the build to send output data.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: send_transforms
{"$type": "send_fast_transforms"}
{"$type": "send_fast_transforms", "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []Send data for objects with these IDs. If this is empty, data for all objects will be sent.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_object_ids

Send the IDs of all Rigidbody objects (models and composite sub-objects) in the scene. The object IDs are sorted.

  • Sends data: This command instructs the build to send output data.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: send_transforms
{"$type": "send_object_ids"}
{"$type": "send_object_ids", "ids": [], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []Send data for objects with these IDs. If this is empty, data for all objects will be sent.[]
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

SendSingleDataCommand

These commands send a single data object.


send_audio_sources

Send data regarding whether each object in the scene is currently playing a sound.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_audio_sources"}
{"$type": "send_audio_sources", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_avatar_transform_matrices

Send 4x4 transform matrix data for all avatars in the scene.

  • Sends data: This command instructs the build to send output data.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: send_avatars
{"$type": "send_avatar_transform_matrices"}
{"$type": "send_avatar_transform_matrices", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_categories

Send data for the category names and colors of each object in the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_categories"}
{"$type": "send_categories", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_drones

Send data for each drone in the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_drones"}
{"$type": "send_drones", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_dynamic_composite_objects

Send dynamic data for every composite object in the scene.

{"$type": "send_dynamic_composite_objects"}
{"$type": "send_dynamic_composite_objects", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_dynamic_empty_objects

Send the positions of each empty object in the scene.

{"$type": "send_dynamic_empty_objects"}
{"$type": "send_dynamic_empty_objects", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_dynamic_robots

Send dynamic robot data for each robot in the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_dynamic_robots"}
{"$type": "send_dynamic_robots", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_framerate

Send the build's framerate information.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_framerate"}
{"$type": "send_framerate", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_humanoids

Send transform (position, rotation, etc.) data for humanoids in the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_humanoids", "ids": [0, 1, 2]}
{"$type": "send_humanoids", "ids": [0, 1, 2], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []The IDs of the humanoids. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_junk

Send junk data.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_junk"}
{"$type": "send_junk", "length": 100000, "frequency": "once"}
ParameterTypeDescriptionDefault
"length"intThe amount of junk.100000
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_keyboard

Request keyboard input data.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_keyboard"}
{"$type": "send_keyboard", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_lights

Send data for each directional light and point light in the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_lights"}
{"$type": "send_lights", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_obi_particles

Send particle data for all Obi actors in the scene.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation

  • Sends data: This command instructs the build to send output data.

{"$type": "send_obi_particles"}
{"$type": "send_obi_particles", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_post_process

Send post-processing values.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_post_process"}
{"$type": "send_post_process", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_replicant_segmentation_colors

Send the segmentationColor of each Replicant in the scene.

{"$type": "send_replicant_segmentation_colors"}
{"$type": "send_replicant_segmentation_colors", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_scene

Send streamed scene metadata.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_scene"}
{"$type": "send_scene", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_scene_regions

Receive data about the sub-regions within a scene in the scene. Only send this command after initializing the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_scene_regions"}
{"$type": "send_scene_regions", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_static_composite_objects

Send static data for every composite object in the scene.

{"$type": "send_static_composite_objects"}
{"$type": "send_static_composite_objects", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_static_empty_objects

Send the IDs of each empty object and the IDs of their parent objects.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_static_empty_objects"}
{"$type": "send_static_empty_objects", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_vr_rig

Send data for a VR Rig currently in the scene.

  • Sends data: This command instructs the build to send output data.

  • VR: This command will only work if you've already sent create_vr_rig.

{"$type": "send_vr_rig"}
{"$type": "send_vr_rig", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

SendObjectsBlockCommand

These commands send data about cached objects (models, avatars, etc.)


send_flex_particles

Send Flex particles data.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_flex_particles", "ids": [1, 2, 3]}
{"$type": "send_flex_particles", "ids": [1, 2, 3], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int[]The IDs of the objects. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_meshes

Send mesh data. All requested objects MUST have readable meshes; otherwise, this command will throw unhandled C++ errors. To determine whether an object has a readable mesh, check if: record.flex == True For more information, read: Documentation/python/librarian/model_librarian.md

  • Expensive: This command is computationally expensive.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_meshes", "ids": [1, 2, 3]}
{"$type": "send_meshes", "ids": [1, 2, 3], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int[]The IDs of the objects. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

SendObjectsDataCommand

These commands send data about cached objects (models, avatars, etc.)


send_albedo_colors

Send the main albedo color of each object in the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_albedo_colors", "ids": [0, 1, 2]}
{"$type": "send_albedo_colors", "ids": [0, 1, 2], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []The IDs of the objects. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_bounds

Send rotated bounds data of objects in the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_bounds", "ids": [0, 1, 2]}
{"$type": "send_bounds", "ids": [0, 1, 2], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []The IDs of the objects. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_euler_angles

Send the rotations of each object expressed as Euler angles.

  • Sends data: This command instructs the build to send output data.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: send_transforms
{"$type": "send_euler_angles", "ids": [0, 1, 2]}
{"$type": "send_euler_angles", "ids": [0, 1, 2], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []The IDs of the objects. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_local_transforms

Send Transform (position and rotation) data of objects in the scene relative to their parent object.

  • Sends data: This command instructs the build to send output data.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: send_transforms
{"$type": "send_local_transforms", "ids": [0, 1, 2]}
{"$type": "send_local_transforms", "ids": [0, 1, 2], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []The IDs of the objects. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_models

Send name and URL of each model in the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_models", "ids": [0, 1, 2]}
{"$type": "send_models", "ids": [0, 1, 2], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []The IDs of the objects. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_rigidbodies

Send Rigidbody (velocity, angular velocity, etc.) data of objects in the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_rigidbodies", "ids": [0, 1, 2]}
{"$type": "send_rigidbodies", "ids": [0, 1, 2], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []The IDs of the objects. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_scales

Send Scales data of objects in the scene. The scales are the worldspace scales rather than a factor. Send scale_object_to, not scale_object

  • Sends data: This command instructs the build to send output data.

{"$type": "send_scales", "ids": [0, 1, 2]}
{"$type": "send_scales", "ids": [0, 1, 2], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []The IDs of the objects. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_segmentation_colors

Send segmentation color data for objects in the scene.

  • Sends data: This command instructs the build to send output data.

  • Expensive: This command is computationally expensive.

{"$type": "send_segmentation_colors", "ids": [0, 1, 2]}
{"$type": "send_segmentation_colors", "ids": [0, 1, 2], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []The IDs of the objects. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_static_rigidbodies

Send static rigidbody data (mass, kinematic state, etc.) of objects in the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_static_rigidbodies", "ids": [0, 1, 2]}
{"$type": "send_static_rigidbodies", "ids": [0, 1, 2], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []The IDs of the objects. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_transforms

Send Transform (position and rotation) data of objects in the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_transforms", "ids": [0, 1, 2]}
{"$type": "send_transforms", "ids": [0, 1, 2], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []The IDs of the objects. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_transform_matrices

Send 4x4 matrix data for each object, describing their positions and rotations.

  • Sends data: This command instructs the build to send output data.

  • Rarely used: This command is very specialized; it's unlikely that this is the command you want to use.

    • Use this command instead: send_transforms
{"$type": "send_transform_matrices", "ids": [0, 1, 2]}
{"$type": "send_transform_matrices", "ids": [0, 1, 2], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []The IDs of the objects. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_volumes

Send spatial volume data of objects in the scene. Volume is calculated from the physics colliders; it is an approximate value.

  • Sends data: This command instructs the build to send output data.

  • Expensive: This command is computationally expensive.

  • Debug-only: This command is only intended for use as a debug tool or diagnostic tool. It is not compatible with ordinary TDW usage.

{"$type": "send_volumes", "ids": [0, 1, 2]}
{"$type": "send_volumes", "ids": [0, 1, 2], "frequency": "once"}
ParameterTypeDescriptionDefault
"ids"int []The IDs of the objects. If this list is undefined or empty, the build will return data for all objects.
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

SendReplicantsCommand

These commands send Replicants output data for different types of Replicants.


send_replicants

Send data of each Replicant in the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_replicants"}
{"$type": "send_replicants", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_wheelchair_replicants

Send data of each WheelchairReplicant in the scene.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_wheelchair_replicants"}
{"$type": "send_wheelchair_replicants", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

SendVrCommand

These commands send data that is specific to certain types of VR rigs.


send_fove

Send FOVE headset data.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_fove"}
{"$type": "send_fove", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_leap_motion

Send Leap Motion hand tracking data.

  • Sends data: This command instructs the build to send output data.

{"$type": "send_leap_motion"}
{"$type": "send_leap_motion", "max_num_collisions_per_bone": 5, "frequency": "once"}
ParameterTypeDescriptionDefault
"max_num_collisions_per_bone"intThe maximum number of collisions per bone that will be returned in the output data.5
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_oculus_touch_buttons

Send data for buttons pressed on Oculus Touch controllers.

  • Sends data: This command instructs the build to send output data.

  • VR: This command will only work if you've already sent create_vr_rig.

{"$type": "send_oculus_touch_buttons"}
{"$type": "send_oculus_touch_buttons", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

send_static_oculus_touch

Send static data for the Oculus Touch rig.

  • Sends data: This command instructs the build to send output data.

  • VR: This command will only work if you've already sent create_vr_rig.

{"$type": "send_static_oculus_touch"}
{"$type": "send_static_oculus_touch", "frequency": "once"}
ParameterTypeDescriptionDefault
"frequency"FrequencyThe frequency at which data is sent."once"

Frequency

Options for when to send data.

ValueDescription
"once"Send the data for this frame only.
"always"Send the data every frame.
"never"Never send the data.

UiCommand

These commands adjust the UI.


add_ui_canvas

Add a UI canvas to the scene. By default, the canvas will be an "overlay" and won't appear in image output data.

{"$type": "add_ui_canvas"}
{"$type": "add_ui_canvas", "canvas_id": 0}
ParameterTypeDescriptionDefault
"canvas_id"intThe unique ID of the UI canvas.0

attach_ui_canvas_to_avatar

Attach a UI canvas to an avatar. This allows the UI to appear in image output data.

{"$type": "attach_ui_canvas_to_avatar"}
{"$type": "attach_ui_canvas_to_avatar", "avatar_id": "a", "plane_distance": 0.101, "canvas_id": 0}
ParameterTypeDescriptionDefault
"avatar_id"stringThe ID of the avatar."a"
"plane_distance"floatThe distance from the camera to the UI canvas. This should be slightly further than the near clipping plane.0.101
"canvas_id"intThe unique ID of the UI canvas.0

attach_ui_canvas_to_vr_rig

Attach a UI canvas to the head camera of a VR rig.

  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "attach_ui_canvas_to_vr_rig"}
{"$type": "attach_ui_canvas_to_vr_rig", "plane_distance": 1, "canvas_id": 0}
ParameterTypeDescriptionDefault
"plane_distance"floatThe distance from the camera to the UI canvas.1
"canvas_id"intThe unique ID of the UI canvas.0

destroy_all_ui_canvases

Destroy all UI canvases in the scene. In this command, the canvas_id parameter is ignored.

{"$type": "destroy_all_ui_canvases"}
{"$type": "destroy_all_ui_canvases", "canvas_id": 0}
ParameterTypeDescriptionDefault
"canvas_id"intThe unique ID of the UI canvas.0

destroy_ui_canvas

Destroy a UI canvas and all of its UI elements.

{"$type": "destroy_ui_canvas"}
{"$type": "destroy_ui_canvas", "canvas_id": 0}
ParameterTypeDescriptionDefault
"canvas_id"intThe unique ID of the UI canvas.0

UiElementCommand

These commands add or adjust UI elements such as text or images.

AddUiCommand

These commands add UI elements to the scene.


add_ui_text

Add UI text to the scene.

{"$type": "add_ui_text", "text": "string", "id": 1}
{"$type": "add_ui_text", "text": "string", "id": 1, "font_size": 14, "color": {"r": 1, "g": 1, "b": 1, "a": 1}, "anchor": {"x": 0.5, "y": 0.5}, "pivot": {"x": 0.5, "y": 0.5}, "position": {"x": 0, "y": 0}, "canvas_id": 0}
ParameterTypeDescriptionDefault
"text"stringThe text.
"font_size"intThe font size.14
"color"ColorThe color of the UI element.{"r": 1, "g": 1, "b": 1, "a": 1}
"anchor"Vector2The anchor of the UI element. The values must be from 0 (left or bottom) to 1 (right or top). By default, the anchor is in the center.{"x": 0.5, "y": 0.5}
"pivot"Vector2The pivot of the UI element. The values must be from 0 (left or bottom) to 1 (right or top). By default, the pivot is in the center.{"x": 0.5, "y": 0.5}
"position"Vector2IntThe anchor position of the UI element in pixels. x is lateral, y is vertical. The anchor position is not the true pixel position. For example, if the anchor is {"x": 0, "y": 0} and the position is {"x": 0, "y": 0}, the UI element will be in the bottom-left of the screen.{"x": 0, "y": 0}
"id"intThe unique ID of the UI element.
"canvas_id"intThe unique ID of the UI canvas.0

AddUiImageCommand

These commands add UI images to the scene.


add_ui_cutout

Add a UI "cutout" image to the scene. This will draw a hole in a base UI element. The cutout image must be RGBA32.

{"$type": "add_ui_cutout", "base_id": 1, "image": "string", "size": {"x": 1, "y": 2}, "id": 1}
{"$type": "add_ui_cutout", "base_id": 1, "image": "string", "size": {"x": 1, "y": 2}, "id": 1, "scale_factor": {"x": 1, "y": 1}, "anchor": {"x": 0.5, "y": 0.5}, "pivot": {"x": 0.5, "y": 0.5}, "position": {"x": 0, "y": 0}, "canvas_id": 0}
ParameterTypeDescriptionDefault
"base_id"intThe cutout will draw a hole in the image with this ID.
"image"stringbase64 string representation of the image byte array.
"size"Vector2IntThe actual pixel size of the image.
"scale_factor"Vector2Scale the image by this factor.{"x": 1, "y": 1}
"anchor"Vector2The anchor of the UI element. The values must be from 0 (left or bottom) to 1 (right or top). By default, the anchor is in the center.{"x": 0.5, "y": 0.5}
"pivot"Vector2The pivot of the UI element. The values must be from 0 (left or bottom) to 1 (right or top). By default, the pivot is in the center.{"x": 0.5, "y": 0.5}
"position"Vector2IntThe anchor position of the UI element in pixels. x is lateral, y is vertical. The anchor position is not the true pixel position. For example, if the anchor is {"x": 0, "y": 0} and the position is {"x": 0, "y": 0}, the UI element will be in the bottom-left of the screen.{"x": 0, "y": 0}
"id"intThe unique ID of the UI element.
"canvas_id"intThe unique ID of the UI canvas.0

add_ui_image

Add a UI image to the scene. Note that the size parameter must match the actual pixel size of the image.

{"$type": "add_ui_image", "image": "string", "size": {"x": 1, "y": 2}, "id": 1}
{"$type": "add_ui_image", "image": "string", "size": {"x": 1, "y": 2}, "id": 1, "rgba": True, "color": {"r": 1, "g": 1, "b": 1, "a": 1}, "raycast_target": True, "scale_factor": {"x": 1, "y": 1}, "anchor": {"x": 0.5, "y": 0.5}, "pivot": {"x": 0.5, "y": 0.5}, "position": {"x": 0, "y": 0}, "canvas_id": 0}
ParameterTypeDescriptionDefault
"rgba"boolIf True, this is an RGBA image. If False, this is an RGB image.True
"color"ColorThe color of the UI element.{"r": 1, "g": 1, "b": 1, "a": 1}
"raycast_target"boolIf True, raycasts will hit the UI element.True
"image"stringbase64 string representation of the image byte array.
"size"Vector2IntThe actual pixel size of the image.
"scale_factor"Vector2Scale the image by this factor.{"x": 1, "y": 1}
"anchor"Vector2The anchor of the UI element. The values must be from 0 (left or bottom) to 1 (right or top). By default, the anchor is in the center.{"x": 0.5, "y": 0.5}
"pivot"Vector2The pivot of the UI element. The values must be from 0 (left or bottom) to 1 (right or top). By default, the pivot is in the center.{"x": 0.5, "y": 0.5}
"position"Vector2IntThe anchor position of the UI element in pixels. x is lateral, y is vertical. The anchor position is not the true pixel position. For example, if the anchor is {"x": 0, "y": 0} and the position is {"x": 0, "y": 0}, the UI element will be in the bottom-left of the screen.{"x": 0, "y": 0}
"id"intThe unique ID of the UI element.
"canvas_id"intThe unique ID of the UI canvas.0

SetUiElementCommand

These commands set parameters of a UI element in the scene.


destroy_ui_element

Destroy a UI element in the scene.

{"$type": "destroy_ui_element", "id": 1}
{"$type": "destroy_ui_element", "id": 1, "canvas_id": 0}
ParameterTypeDescriptionDefault
"id"intThe unique ID of the UI element.
"canvas_id"intThe unique ID of the UI canvas.0

set_ui_color

Set the color of a UI image or text.

{"$type": "set_ui_color", "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}, "id": 1}
{"$type": "set_ui_color", "color": {"r": 0.219607845, "g": 0.0156862754, "b": 0.6901961, "a": 1.0}, "id": 1, "canvas_id": 0}
ParameterTypeDescriptionDefault
"color"ColorThe new color.
"id"intThe unique ID of the UI element.
"canvas_id"intThe unique ID of the UI canvas.0

set_ui_element_depth

Set the depth (z value) of a UI element relative its canvas (not its camera).

{"$type": "set_ui_element_depth", "depth": 0.125, "id": 1}
{"$type": "set_ui_element_depth", "depth": 0.125, "id": 1, "canvas_id": 0}
ParameterTypeDescriptionDefault
"depth"floatThe depth (z value) in meters.
"id"intThe unique ID of the UI element.
"canvas_id"intThe unique ID of the UI canvas.0

set_ui_element_position

Set the position of a UI element.

{"$type": "set_ui_element_position", "id": 1}
{"$type": "set_ui_element_position", "id": 1, "position": {"x": 0, "y": 0}, "canvas_id": 0}
ParameterTypeDescriptionDefault
"position"Vector2IntThe anchor position of the UI element in pixels. x is lateral, y is vertical. The anchor position is not the true pixel position. For example, if the anchor is {"x": 0, "y": 0} and the position is {"x": 0, "y": 0}, the UI element will be in the bottom-left of the screen.{"x": 0, "y": 0}
"id"intThe unique ID of the UI element.
"canvas_id"intThe unique ID of the UI canvas.0

set_ui_element_rotation

Rotate a UI element to a new angle.

{"$type": "set_ui_element_rotation", "angle": 0.125, "id": 1}
{"$type": "set_ui_element_rotation", "angle": 0.125, "id": 1, "canvas_id": 0}
ParameterTypeDescriptionDefault
"angle"floatThe UI element's new rotation in degrees.
"id"intThe unique ID of the UI element.
"canvas_id"intThe unique ID of the UI canvas.0

set_ui_element_size

Set the size of a UI element.

{"$type": "set_ui_element_size", "size": {"x": 1, "y": 2}, "id": 1}
{"$type": "set_ui_element_size", "size": {"x": 1, "y": 2}, "id": 1, "canvas_id": 0}
ParameterTypeDescriptionDefault
"size"Vector2IntThe pixel size of the UI element.
"id"intThe unique ID of the UI element.
"canvas_id"intThe unique ID of the UI canvas.0

set_ui_text

Set the text of a Text object that is already on the screen.

{"$type": "set_ui_text", "text": "string", "id": 1}
{"$type": "set_ui_text", "text": "string", "id": 1, "canvas_id": 0}
ParameterTypeDescriptionDefault
"text"stringThe new text.
"id"intThe unique ID of the UI element.
"canvas_id"intThe unique ID of the UI canvas.0

VideoCaptureCommand

These commands start and stop audio-visual capture using ffmpeg. These commands assume that you've already installed ffmpeg on your computer.


stop_video_capture

Stop ongoing video capture.

{"$type": "stop_video_capture"}

StartVideoCaptureCommand

These commands start video capture using ffmpeg. Because ffmpeg arguments are platform-specific, you must use the platform-specific command, e.g. start_video_capture_windows


start_video_capture_linux

Start video capture using ffmpeg. This command can only be used on Linux.

{"$type": "start_video_capture_linux", "output_path": "string"}
{"$type": "start_video_capture_linux", "output_path": "string", "display": 0, "screen": 0, "audio_device": "alsa_output.pci-0000_00_1f.3.analog-stereo.monitor", "ffmpeg": "", "overwrite": True, "framerate": 60, "position": {"x": 0, "y": 0}, "audio": True, "audio_codec": "aac", "video_codec": "h264", "preset": "ultrafast", "qp": 1, "pixel_format": "yuv420p", "log_args": False, "override_args": ""}
ParameterTypeDescriptionDefault
"display"intThe X11 display index. To review your X11 setup: cat /etc/X11/xorg.conf0
"screen"intThe X11 screen index. To review your X11 setup: cat /etc/X11/xorg.conf0
"audio_device"stringThe pulseaudio device name. Ignored if audio == False. To get a list of devices: pactl list sourcesgrep output
"output_path"stringThe absolute path to the output file, e.g. /home/user/video.mp4
"ffmpeg"stringThe path to the ffmpeg process. Set this parameter only if you're using a non-standard path.""
"overwrite"boolIf True, overwrite the video if it already exists.True
"framerate"intThe framerate of the output video.60
"position"Vector2IntThe top-left corner of the screen region that will be captured. On Windows, this is ignored if window_capture == True.{"x": 0, "y": 0}
"audio"boolIf True, audio will be captured.True
"audio_codec"stringThe audio codec. You should usually keep this set to the default value. See: https://ffmpeg.org/ffmpeg-codecs.html"aac"
"video_codec"stringThe video codec. You should usually keep this set to the default value. See: https://ffmpeg.org/ffmpeg-codecs.html"h264"
"preset"stringH.264 video encoding only. A preset of parameters that affect encoding speed and compression. See: https://trac.ffmpeg.org/wiki/Encode/H.264"ultrafast"
"qp"intH.264 video encoding only. This controls the video quality. 0 is lossless.1
"pixel_format"stringThe pixel format. You should almost never need to set this to anything other than the default value."yuv420p"
"log_args"boolIf True, log the command-line arguments to the player log (this can additionally be received by the controller via the send_log_messages command).False
"override_args"stringIf not empty, replace the ffmpeg arguments with this string. Usually, you won't want to set this. If you want to use ffmpeg for something other than screen recording, consider launching it from a Python script using subprocess.call().""

start_video_capture_osx

Start video capture using ffmpeg. This command can only be used on OS X.

{"$type": "start_video_capture_osx", "output_path": "string"}
{"$type": "start_video_capture_osx", "output_path": "string", "video_device": 1, "audio_device": 0, "size_scale_factor": 2, "position_scale_factor": 2, "ffmpeg": "", "overwrite": True, "framerate": 60, "position": {"x": 0, "y": 0}, "audio": True, "audio_codec": "aac", "video_codec": "h264", "preset": "ultrafast", "qp": 1, "pixel_format": "yuv420p", "log_args": False, "override_args": ""}
ParameterTypeDescriptionDefault
"video_device"intThe video device index. To get a list of devices: ffmpeg -f avfoundation -list_devices true -i ""1
"audio_device"intThe audio device index. Ignored if audio == False. To get a list of devices: ffmpeg -f avfoundation -list_devices true -i ""0
"size_scale_factor"intOn retina screens, the actual window size is scaled. Set this scale factor to scale the video capture size.2
"position_scale_factor"intOn retina screens, the actual window size is scaled. Set this scale factor to scale the video capture position.2
"output_path"stringThe absolute path to the output file, e.g. /home/user/video.mp4
"ffmpeg"stringThe path to the ffmpeg process. Set this parameter only if you're using a non-standard path.""
"overwrite"boolIf True, overwrite the video if it already exists.True
"framerate"intThe framerate of the output video.60
"position"Vector2IntThe top-left corner of the screen region that will be captured. On Windows, this is ignored if window_capture == True.{"x": 0, "y": 0}
"audio"boolIf True, audio will be captured.True
"audio_codec"stringThe audio codec. You should usually keep this set to the default value. See: https://ffmpeg.org/ffmpeg-codecs.html"aac"
"video_codec"stringThe video codec. You should usually keep this set to the default value. See: https://ffmpeg.org/ffmpeg-codecs.html"h264"
"preset"stringH.264 video encoding only. A preset of parameters that affect encoding speed and compression. See: https://trac.ffmpeg.org/wiki/Encode/H.264"ultrafast"
"qp"intH.264 video encoding only. This controls the video quality. 0 is lossless.1
"pixel_format"stringThe pixel format. You should almost never need to set this to anything other than the default value."yuv420p"
"log_args"boolIf True, log the command-line arguments to the player log (this can additionally be received by the controller via the send_log_messages command).False
"override_args"stringIf not empty, replace the ffmpeg arguments with this string. Usually, you won't want to set this. If you want to use ffmpeg for something other than screen recording, consider launching it from a Python script using subprocess.call().""

start_video_capture_windows

Start video capture using ffmpeg. This command can only be used on Windows.

{"$type": "start_video_capture_windows", "output_path": "string"}
{"$type": "start_video_capture_windows", "output_path": "string", "audio_device": "", "audio_buffer_size": 5, "draw_mouse": False, "ffmpeg": "", "overwrite": True, "framerate": 60, "position": {"x": 0, "y": 0}, "audio": True, "audio_codec": "aac", "video_codec": "h264", "preset": "ultrafast", "qp": 1, "pixel_format": "yuv420p", "log_args": False, "override_args": ""}
ParameterTypeDescriptionDefault
"audio_device"stringThe name of the audio device. Ignored if audio == False. To get a list of devices: ffmpeg -list_devices true -f dshow -i dummy""
"audio_buffer_size"intThe audio buffer size in ms. This should always be greater than 0. Adjust this if the audio doesn't sync with the video. See: https://ffmpeg.org/ffmpeg-devices.html (search for audio_buffer_size).5
"draw_mouse"boolIf True, show the mouse in the video.False
"output_path"stringThe absolute path to the output file, e.g. /home/user/video.mp4
"ffmpeg"stringThe path to the ffmpeg process. Set this parameter only if you're using a non-standard path.""
"overwrite"boolIf True, overwrite the video if it already exists.True
"framerate"intThe framerate of the output video.60
"position"Vector2IntThe top-left corner of the screen region that will be captured. On Windows, this is ignored if window_capture == True.{"x": 0, "y": 0}
"audio"boolIf True, audio will be captured.True
"audio_codec"stringThe audio codec. You should usually keep this set to the default value. See: https://ffmpeg.org/ffmpeg-codecs.html"aac"
"video_codec"stringThe video codec. You should usually keep this set to the default value. See: https://ffmpeg.org/ffmpeg-codecs.html"h264"
"preset"stringH.264 video encoding only. A preset of parameters that affect encoding speed and compression. See: https://trac.ffmpeg.org/wiki/Encode/H.264"ultrafast"
"qp"intH.264 video encoding only. This controls the video quality. 0 is lossless.1
"pixel_format"stringThe pixel format. You should almost never need to set this to anything other than the default value."yuv420p"
"log_args"boolIf True, log the command-line arguments to the player log (this can additionally be received by the controller via the send_log_messages command).False
"override_args"stringIf not empty, replace the ffmpeg arguments with this string. Usually, you won't want to set this. If you want to use ffmpeg for something other than screen recording, consider launching it from a Python script using subprocess.call().""

VrCommand

These commands utilize VR in TDW.


allow_fove_headset_movement

Handle whether to send the Fove Headset position or not.

  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "allow_fove_headset_movement"}
{"$type": "allow_fove_headset_movement", "allow": False}
ParameterTypeDescriptionDefault
"allow"boolWhether or not to send positional information from the headset. Default is to NOT send position, just orientation.False

allow_fove_headset_rotation

Handle whether to send the Fove Headset orientation or not.

  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "allow_fove_headset_rotation"}
{"$type": "allow_fove_headset_rotation", "allow": True}
ParameterTypeDescriptionDefault
"allow"boolWhether or not to send orientation information from the headset. Default is to send orientation.True

attach_avatar_to_vr_rig

Attach an avatar (A_Img_Caps_Kinematic) to the VR rig in the scene. This avatar will work like all others, i.e it can send images and other data. The avatar will match the position and rotation of the VR rig's head. By default, this feature is disabled because it slows down the simulation's FPS.

  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "attach_avatar_to_vr_rig", "id": "string"}
ParameterTypeDescriptionDefault
"id"stringID of this avatar. Must be unique.

create_vr_obi_colliders

Create Obi colliders for a VR rig if there aren't any.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "create_vr_obi_colliders"}

destroy_vr_rig

Destroy the current VR rig.

  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "destroy_vr_rig"}

refresh_leap_motion_rig

Refresh a Leap Motion rig in the scene. This must be sent whenever new objects are added to the scene after the rig was created.

  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "refresh_leap_motion_rig"}

rotate_vr_rig_by

Rotate the VR rig by an angle.

  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "rotate_vr_rig_by", "angle": 0.125}
ParameterTypeDescriptionDefault
"angle"floatThe angle of rotation in degrees.

set_vr_loading_screen

Show or hide the VR rig's loading screen.

  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "set_vr_loading_screen", "show": True}
ParameterTypeDescriptionDefault
"show"boolIf true, show the loading screen. If false, hide it.

set_vr_obi_collision_material

Set the Obi collision material of the VR rig.

  • Obi: This command initializes utilizes the Obi physics engine, which requires a specialized scene initialization process.See: Obi documentation
  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "set_vr_obi_collision_material"}
{"$type": "set_vr_obi_collision_material", "dynamic_friction": 0.3, "static_friction": 0.3, "stickiness": 0, "stick_distance": 0, "friction_combine": "average", "stickiness_combine": "average"}
ParameterTypeDescriptionDefault
"dynamic_friction"floatPercentage of relative tangential velocity removed in a collision, once the static friction threshold has been surpassed and the particle is moving relative to the surface. 0 means things will slide as if made of ice, 1 will result in total loss of tangential velocity.0.3
"static_friction"floatPercentage of relative tangential velocity removed in a collision. 0 means things will slide as if made of ice, 1 will result in total loss of tangential velocity.0.3
"stickiness"floatAmount of inward normal force applied between objects in a collision. 0 means no force will be applied, 1 will keep objects from separating once they collide.0
"stick_distance"floatMaximum distance between objects at which sticky forces are applied. Since contacts will be generated between bodies within the stick distance, it should be kept as small as possible to reduce the amount of contacts generated.0
"friction_combine"MaterialCombineModeHow is the friction coefficient calculated when two objects involved in a collision have different coefficients. If both objects have different friction combine modes, the mode with the lowest enum index is used."average"
"stickiness_combine"MaterialCombineModeHow is the stickiness coefficient calculated when two objects involved in a collision have different coefficients. If both objects have different stickiness combine modes, the mode with the lowest enum index is used."average"

MaterialCombineMode

Obi collision maerial combine modes.

ValueDescription
"average"
"minimum"
"multiply"
"maximum"

set_vr_resolution_scale

Controls the actual size of eye textures as a multiplier of the device's default resolution.

  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "set_vr_resolution_scale"}
{"$type": "set_vr_resolution_scale", "resolution_scale_factor": 1.0}
ParameterTypeDescriptionDefault
"resolution_scale_factor"floatTexture resolution scale factor. A value greater than 1.0 improves image quality but at a slight performance cost. Range: 0.5 to 1.751.0

show_leap_motion_hands

Visually show or hide Leap Motion hands.

  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "show_leap_motion_hands"}
{"$type": "show_leap_motion_hands", "show": True}
ParameterTypeDescriptionDefault
"show"boolWhether or not to show the visual representation of the Leap Motion hands. If false, hand tracking, grasping etc. will function as normal but the hands will be invisible.True

start_fove_calibration

Start the FOVE headset's internal calibration.

{"$type": "start_fove_calibration"}
{"$type": "start_fove_calibration", "restart": True, "eye_by_eye": "Disabled", "method": "Spiral", "eye_torsion": "Default", "profile_name": "new profile"}
ParameterTypeDescriptionDefault
"restart"boolIf true, restart an ongoing calibration.True
"eye_by_eye"EyeByEyeCalibrationIndicate whether each eye should be calibrated separately or not."Disabled"
"method"CalibrationMethodIndicate the calibration method to use."Spiral"
"eye_torsion"EyeTorsionCalibrationIndicate whether each eye torsion calibration should be run."Default"
"profile_name"stringName to give the new calibration profile. This will typically be a subject's name."new profile"

CalibrationMethod

FOVE calibration methods.

ValueDescription
"Default"Use the calibration method specified in the configuration file (default: single point).
"OnePoint"Use the simple point calibration method (Requires license).
"Spiral"Use the spiral calibration method.
"OnePointWithNoGlassesSpiralWithGlasses"Use the 1-point calibration method for user without eyeglasses, and the spiral calibration method if user has eyeglasses.
"ZeroPoint"Use the zero point calibration method (Requires license).
"DefaultCalibration"Use a premade calibration profile with average human parameters built-in.

EyeByEyeCalibration

Indicate whether each eye should be calibrated separately or not.

ValueDescription
"Default"Use the settings coming from the configuration file (default: Disabled)
"Disabled"Calibrate both eye simultaneously
"Enabled"Calibrate each eye separately, first the left, then the right (Requires license)

EyeTorsionCalibration

Indicate whether each eye torsion calibration should be run.

ValueDescription
"Default"Use the settings coming from the configuration file.
"IfEnabled"Run eye torsion calibration only if the capability is currently enabled.
"Always"Always run eye torsion calibration independently of whether the capability is used.

teleport_vr_rig

Teleport the VR rig to a new position.

  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "teleport_vr_rig", "position": {"x": 1.1, "y": 0.0, "z": 0}}
ParameterTypeDescriptionDefault
"position"Vector3The position to teleport to.

tilt_fove_rig_by

Tilt (pitch) the Fove rig by an angle.

  • VR: This command will only work if you've already sent create_vr_rig.
{"$type": "tilt_fove_rig_by", "angle": 0.125}
ParameterTypeDescriptionDefault
"angle"floatThe angle of rotation in degrees.