setTextureData

Sets the TextureData of a specific TextureConfig by its id. A regular Blob can be passed down as well.

setTextureData(
	textureId: string,
	image: TextureData | Blob
): Promise<void>

Parameters
Description
Type

textureId

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

string

image

Object containing the ArrayBuffer, width and height of the texture to be set.

Usage:

const mat = await api.getActiveMaterial('T-Shirt');
const tid = mat.properties.color.id;
const textureData = await api.setTextureData(
	tid,
	{
		image: {ArrayBuffer}
		width: 2048,
		height: 2048,
	}
);

Last updated