Scripting Object Reference
Scripting Object Reference Overview

Scripting Object Reference

The following is a description of all scripting modules.

AnimationModule

The AnimationModule class implements object animation.

Classes

ClassDescription
ArrayOfScalarSamplersThe ArrayOfScalarSamplers class describes an array of scalar samplers.
ArrayOfScalarSignalsThe ArrayOfScalarSignals class describes an array of scalar signals.
ColorSamplerThe ColorSampler class encapsulates a color sampler.
DriverThe Driver class encapsulates an animation driver.
RotationSamplerThe RotationSampler class is an animation sampler for object rotation.
SamplerFactoryThe SamplerFactory class creates different types of animation samplers.
ScalarSamplerThe ScalarSampler class encapsulates a scalar value sampler.
SignalRecordThe SignalRecord class encapsulates recording data for a value signal
SignalRecorderThe SignalRecorder class enables recording and playback of signal values
TimeDriverThe TimeDriver class controls an animation.
ValueDriverThe ValueDriver class controls an animation value.

AudioModule

The AudioModule class enables sound effects.

Classes

ClassDescription
PlaybackControllerThe PlaybackController class enables control of audio playback.

BlocksModule

The BlocksModule class provides access to inputs and outputs of blocks.

CameraInfoModule

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

Enums

EnumDescription
CameraPositionThe CameraPosition enum describes the direction the camera is facing.

DeepLinkModule

The DeepLinkModule class exposes methods and properties to read the values that an external app sent to an effect.

DeviceMotionModule

The DeviceMotionModule class enables device movement detection.

DiagnosticsModule

The DiagnosticsModule class enables diagnostic logging.

Classes

ClassDescription
TypeSystemMetadataThe TypeSystemMetadata class contains type system metadata.

FaceGesturesModule

The FaceGesturesModule class enables face orientation detection.

FaceTracking2DModule

The FaceTracking2DModule class enables tracking faces in 2D.

Classes

ClassDescription
Face2DThe Face2D class exposes details of a tracked face.

FaceTrackingModule

The FaceTrackingModule class enables tracking faces in 3D.

Classes

ClassDescription
CheekThe Cheek class exposes the details of a detected cheek.
ChinThe Chin class exposes the details of a detected chin.
EyeThe Eye class exposes the details of a detected eye.
EyebrowThe Eyebrow class exposes the details of a detected eyebrow.
FaceThe Face class exposes details of a tracked face.
ForeheadThe Forehead class exposes the details of a detected forehead.
MouthThe Mouth class exposes the details of a detected mouth.
NoseThe Nose class exposes the details of a detected nose.

FontsModule

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

Classes

ClassDescription
FontIdThe FontsId class identifies a font in an effect.

HandTrackingModule

The HandTrackingModule class enables hand tracking.

Classes

ClassDescription
HandThe Hand class describes a hand detected in a scene.

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.

Classes

ClassDescription
EyeballThe Eyeball class exposes details of a tracked eyeball.

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.

Classes

ClassDescription
LiveStreamingCommentsThe LiveStreamingComments class provides access to the Facebook Live comments stream.
LiveStreamingReactionsThe LiveStreamingReactions class provides access to the Facebook Live reactions stream. For low volumes of reactions this will correspond to the stream of reaction bubbles that float by the broadcast, for higher volumes of reactions this will an approximate count of how many times the reaction button was tapped, with some rate limiting per-user. This number will not correspond to the number of reactions displayed elsewhere because that number only counts each user's reaction once.

Enums

EnumDescription
StateThe LiveStreamingModule.State enum describes the state of a live stream.

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.

Classes

ClassDescription
BlendedMaterialThe BlendedMaterial class encapsulates materials blended from multiple textures.
BlendShapeToWarpMapMaterialThe BlendShapeToWarpMapMaterial class.
ColorPaintMaterialThe ColorPaintMaterial class encapsulates a face-paint material.
ComposedMaterialThe ComposedMaterial class encapsulates patch asset materials.
DefaultMaterialThe DefaultMaterial class encapsulates an image-based material.
MaterialBaseThe MaterialBase class exposes properties common to all material types.
MetallicRoughnessPbrMaterialThe MetallicRoughnessPbrMaterial class encapsulates physically based materials.
RetouchingMaterialThe RetouchingMaterial class encapsulates parameters which define the extend of certain beautification techniques.
TextureTransformThe TextureTransform class encapsulates scaling and translation transforms about a textures UV axis.

Enums

EnumDescription
BlendModeThe BlendMode enum describes how material is blended.
CullModeThe CullMode enum describes how material is culled.

NativeUIModule

The NativeUI module exposes editable text.

Classes

ClassDescription
PickerThe Picker class describes an object controlling native picker behavior.
SliderThe Slider class describes an object controlling native slider behavior.

PatchesModule

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

Classes

ClassDescription
PatchesInputsThe PatchesInputs class encapsulates methods for setting inputs to the Patch Editor.
PatchesOutputsThe PatchesOutputs class encapsulates methods for getting outputs of the Patch Editor.

PersistenceModule

The Persistence class encapsulates persistent objects.

Classes

ClassDescription
StorageScopeThe StorageScope class encapsulates different methods of storage for persistent objects.

PersonSegmentationModule

The PersonSegmentationModule class enables the separation of a person from a scene.

RandomModule

The RandomModule class enables random number generation.

ReactiveModule

The ReactiveModule class exposes methods for reactive programming.

Classes

ClassDescription
BoolSignalThe BoolSignal class monitors a boolean value.
BoolSignalHistoryThe BoolSignalHistory encapsulates methods for accessing values of BoolSignal from previous frames.
BoundingBoxSignalThe BoundingBoxSignal class monitors bounding box values.
BoundingBoxSignalHistoryThe BoundingBoxSignalHistory encapsulates methods for accessing values of BoundingBoxSignal from previous frames.
ColorSignalThe ColorSignal class monitors a color.
EventSourceThe EventSource class provides methods for monitoring signals.
EventSourceHistoryThe EventSourceHistory encapsulates methods for accessing values of EventSource from previous frames.
HsvaSignalThe HsvaSignal class monitors a HSVA color value.
ISignalThe ISignal interface. The base class for ScalarSignal, PointSignal, VectorSignal, BoolSignal, and StringSignal
Point2DThe Point2D class contains a 2D coordinate.
Point2DSignalThe Point2DSignal class monitors a 2D coordinate.
Point2DSignalHistoryThe Point2DSignalHistory encapsulates methods for accessing values of Point2DSignal from previous frames.
Point3DThe Point3D class contains a 3D coordinate.
Point4DSignalThe Point4DSignal class monitors a 4D coordinate.
Point4DSignalHistoryThe Point4DSignalHistory encapsulates methods for accessing values of Point4DSignal from previous frames.
PointSignalThe PointSignal class monitors a 3D coordinate.
PointSignalHistoryThe PointSignalHistory encapsulates methods for accessing values of PointSignal from previous frames.
PrimitiveOrShaderSignalThe PrimitiveOrShader represents a primitive or shader signal.
PrimitiveOrShaderSignalHistoryThe PrimitiveOrShaderSignalHistory encapsulates methods for accessing values of PrimitiveOrShaderSignal from previous frames.
QuaternionSignalThe QuaternionSignal class monitors rotation in a quaternion representation.
QuaternionSignalHistoryThe QuaternionSignalHistory encapsulates methods for accessing values of QuaternionSignal from previous frames.
RgbaSignalThe RgbaSignal class monitors a RGBA color value.
RotationThe Rotation class encapsulates an object's rotation in a quaternion representation.
ScalarSignalThe ScalarSignal class monitors a numerical value.
ScalarSignalHistoryThe ScalarSignalHistory encapsulates methods for accessing values of ScalarSignal from previous frames.
ShaderSignalThe ShaderSignal represents a shader signal. Scalar and Vector signals can automatically be converted to a ShaderSignal.
ShaderSignalHistoryThe ShaderSignalHistory encapsulates methods for accessing values of ShaderSignal from previous frames.
StringSignalThe StringSignal class monitors a string value.
StringSignalHistoryThe StringSignalHistory encapsulates methods for accessing values of StringSignal from previous frames.
SubscriptionThe Subscription class implements object value monitoring.
TransformSignalThe TransformSignal class monitors a scene transform.
TransformSignalHistoryThe TransformSignalHistory encapsulates methods for accessing values of TransformSignal from previous frames.
VectorSignalThe VectorSignal class monitors a vector.
VectorSignalHistoryThe VectorSignalHistory encapsulates methods for accessing values of VectorSignal from previous frames.

Enums

EnumDescription
AntiderivativeOverflowBehaviourThe AntiderivativeOverflowBehaviour enum describes the recovery technique used when an antiderivative overflows.

SceneModule

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

Classes

ClassDescription
AmbientLightSourceThe AmbientLightSource class describes an ambient lighting source.
BlendShapeThe BlendShape class describes a shape attached to a mesh or face mesh which can be used to change the shape of that mesh.
BlendShapesMeshThe BlendShapesMesh class encapsulates multiple blendable meshes.
BlockInstanceInputsThe BlockInstanceInputs class encapsulates methods for setting inputs to the block instance.
BlockInstanceOutputsThe BlockInstanceOutputs class encapsulates methods for getting outputs of the block instance.
BlockSceneRootThe BlockSceneRoot class describes the root scene object of a block.
BoundingBoxThe BoundingBox class describes the bounds of a scene element in the local coordinate system.
Bounds2DThe Bounds2D class describes the bounds of a scene element.
CameraThe Camera class exposes details about the device camera focal area.
CameraVisibilityThe CameraVisibility class describes whether or not an object is visible from various camera views.
CanvasThe Canvas class describes a scene canvas.
DirectionalLightSourceThe DirectionalLightSource class describes a directional light source.
DynamicExtrusionThe DynamicExtrusion class provides functionality for creating extruded 3D objects using a brush.
FaceAnchorThe FaceAnchor class describes an anchored face.
FaceMeshThe FaceMesh class describes a face mesh.
FaceTrackerThe FaceTracker class propagates details of detected faces to the scene.
FocalDistanceThe FocalDistance class describes a focal distance.
FocalPlaneThe FocalPlane class exposes details about the focal plane of the device camera.
HandTrackerThe HandTracker class encapsulates a hand tracking object.
JointThe Joint class encapsulates a joint scene object.
MeshThe Mesh class describes a scene mesh.
OutputVisibilityThe OutputVisibility class describes whether or not an object is visible from various outputs.
ParticleSystemThe ParticleSystem class implements the particle management system for the scene.
ParticleTypeDescriptionThe ParticleTypeDescription class provides functionality for setting particle sprite densities in the scene.
ParticleTypeDescriptionsThe ParticleTypeDescriptions class provides a container for particle type descriptions.
PlanarDivThe PlanarDiv class describes a div on a plane.
PlanarFlexContainerThe PlanarFlexContainer class describes a flex container on a plane.
PlanarFlexItemThe PlanarFlexItem class describes a flex item on a plane.
PlanarImageThe PlanarImage class describes an image rendered on a plane.
PlanarObjectThe PlanarObject class describes an object on a plane.
PlanarTextThe PlanarText class describes text on a plane.
PlaneThe Plane class describes a plane.
PlaneTrackerThe PlaneTracker class provides functionality for locating a 3D plane based on 2D screen coordinates.
PointLightSourceThe PointLightSource class describes a point light source.
SceneThe Scene class implements properties and methods to access the objects in a scene.
SceneObjectThe SceneObject class describes an object in a scene.
SceneObjectBaseThe SceneObjectBase class describes a scene object.
ScreenPlaneThe ScreenPlane class describes a screen plane.
SkeletonThe Skeleton class describes a skeleton object.
SpeakerThe Speaker class encapsulates an speaker for a scene. Old class name is AudioSource.
SpotLightSourceThe SpotLightSource class describes a spot light source.
SvgImageThe SvgImage class describes an SVG asset for a scene.
TargetTrackerThe TargetTracker encapsulates a tracker for some target.
TextAlignmentWrapperThe TextAlignmentWrapper class contains text alignment details.
TextExtrusionThe TextExtrusion class describes a 3D text scene object.
TransformThe Transform class describes an object transform for a scene.
WorldTransformThe WorldTransform class describes an object tranform for a sceneObject in world space.

Enums

EnumDescription
BrushTypeThe BrushType enum describes what kind of brush is used for dynamic extrusion.
HorizontalAlignmentThe HorizontalAlignment enum describes how an element is aligned horizontally.
RenderModeThe RenderMode enum describes how to render a scene object.
ScalingOptionThe ScalingOption enum describes how an element is scaled.
TextAlignmentThe TextAlignment enum describes how a text element is aligned horizontally.
TrackingModeThe TrackingMode enum describes how a PlaneTracker is tracking an object.
VerticalAlignmentThe VerticalAlignment enum describes how an element is aligned vertically.
VerticalTextAlignmentThe VerticalTextAlignment enum describes how a text element is aligned vertically.

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.

Enums

EnumDescription
BlendedMaterialTexturesThe BlendedMaterialTextures enum describes the different texture slots for a flat material.
BlendModeThe BlendMode enum describes the blending mode.
BuiltinUniformThe BuiltinUniform enum describes the bultin shader uniforms.
ColorSpaceThe ColorSpace enum describes the color space.
DefaultMaterialTexturesThe DefaultMaterialTextures enum describes the different texture slots for a default material.
DerivativeTypeThe DerivativeType enum describes the shader derivative type.
FacePaintMaterialTexturesThe FacePaintMaterialTextures enum describes the different texture slots for a face paint material.
GradientTypeThe GradientType enum describes the type of the shader gradient.
PhysicallyBasedMaterialTexturesThe PhysicallyBasedMaterialTextures enum describes the different texture slots for a physically based material.
SdfVariantThe SdfVariant enum describes the SDF variant.
VertexAttributeThe VertexAttribute enum describes the bultin vertex attributes.

SvgsModule

The SvgsModule module enables working with SVGs.

Classes

ClassDescription
SvgThe Svg class describes an SVG in an effect.

TexturesModule

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

Classes

ClassDescription
CameraTextureThe CameraTexture class.
CanvasTextureThe CanvasTexture class enables painting with a brush to a texture.
ColorTextureThe ColorTexture class encapsulates a texture that has a color (including alpha channel).
DeepLinkTextureThe DeepLinkTexture class represents an image texture passed in via the sharing SDK.
ExternalTextureThe ExternalTexture class encapsulates a visual asset that is downloaded over the network.
GalleryTextureThe GalleryTexture class encapsulates a texture that was picked from the gallery.
ImageTextureThe ImageTexture class encapsulates an image that may be used to form materials for rendering in the scene.
SegmentationTextureThe SegmentationTexture class encapsulates a texture that will be used for image segmentation.
SequenceTextureThe SequenceTexture class is a collection of still images that form an animation.
SourceImageRegionTextureThe SourceImageRegionTexture class.
SubTextureThe SubTexture class exposes details of a texture in UV coordinates.
TextureBaseThe TextureBase class describes a texture.

Enums

EnumDescription
StateThe State enum describes the download state of an ExternalTexture.
StateThe State enum describes the state of a GalleryTexture.

TimeModule

The TimeModule class enables time-based events.

TouchGesturesModule

The TouchGesturesModule class enables touch gesture detection.

Classes

ClassDescription
GestureThe Gesture class encapsulates details of a detected gesture.
LongPressGestureThe LongPressGesture class contains the details of a detected long-press gesture.
PanGestureThe PanGesture class contains the details of a detected pan gesture.
PinchGestureThe PinchGesture class contains the details of a detected pinch gesture.
RawTouchGestureThe RawTouchGesture class encapsulates raw touch data.
RotateGestureThe RotateGesture class contains the details of a detected rotate gesture.
TapGestureThe TapGesture class contains the details of a detected tap gesture.

Enums

EnumDescription
StateThe State enum describes the state of a Gesture.
TypeThe Type enum describes a touch gesture.

UnitsModule

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

WeatherModule

The WeatherModule class provides information about the current weather