mapTextures

Maps two textures together. The top texture is mapped on top of the base texture, with the specified options.

mapTextures(
	baseTextureId: string,
	topTextureId: string,
	options?: {
		width?: number;
		height?: number;
		top?: number;
		left?: number;
	}
): Promise<void>

Parameters
Description
Type

baseTextureId

Id of a TextureConfig that can be retrieved from a Material’s specific texture channel.

string

topTextureId

Id of the top texture that will be applied on top of the base.

string

options

All are optional.

width has preference over height in case they are both specified.

top and left default to 0.

width, height, top, left

Usage:

const material = await modelApi.getActiveMaterial('T-shirt');
const newTextureId = await modelApi.addTexture({TextureData | Blob})

await modelApi.mapTextures(material.baseColor.textureConfig.id, newTextureId, {
	top: topInput.value,
	left: leftInput.value,
	width: widthInput.value
});

Last updated