Scripting Object Reference

The following is a description of all scripting modules.

ModuleDescription

AnimationModule

The AnimationModule class implements object animation.

AudioModule

The AudioModule class enables sound effects.

CameraInfoModule

The CameraInfoModule class provides access to details about the device camera.

DeviceMotionModule

The DeviceMotionModule class enables device movement detection.

DiagnosticsModule

The DiagnosticsModule class enables diagnostic logging.

FaceGesturesModule

The FaceGesturesModule class enables face orientation detection.

FaceTracking2DModule

The FaceTracking2DModule class enables tracking faces in 2D.

FaceTrackingModule

The FaceTrackingModule class enables tracking faces in 3D.

FontsModule

The FontsModule class is used for working with custom fonts in effects.

HandTrackingModule

The HandTrackingModule class enables hand tracking.

InstructionModule

The InstructionModule class enables effects to provide instructions to the user.

IrisTrackingModule

The IrisTrackingModule class allows you to track the location of people's irises in your effect, to create effects such as eye color replacement.

LightingEstimationModule

The LightingEstimation module encapsulates access to estimations of lighting in the scene.

LiveStreamingModule

The LiveStreamingModule class enables to retrieve information from a live stream from within the effect, such as reactions and comments

LocaleModule

The LocaleModule class encapsulates access to the locale identifier of the device.

MaterialsModule

The Materials module provides access to the materials in an effect.

NativeUIModule

The NativeUI module exposes editable text.

NetworkingModule

The NetworkingModule class enables effects to fetch information from a network. To use the Networking class you must add the Networking capability to the project manifest. You also need to whitelist domains you'd like to access in the Capabilities menu. AR Studio requires the URL passed to the fetch() method to be an HTTPS URL, with a certificate that chains up to a trusted certificate authority. Self-signed and other non-trusted certificates should not be expected to work.

PatchesModule

The PatchesModule module allows interop between JS scripting and the AR Studio patches visual scripting system.

PersistenceModule

The Persistence class encapsulates persistent objects.

PersonSegmentationModule

The PersonSegmentationModule module enables separation of a person from a scene.

RandomModule

The RandomModule class enables random number generation.

ReactiveModule

The ReactiveModule class exposes methods for reactive programming.

SceneModule

The SceneModule class exposes properties and methods to access the objects in a scene.

SceneUnderstandingModule

The SceneUnderstandingModule provides access to details about recognition of real objects captured by the camera

ShadersModule

The ShadersModule exposes APIs to create Visual Shaders using JavaScript.

The following is an explanation of the unique types and concepts specific to the ShadersModule.

TypeA->TypeB is a function that maps TypeA to TypeB. For instance, Point2DSignal->Point4DSignal is a type of a function that maps a Point2DSignal to a Point4DSignal.

Texture2d_1ch is the same as Point2DSignal->ScalarSignal. Texture2d_2ch is the same as Point2DSignal->Point2DSignal. Texture2d_3ch is the same as Point2DSignal->PointSignal. Texture2d_4ch is the same as Point2DSignal->Point4DSignal. TextureSdf is the same as Point2DSignal->ScalarSignal.

Certain functions can accept multiple types. This is denoted by the following generic types: GenericVector can be a ScalarSignal, Point2DSignal, PointSignal, Point4DSignal. GenericMatrix can be a Matrix2, Matrix3, Matrix4. Generic can be a GenericVector, GenericMatrix. GenericFunction is the same as GenericA->GenericB.

When multiple arguments are marked with the same Generic they all have to be of the same type. For instance, in composition(f: GenericA->GenericB, g: GenericA): GenericB both occurrences of GenericA must refer to the same type, as do both occurrences of GenericB. GenericA may, but doesn't have to, be different from GenericB though. E.g. this is valid: composition(f: Point2DSignal->Point4DSignal, g: Point2DSignal): Point4DSignal

Note: Signals returned from methods within this module will not work in any other context.

SvgsModule

The SvgsModule module enables working with SVGs.

TexturesModule

The TexturesModule class enables images, animation sequences, videos, colors, and other visual artifacts to be combined to form materials.

TimeModule

The TimeModule class enables time-based events.

TouchGesturesModule

The TouchGesturesModule class enables touch gesture detection.

UnitsModule

The UnitsModule class provides functionality for converting values into world-space units.

WeatherModule

The WeatherModule class provides information about the current weather