Skip to main content

Material

TypeNameInterface Description
VariablesmainPass: Pass

The first Pass.

Example

const mainPass = material.mainPass;
TypeNameInterface Description
Variablespasses: Pass[]

Pass List

Example

const passes = material.passes;
const pass0 = passes[0];
TypeNameInterface Description
VariablesrenderQueue: number

Rendering order value. The smaller the value, the earlier the rendering; conversely, the larger the value, the later the drawing.

Example

material.renderQueue = 2;
TypeNameInterface Description
Functionsclone(): Material

Material Clone

Example

const newMaterial = srcMaterial.clone();
TypeNameInterface Description
FunctionssetFloat(name: string, value: number): void

Set the Float property of the material.

Currently, the name of uniform can only be obtained through third-party software such as BlenderLender.

setfloat example

Example

material.setFloat('_Custom_Float', 0.1);
TypeNameInterface Description
FunctionssetVector(name:string, value: Vector2|Vector3|Vector4): void

Set the Vector property of the material

Example

material.setVector('_Custom_Vec2', new APJS.Vector2f(1.0, 1.0));
TypeNameInterface Description
FunctionssetColor(name:string, value: Color): void

Set the Color property of the material

Example

material.setColor('_Custom_Color', new APJS.Color(1.0, 0.0, 0.0, 1.0));
TypeNameInterface Description
FunctionssetMatrix(name:string, value:Matrix4x4): void

Set the Color property of the material

Example

const mat = new APJS.Matrix4x4f();
material.setMatrix('_Custom_Mat4', mat);
TypeNameInterface Description
FunctionssetTexture(name:string, texture:Texture):void

Set the Texture property of the material

Example

material.setTexture('_Custom_Sampler2D', tex);
TypeNameInterface Description
FunctionsgetFloat(name:string):number | undefined

Get the Float property of the material

Example

const value = material.getFloat('_Custom_Float');
TypeNameInterface Description
FunctionsgetVector(name:string):Vector2|Vector3|Vector4|undefined

Get the Vector property of the material

Example

const value = material.getVector('_Custom_Vec2');
TypeNameInterface Description
FunctionsgetMatrix(name:string):Matrix4x4 | undefined

Get the Matrix property of the material

Example

const eulerAngles = rotation.toEulerAngles();
TypeNameInterface Description
FunctionsgetColor(name: string): Color | undefined

Get the Color property of the material

Example

const value = material.getColor('_Custom_Color');
TypeNameInterface Description
FunctionsgetTexture(name:string):Texture | undefined

Get the Texture property of the material

Example

const tex = material.getTexture('_Custom_Sampler2D') as APJS.Texture;
Copyright © 2025 TikTok. All rights reserved.
About TikTokHelp CenterCareersContactLegalCookies