Scripting
Asynchronous API Changes (v85+)

Asynchronous API Changes (v85+)

With v85 of Spark AR Studio the current JavaScript API will be deprecated in favor of asynchronous APIs.

This means some APIs will be deprecated and will need to be replaced in your projects. When creating new projects, new APIs should be used instead.

What happens to existing projects

APIs will be deprecated after 6 months in existing live effects, and 3 months in resubmitted projects.

If you’re using a deprecated API, you’ll:

  1. See a message in Spark AR Studio when you open the project.
  2. Get an email and notification to let you know how to update it.

New APIs

AnalyticsModule

Added (get) productName: StringSignal

  • Deprecates (get) cameraProductName:

Note: duplicated functionality of Array<BlendShapeMesh>

BlockSceneRoot

Added inputs.setBoolean(name: String, signal: BoolSignal): Promise<void>

  • Deprecates setBooleanInput(name: String, signal: BoolSignal): void
### `BlockSceneRoot`

Added inputs.setBoolean(name: String, signal: BoolSignal): Promise<void>

  • Deprecates setBooleanInput(name: String, signal: BoolSignal): void

Added inputs.setColor(name: String, signal: ColorSignal): Promise<void>

  • Deprecates setColorInput(name: String, signal: ColorSignal): void

Added inputs.setPoint(name: String, signal: PointSignal): Promise<void>

  • Deprecates setPointInput(name: String, signal: PointSignal): void

Added inputs.setPoint2D(name: String, signal: PixelPointSignal): Promise<void>

  • Deprecates setPixelPointInput(name: String, signal: PixelPointSignal): void

Added inputs.setScalar(name: String, signal: ScalarSignal): Promise<void>

  • Deprecates setScalarInput(name: String, signal: ScalarSignal): void

Added inputs.setShader(name: String, signal: ShaderSignal): Promise<void>

  • Deprecates setShaderInput(name: String, signal: ShaderSignal): void

Added inputs.setString(name: String, signal: StringSignal): Promise<void>

  • Deprecates setStringInput(name: String, signal: StringSignal): void

Added inputs.setVector(name: String, signal: VectorSignal): Promise<void>

  • Deprecates setVectorInput(name: String, signal: VectorSignal): void

Added outputs.getBoolean(name: String): Promise<BoolSignal>

  • Deprecates getBooleanOutput(name: String): BoolSignal

Added outputs.getBooleanOrFallback(name: String, fallback: BoolSignal): BoolSignal

Added outputs.getColor(name: String): Promise<ColorSignal>

  • Deprecates getColorOutput(name: String): ColorSignal

Added outputs.getColorOrFallback(name: String, fallback: ColorSignal): ColorSignal

Added outputs.getPoint(name: String): Promise<PointSignal>

  • Deprecates getPointOutput(name: String): PointSignal

Added outputs.getPointOrFallback(name: String, fallback: PointSignal): PointSignal

Added outputs.getPoint2D(name: String): Promise<PixelPointSignal>

  • Deprecates getPixelPointOutput(name: String): PixelPointSignal

Added outputs.getPoint2DOrFallback(name: String, fallback: PixelPointSignal): PixelPointSignal

Added outputs.getScalar(name: String): Promise<ScalarSignal>

  • Deprecates getScalarOutput(name: String): ScalarSignal

Added outputs.getScalarOrFallback(name: String, fallback: ScalarSignal): ScalarSignal

Added outputs.getShader(name: String): Promise<ShaderSignal>

  • Deprecates getShaderOutput(name: String): ShaderSignal

Added outputs.getShaderOrFallback(name: String, fallback: ShaderSignal): ShaderSignal

Added outputs.getString(name: String): Promise<StringSignal>

  • Deprecates getStringOutput(name: String): StringSignal

Added outputs.getStringOrFallback(name: String, fallback: StringSignal): StringSignal

Added outputs.getVector(name: String): Promise<VectorSignal>

  • Deprecates getVectorOutput(name: String): VectorSignal

Added outputs.getVectorOrFallback(name: String, fallback: VectorSignal): VectorSignal

Canvas

Added void setMode(mode: Signal<SceneModule.RenderMode>, config { fallback: SceneModule.RenderMode }): void

Added (get) mode: Signal<SceneModule.RenderMode>

  • Deprecates (get) renderMode: SceneModule.RenderMode

Added (set) mode: Signal<SceneModule.RenderMode>

  • Deprecates (set) renderMode: SceneModule.RenderMode

CustomMaterial

Added getBoolParameter(paramName: string): Promise<BoolSignal>

  • Deprecates boolParameter(paramName: string): BoolValue

Added getBoolParameterOrFallback(paramName: string, fallback: BoolSignal): BoolSignal

Added getFloatParameter(paramName: string): Promise<ScalarSignal>

  • Deprecates floatParameter(paramName: string): ScalarValue

AddedgetFloatParameterOrFallback(paramName: string, fallback: ScalarSignal): ScalarSignal

Added getTexture(paramName: string): Promise<TextureBase>

Added setBoolParameter(paramName: string, source: BoolSignal): Promise<void>

  • Deprecates setBoolParameter(paramName: string, source: BoolSignal): void

Added setFloatParameter(paramName: string, source: ScalarSignal): Promise<void>

  • Deprecates setFloatParameter(paramName: string, source: ScalarSignal): void

Added setTexture(paramName: string, texture: TextureBase): Promise<void>

  • Deprecates setTexture(paramName: string, texture: TextureBase): void

DefaultMaterial

Added getEmissive(): Promise<TextureBase>

  • Deprecates (get) emissive: TextureBase

Added getMultiply(): Promise<TextureBase>

  • Deprecates (get) multiply: TextureBase

Added getReflective(): Promise<TextureBase>

  • Deprecates (get) reflective: TextureBase

DiagnosticsModule

Added typeSystem.getTypeDescriptions(): Promise<Object>

  • Deprecates getTypeDescriptions(): Object

Added typeSystem.getModuleNames(): Promise<Array<string>>

  • Deprecates getModuleNames(): Array<string>

ExternalStreamTexture

Added (get) streamId: StringSignal

  • Deprecates (get) streamIdentifier: string

Added (set) streamId: StringSignal

  • Deprecates (set) streamIdentifier: string

Face

Deprecated nd marked for removal `deformationCoefficientAt(index: number): ScalarSignal`

Deprecated nd marked for removal `landmark2D(index: number): PointSignal

FaceMesh

Added getMaterial(): Promise<MaterialBase>`

  • Deprecates (get) material: MaterialBase

FontsModule

Deprecated get(fontName: string): FontId

  • Use findUsingPattern(namePattern: string, config: {limit: number}): Promise<Array<FontId>>` family of methods instead

InstructionModule

Added (get) automaticHintsEnabled: BoolSignal

  • Deprecates (get) automaticInstructionsEnabled: boolean

Added (set) automaticHintsEnabled: BoolSignal

  • Deprecates (set) automaticInstructionsEnabled: boolean

LocaleModule

Deprecated (get) fromDevice: string

  • Use (get) locale: StringSignal` instead

MaterialBase

Added getDiffuse(): Promise<TextureBase>

  • Deprecates (get) diffuse: TextureBase

MaterialsModule

Deprecated get(materialName: string): MaterialBase

  • Use findUsingPattern(namePattern: string, config: {limit: number}): Promise<Array<MaterialBase>>` family of methods instead

Mesh

Added getMaterial(): Promise<MaterialBase>`

  • Deprecates (get) material: MaterialBase

Deprecated (get) blendShapes: BlendShapesMesh

  • Use getBlendShapes(): Promise<Array<BlendShape>>` instead

Deprecated (get) materialIdentifier: String

  • Use getMaterial(): Promise<MaterialBase>` instead

MetallicRoughnessPbrMaterial

Added getBaseColor(): Promise<TextureBase>

  • Deprecates (get) baseColor: TextureBase

Added getEmissive(): Promise<TextureBase>

  • Deprecates (get) emissive: TextureBase

Added getMetallicRoughness(): Promise<TextureBase>

  • Deprecates (get) metallicRoughness: TextureBase

ParticleSystem

Added getMaterial(): Promise<MaterialBase>`

  • Deprecates (get) material: MaterialBase

Added getTypes(): Promise<Array<ParticleTypeDescription>>

  • Deprecates (get) types: Array<ParticleTypeDescription>

Added (get) innerRadius: ScalarSignal

  • Deprecates (get) innerRadius: ScalarValue

Added (get) outerRadius: ScalarSignal

  • Deprecates (get) outerRadius: ScalarValue

Deprecated ParticleTypeDescriptions

#### Note: duplicated functionality of `Array<ParticleTypeDescription>`

PatchesModule

Added inputs.setBoolean(name: String, signal: BoolSignal): Promise<void>

  • Deprecates nsetBooleanValue(name: String, signal: BoolSignal): void

Added inputs.setColor(name: String, signal: ColorSignal): Promise<void>

  • Deprecates setColorValue(name: String, signal: ColorSignal): void

Added inputs.setPoint(name: String, signal: PointSignal): Promise<void>

  • Deprecates setPointValue(name: String, signal: PointSignal): void

Added inputs.setPoint2D(name: String, signal: PixelPointSignal): Promise<void>

  • Deprecates setPoint2DValue(name: String, signal: PixelPointSignal): void

Added inputs.setPulse(name: String, signal: EventSource): Promise<void>

  • Deprecates setPulseValue(name: String, signal: EventSource): void

Added inputs.setScalar(name: String, signal: ScalarSignal): Promise<void>

  • Deprecates setScalarValue(name: String, signal: ScalarSignal): void

Added inputs.setString(name: String, signal: StringSignal): Promise<void>

  • Deprecates setStringValue(name: String, signal: StringSignal): void

Added inputs.setVector(name: String, signal: VectorSignal): Promise<void>

  • Deprecates setVectorValue(name: String, signal: VectorSignal): void

Added outputs.getBoolean(name: String): Promise<BoolSignal>

  • Deprecates getBooleanValue(name: String): BoolSignal

Added outputs.getBooleanOrFallback(name: String, fallback: BoolSignal): BoolSignal

Added outputs.getColor(name: String): Promise<ColorSignal>

  • Deprecates getColorValue(name: String): ColorSignal

Added outputs.getColorOrFallback(name: String, fallback: ColorSignal): ColorSignal

Added outputs.getPoint(name: String): Promise<PointSignal>

  • Deprecates getPointValue(name: String): PointSignal

Added outputs.getPointOrFallback(name: String, fallback: PointSignal): PointSignal

Added outputs.getPoint2D(name: String): Promise<PixelPointSignal>

  • Deprecates getPoint2DValue(name: String): PixelPointSignal

Added outputs.getPoint2DOrFallback(name: String, fallback: PixelPointSignal): PixelPointSignal

Added outputs.getPulse(name: String): Promise<EventSource>

  • Deprecates getPulseValue(name: String): EventSource

Added outputs.getScalar(name: String): Promise<ScalarSignal>

  • Deprecates getScalarValue(name: String): ScalarSignal

Added outputs.getScalarOrFallback(name: String, fallback: ScalarSignal): ScalarSignal

Added outputs.getString(name: String): Promise<StringSignal>

  • Deprecates getStringValue(name: String): StringSignal

Added outputs.getStringOrFallback(name: String, fallback: StringSignal): StringSignal

Added outputs.getVector(name: String): Promise<VectorSignal>

  • Deprecates getVectorValue(name: String): VectorSignal

Added outputs.getVectorOrFallback(name: String, fallback: VectorSignal): VectorSignal

PlanarImage

Added getMaterial(): Promise<MaterialBase>`

  • Deprecates (get) material: MaterialBase

PlanarText

Added getMaterial(): Promise<MaterialBase>

  • Deprecates (get) material: MaterialBase

Plane

Added getMaterial(): Promise<MaterialBase>`

  • Deprecates (get) material: MaterialBase

PrefabsModule

Deprecated get(prefabName: string): PrefabBase

  • Use findUsingPattern(namePattern: string, config: {limit: number}): Promise<Array<PrefabBase>>` family of methods instead

ShaderProcessor

Added getBoolParameter(paramName: string): Promise<BoolSignal>

  • Deprecates boolParameter(paramName: string): BoolValue

Added getBoolParameterOrFallback(paramName: string, fallback: BoolSignal): BoolSignal

Added getFloatParameter(paramName: string): Promise<ScalarSignal>

  • Deprecates floatParameter(paramName: string): ScalarValue

Added getFloatParameterOrFallback(paramName: string, fallback: ScalarSignal): ScalarSignal

Added setBoolParameter(paramName: string, source: BoolSignal): Promise<void>

  • Deprecates setBoolParameter(paramName: string, source: BoolSignal): void

Added setFloatParameter(paramName: string, source: ScalarSignal): Promise<void>

  • Deprecates setFloatParameter(paramName: string, source: ScalarSignal): void

SceneObjectBase

Deprecated (get) materialIdentifier: string

  • Use getMaterial(): Promise<MaterialBase>` on `SceneObjectBase` which support materials

Deprecated find(name: string): SceneObjectBase

  • Use findByPath(pathQuery: string, config: {limit: number}): Promise<Array<SceneObjectBase>>` family of methods instead

Deprecated child(name: string): SceneObjectBase

  • Use findByPath(pathQuery: string, config: {limit: number}): Promise<Array<SceneObjectBase>>` family of methods instead

Scene

Deprecated find(name: string): SceneObjectBase

  • Use findByPath(pathQuery: string, config: {limit: number}): Promise<Array<SceneObjectBase>>` family of methods instead

Deprecated child(name: string): SceneObjectBase

  • Use findByPath(pathQuery: string, config: {limit: number}): Promise<Array<SceneObjectBase>>` family of methods instead

SvgImage

Added getSvg(): Promise<Svg&gt

`

SvgsModule

Deprecated get(svgName: string): Svg

  • Use findUsingPattern(namePattern: string, config: {limit: number}): Promise<Array<Svg>>` family of methods instead

TextAlignmentWrapper

Added (get) horizontal: Signal<TextAlignment>

Added (set) horizontal: Signal<TextAlignment>`

  • Deprecates (set) horizontal: TextAlignment

Added (get) vertical: Signal<VerticalTextAlignment>

Added (set) vertical: Signal<VerticalTextAlignment>`

  • Deprecates (set) vertical: VerticalTextAlignment

TextExtrusion

Added getFrontMaterial(): Promise<MaterialBase>

Added getFont(): Promise<FontId>

Added getBackMaterial(): Promise<MaterialBase>

Added getSideMaterial(): Promise<MaterialBase>

Deprecated (set) faceMaterial: MaterialBase

  • Use (set) frontMaterial: MaterialBase` and `(set) backMaterial: MaterialBase` instead

TexturesModule

Deprecated get(textureName: string): TextureBase

  • Use findUsingPattern(namePattern: string, config: {limit: number}): Promise<Array<TextureBase>>` family of methods instead