Skip to main content

SegmentationTextureProvider

Represents a provider specifically designed for the SegmentationTexture asset.

TypeNameInterface Description
VariablesinvertMask: boolean

Function: Whether the generated mask output is inverted. true swaps foreground and background in the mask; false keeps the original output.

VariablespetType: PetType[]

Function: Selected pet categories used when segmentationType is SegmentationType.Pet. Values must come from the PetType enum (PetType.Cat = 1, PetType.Dog = 2) null, undefined, or an empty array on set are silently ignored.

VariablessegmentationType: SegmentationType

Function: The segmentation type used by this provider. Determines which segmentation algorithm is active and which secondary properties (trackIndex, petType) apply. No validation is applied on set; the default internal value is -1 (no active type). Setting an out-of-enum value leaves the provider in an inactive state.

Variablessmoothness: number

Function: Smoothness factor applied to the segmentation mask edge. Valid range: [0, 1]. A value of 0 produces the sharpest edge, while 1 (default) produces the softest edge.

VariablestrackIndex: number[]

Function: Tracked face/body indices for the current segmentation type. Supported types: Head, Hand, Pet, Ear, Lip, Teeth, Face, Eye. Getter returns the array for the active type, or [] for types that do not use tracked indices (e.g. Portrairt, Hair, Cloth, Sky). null, undefined, or an empty array are silently ignored. Setting when segmentationType is not one of the 8 supported types is also a no-op.

Functionsconstructor()

Examples

constructor()

let obj = new APJS.SegmentationTextureProvider();

Use Case

@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use SegmentationTextureProvider here
}
onUpdate(deltaTime: number) {
}
}
Copyright © 2026 TikTok. All rights reserved.
About TikTokHelp CenterCareersContactLegalTerms of ServicePrivacy PolicyCookies