The following is a description of all scripting modules.
The AnimationModule
class implements object animation.
Class | Description |
---|---|
ArrayOfScalarSamplers | The ArrayOfScalarSamplers class describes an array of scalar samplers.It extends the implementation of Array<ScalarSampler> type in JavaScript,and adds a single additional method to get a sampler at a particular index - get() . |
ArrayOfScalarSignals | The ArrayOfScalarSignals class describes an array of scalar signals.It extends the implementation of Array<ScalarSignal> type in JavaScript,and adds a single additional method to get a sampler at a particular index - get() . |
ColorSampler | The ColorSampler class encapsulates a color sampler. |
Driver | The Driver class encapsulates an animation driver. |
RotationSampler | The RotationSampler class is an animation sampler for object rotation. |
SamplerFactory | The SamplerFactory class creates different types of animation samplers. |
ScalarSampler | The ScalarSampler class encapsulates a scalar value sampler. |
TimeDriver | The TimeDriver class allows driving an animation sampler using time. |
ValueDriver | The ValueDriver class allows driving an animation sampler using raw values. |
The AudioModule
class enables sound effects.
Class | Description |
---|---|
PlaybackController | The PlaybackController class enables control of audio playback. |
The BlocksModule
class provides methods for interacting with the Blocks in your effect.
The CameraInfoModule
class provides access to details about the device camera.
Enum | Description |
---|---|
CameraPosition | The CameraPosition enum describes the direction the camera is facing. |
The DeepLinkModule
class exposes methods and properties to read the values that an external app sent to an effect.
The DeviceMotionModule
class enables device movement detection.
The DiagnosticsModule
class enables diagnostic logging.
Class | Description |
---|---|
TypeSystemMetadata | The TypeSystemMetadata class contains type system metadata. |
The FaceGesturesModule
class enables face orientation detection.
The FaceTracking2DModule
class enables tracking faces in 2D.
Class | Description |
---|---|
Face2D | The Face2D class exposes details of a tracked face. |
The FaceTrackingModule
class enables tracking faces in 3D.
Class | Description |
---|---|
Cheek | The Cheek class exposes the details of a detected cheek. |
Chin | The Chin class exposes the details of a detected chin. |
Eye | The Eye class exposes the details of a detected eye. |
Eyebrow | The Eyebrow class exposes the details of a detected eyebrow. |
Face | The Face class exposes details of a tracked face. |
Forehead | The Forehead class exposes the details of a detected forehead. |
Mouth | The Mouth class exposes the details of a detected mouth. |
Nose | The Nose class exposes the details of a detected nose. |
The FontsModule
class is used for working with custom fonts in effects.
Class | Description |
---|---|
FontId | The FontsId class identifies a font in an effect. |
The HandTrackingModule
class enables hand tracking.
Class | Description |
---|---|
Hand | The Hand class describes a hand detected in a scene. |
The InstantGamingModule
class.
The InstructionModule
class enables effects to provide instructions to the user.
The IrisTrackingModule
class allows you to track the location of people's irises in your effect, to create effects such as eye color replacement.
Class | Description |
---|---|
Eyeball | The Eyeball class exposes details of a tracked eyeball. |
The LightingEstimation
module encapsulates access to estimations of lighting in the scene.
The LiveStreamingModule
class enables to retrieve information from a live stream from within the effect, such as reactions and comments.
Class | Description |
---|---|
LiveStreamingComments | The LiveStreamingComments class provides access to the Facebook Live comments stream. |
LiveStreamingReactions |
Enum | Description |
---|---|
State | The LiveStreamingModule.State enum describes the state of a live stream.@ |
The LocaleModule
class encapsulates access to the locale identifier of the device.
The Materials
module provides access to the materials in an effect.
Class | Description |
---|---|
BlendedMaterial | The BlendedMaterial class encapsulates materials blended from multiple textures. |
BlendShapeToWarpMapMaterial | The BlendShapeToWarpMapMaterial class is the JS-side representation of the "Face Warp Material" in Spark AR Studio, used to create face warp effects. |
ColorPaintMaterial | The ColorPaintMaterial class encapsulates a face-paint material. |
ComposedMaterial | The ComposedMaterial class encapsulates patch asset materials. |
DefaultMaterial | The DefaultMaterial class encapsulates an image-based material. |
MaterialBase | The MaterialBase class exposes properties common to all material types. |
MetallicRoughnessPbrMaterial | The MetallicRoughnessPbrMaterial class encapsulates physically based materials. |
RetouchingMaterial | The RetouchingMaterial class encapsulates parameters which define the extend of certain beautification techniques. |
TextureTransform | The TextureTransform class encapsulates scaling and translation transforms about a textures UV axis. |
The NativeUI
module exposes editable text.
The PatchesModule
module allows interop between JS scripting and the AR Studio patches visual scripting system.
Class | Description |
---|---|
PatchesInputs | The PatchesInputs class encapsulates methods for setting inputs to the Patch Editor. |
PatchesOutputs | The PatchesOutputs class encapsulates methods for getting outputs of the Patch Editor. |
The Persistence
class encapsulates persistent objects.
Class | Description |
---|---|
StorageScope | The StorageScope class encapsulates different methods of storage for persistent objects. |
The PersonSegmentationModule
class enables the separation of a person from a scene.
The RandomModule
class enables random number generation.
The ReactiveModule
class exposes methods for reactive programming.
Class | Description |
---|---|
BoolSignal | The BoolSignal class monitors a boolean value. |
BoolSignalHistory | The BoolSignalHistory encapsulates methods for accessing values of BoolSignal from previous frames. |
BoundingBoxSignal | The BoundingBoxSignal class monitors bounding box values. |
BoundingBoxSignalHistory | The BoundingBoxSignalHistory encapsulates methods for accessing values of BoundingBoxSignal from previous frames. |
ColorSignal | The ColorSignal class monitors a color. |
EventSource | The EventSource class provides methods for monitoring signals. |
EventSourceHistory | The EventSourceHistory encapsulates methods for accessing values of EventSource from previous frames. |
HsvaSignal | The HsvaSignal class monitors a HSVA color value. |
ISignal | The ISignal interface. The base class for ScalarSignal , PointSignal , VectorSignal , BoolSignal , and StringSignal |
Point2D | The Point2D class contains a 2D coordinate. |
Point2DSignal | The Point2DSignal class monitors a 2D coordinate. |
Point2DSignalHistory | The Point2DSignalHistory encapsulates methods for accessing values of Point2DSignal from previous frames. |
Point3D | The Point3D class contains a 3D coordinate. |
Point4DSignal | The Point4DSignal class monitors a 4D coordinate. |
Point4DSignalHistory | The Point4DSignalHistory encapsulates methods for accessing values of Point4DSignal from previous frames. |
PointSignal | The PointSignal class monitors a 3D coordinate. |
PointSignalHistory | The PointSignalHistory encapsulates methods for accessing values of PointSignal from previous frames. |
PrimitiveOrShaderSignal | The PrimitiveOrShader represents a primitive or shader signal. |
PrimitiveOrShaderSignalHistory | The PrimitiveOrShaderSignalHistory encapsulates methods for accessing values of PrimitiveOrShaderSignal from previous frames. |
QuaternionSignal | The QuaternionSignal class monitors rotation in a quaternion representation. |
QuaternionSignalHistory | The QuaternionSignalHistory encapsulates methods for accessing values of QuaternionSignal from previous frames. |
RgbaSignal | The RgbaSignal class monitors a RGBA color value. |
Rotation | The Rotation class encapsulates an object's rotation in a quaternion representation. |
ScalarSignal | The ScalarSignal class monitors a numerical value. |
ScalarSignalHistory | The ScalarSignalHistory encapsulates methods for accessing values of ScalarSignal from previous frames. |
ShaderSignal | The ShaderSignal represents a shader signal. Scalar and Vector signals can automatically be converted to a ShaderSignal. |
ShaderSignalHistory | The ShaderSignalHistory encapsulates methods for accessing values of ShaderSignal from previous frames. |
StringSignal | The StringSignal class monitors a string value. |
StringSignalHistory | The StringSignalHistory encapsulates methods for accessing values of StringSignal from previous frames. |
Subscription | The Subscription class implements object value monitoring. |
TransformSignal | The TransformSignal class monitors a scene transform. |
TransformSignalHistory | The TransformSignalHistory encapsulates methods for accessing values of TransformSignal from previous frames. |
VectorSignal | The VectorSignal class monitors a vector. |
VectorSignalHistory | The VectorSignalHistory encapsulates methods for accessing values of VectorSignal from previous frames. |
Enum | Description |
---|---|
AntiderivativeOverflowBehaviour | The AntiderivativeOverflowBehaviour enum describes the recovery technique used when an antiderivative overflows. |
The SceneModule
class exposes properties and methods to access the objects in a scene.
Class | Description |
---|---|
AmbientLightSource | The AmbientLightSource class describes an ambient lighting source. |
BlendShape | The BlendShape class describes a shape attached to a mesh or face mesh which can be used to change the shape of that mesh. |
BlockInstanceInputs | The BlockInstanceInputs class encapsulates methods for setting inputs to the block instance. |
BlockInstanceOutputs | The BlockInstanceOutputs class encapsulates methods for getting outputs of the block instance. |
BlockSceneRoot | The BlockSceneRoot class describes the root scene object of a block. |
BoundingBox | The BoundingBox class describes the bounds of a scene element in the local coordinate system. |
Bounds2D | The Bounds2D class describes the bounds of a scene element. |
Camera | The Camera class exposes details about the device camera focal area. |
CameraVisibility | The CameraVisibility class describes whether or not an object is visible from various camera views. |
Canvas | The Canvas class describes a scene canvas. |
DirectionalLightSource | The DirectionalLightSource class describes a directional light source. |
DynamicExtrusion | The DynamicExtrusion class provides functionality for creating extruded 3D objects using a brush. |
FaceMesh | The FaceMesh class describes a face mesh. |
FaceTracker | "The FaceTracker class propagates details of detected faces to the scene." |
FocalDistance | The FocalDistance class describes a focal distance. |
FocalPlane | The FocalPlane class exposes details about the focal plane of the device camera. |
HandTracker | This class represents the hand tracker scene object, used to track the position of hands in the scene. |
Joint | The Joint class encapsulates a joint scene object. |
Mesh | The Mesh class describes a scene mesh. |
MeshSurface | The MeshSurface class describes a surface in a mesh. |
OutputVisibility | The OutputVisibility class describes whether or not an object is visible from various outputs. |
ParticleSystem | The ParticleSystem class implements the particle management system for the scene. |
ParticleTypeDescription | The ParticleTypeDescription class provides functionality for setting particle sprite densities in the scene. |
ParticleTypeDescriptions | The ParticleTypeDescriptions class provides a container for particle type descriptions. |
PlanarDiv | The PlanarDiv class describes a div on a plane. |
PlanarFlexContainer | The PlanarFlexContainer class describes a flex container on a plane. |
PlanarFlexItem | The PlanarFlexItem class describes a flex item on a plane. |
PlanarImage | The PlanarImage class describes an image rendered on a plane. |
PlanarObject | The PlanarObject class describes an object on a plane. |
PlanarStack | The PlanarImage class describes an image rendered on a plane. |
PlanarText | The PlanarText class describes text on a plane. |
Plane | The Plane class describes a plane. |
PlaneTracker | The PlaneTracker class provides functionality for locating a 3D plane based on 2D screen coordinates. |
PointLightSource | The PointLightSource class describes a point light source. |
Scene | The Scene class implements properties and methods to access the objects in a scene. |
SceneObject | The SceneObject class describes an object in a scene. |
SceneObjectBase | |
ScreenPlane | The ScreenPlane class describes a screen plane. |
Skeleton | The Skeleton class describes a skeleton object. |
Speaker | The Speaker class encapsulates an speaker for a scene. Old class name is AudioSource . |
SpotLightSource | The SpotLightSource class describes a spot light source. |
SvgImage | The SvgImage class describes an SVG asset for a scene. |
TargetTracker | The TargetTracker encapsulates a tracker for some target. |
TextAlignmentWrapper | The TextAlignmentWrapper class contains text alignment details. |
TextExtrusion | "The TextExtrusion class describes a 3D text scene object. |
Transform | The Transform class describes an object transform for a scene. |
WorldTransform | The WorldTransform class describes an object tranform for a sceneObject in world space. |
Enum | Description |
---|---|
Direction | The Direction enum describes the stack layout's direction. |
BrushType | The BrushType enum describes what kind of brush is used for dynamic extrusion. |
HorizontalAlignment | The HorizontalAlignment enum describes how an element is aligned horizontally. |
RenderMode | The RenderMode enum describes how to render a scene object. |
ScalingOption | The ScalingOption enum describes how an element is scaled. |
StackAlign | The StackAlign enum describes the stack children's alignment. |
StackDistribute | The StackDistribute enum describes the stack children's distribution. |
TextAlignment | The TextAlignment enum describes how a text element is aligned horizontally. |
TrackingMode | The TrackingMode enum describes how a PlaneTracker is tracking an object. |
VerticalAlignment | The VerticalAlignment enum describes how an element is aligned vertically. |
VerticalTextAlignment | The VerticalTextAlignment enum describes how a text element is aligned vertically. |
The SegmentationModule
class enables the separation of a person or hair or skin from a scene.
Class | Description |
---|---|
HairSegmentation | The HairSegmentation class exposes the information about a person's hair. |
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.PrimitiveOrShaderSignal
is a union type of Point2DSignal
, PointSignal
, Point4DSignal
, VectorSignal
, TransformSignal
, or ShaderSignal
.ShaderSignal
is a graphics shader output that produces one of the types defined in the above union. As ShaderSignal
is GPU bound, it can only be used in a GPU context.ShaderSignal
can also be of a function type, used for function mapping from one type to another.
For example, a shader with the signature function(Point2DSignal): Point4DSignal
is a type of a function that maps a Point2DSignal
to a Point4DSignal
.
Enum | Description |
---|---|
BlendedMaterialTextures | The BlendedMaterialTextures enum describes the different texture slots for a flat material. |
BlendMode | The BlendMode enum describes the blending mode. |
BuiltinUniform | The BuiltinUniform enum describes the bultin shader uniforms. |
ColorSpace | The ColorSpace enum describes the color space. |
DefaultMaterialTextures | The DefaultMaterialTextures enum describes the different texture slots for a default material. |
DerivativeType | The DerivativeType enum describes the shader derivative type. |
FacePaintMaterialTextures | The FacePaintMaterialTextures enum describes the different texture slots for a face paintmaterial. |
GradientType | The GradientType enum describes the type of the shader gradient. |
PhysicallyBasedMaterialTextures | The PhysicallyBasedMaterialTextures enum describes the different texture slots for aphysically based material. |
SdfVariant | The SdfVariant enum describes the SDF variant. |
VertexAttribute | The VertexAttribute enum describes the bultin vertex attributes. |
The SvgsModule
module enables working with SVGs.
Class | Description |
---|---|
Svg | The Svg class describes an SVG in an effect. |
The TexturesModule
class enables images, animation sequences, videos, colors, and other visual artifacts to be combined to form materials.
Class | Description |
---|---|
CameraTexture | The CameraTexture class represents a texture type that contains image data coming in from system camera, or captured photo/video in case of using the effect with "Media Library". |
CanvasTexture | The CanvasTexture class enables painting with a brush to a texture. |
ColorTexture | The ColorTexture class encapsulates a texture that has a color (including alpha channel). |
DeepLinkTexture | The DeepLinkTexture class represents an image texture passed in via the sharing SDK. |
GalleryTexture | The GalleryTexture class encapsulates a texture that was picked from the gallery. |
ImageTexture | The ImageTexture class encapsulates an image that may be used to form materials for rendering in the scene. |
SegmentationTexture | The SegmentationTexture class encapsulates a texture that will be used for image segmentation. |
SequenceTexture | The SequenceTexture class is a collection of still images that form an animation. |
SourceImageRegionTexture | The SourceImageRegionTexture class. |
SubTexture | The SubTexture class exposes details of a texture in UV coordinates. |
TextureBase | The TextureBase class describes a texture. |
Enum | Description |
---|---|
State | The State enum describes the state of a GalleryTexture. |
The TimeModule
class enables time-based events.
The TouchGesturesModule
class enables touch gesture detection.
Class | Description |
---|---|
Gesture | The SamplerFactory class creates different types of animation samplers. |
LongPressGesture | The LongPressGesture class contains the details of a detected long-press gesture. |
PanGesture | The PanGesture class contains the details of a detected pan gesture. |
PinchGesture | The PinchGesture class contains the details of a detected pinch gesture. |
RotateGesture | The RotateGesture class contains the details of a detected Rotate gesture. |
TapGesture | The TapGesture class contains the details of a detected tap gesture. |
Enum | Description |
---|---|
State | The State enum describes the state of a Gesture. |
GestureType | The GestureType enum describes the type of a given Gesture . |
The UnitsModule
class provides functionality for converting values into world-space units.
The WeatherModule
class provides information about the current weather.