User Guide Cancel

textureset class | Substance 3D Painter Python API

textureset class

TextureSet class

class substance_painter.textureset.

TextureSet

TextureSet(material_id: int)

A Substance 3D Painter Texture Set. A Texture Set has a resolution and a number of stacks, and can be layered or not. It optionally also has a number of UV Tiles.

It uses a set of baked Mesh map textures. Each Mesh map has a defined MeshMapUsage.

If the corresponding material is not layered, the Texture Set has just one stack, which is transparent to the user. If the material is layered, the Texture Set has several stacks.

Example

See also

Stack, UVTile, MeshMapUsage, Texture Set documentation.

static
from_name
from_name(texture_set_name: str)

Get the Texture Set from its name.

Parameters

texture_set_name (str) – The name of the Texture Set.

Note

The Texture Set name is case sensitive.

Raises
  • ProjectError – If no project is opened.
  • ServiceNotFoundError – If Substance 3D Painter has not started all its services yet.
  • TypeError – If texture_set_name is missing or not a string.
  • ValueError – If texture_set_name is empty.
  • ValueError – If there is no Texture Set with the name texture_set_name.
name
name() → str

Get the Texture Set name.

Returns

The name of the Texture Set.

Return type

str

Raises
  • ProjectError – If no project is opened.
  • ServiceNotFoundError – If Substance 3D Painter has not started all its services yet.
  • ValueError – If the Texture Set is invalid.
is_layered_material
is_layered_material() → bool

Query if this Texture Set uses material layering.

Returns

True if the Texture Set uses material layering, False otherwise.

Return type

bool

Raises
  • ProjectError – If no project is opened.
  • ServiceNotFoundError – If Substance 3D Painter has not started all its services yet.
  • ValueError – If the Texture Set is invalid.
all_stacks
all_stacks() → List[Stack]

List all the stacks from this Texture Set.

Returns

All the stacks of this Texture Set.

Return type

list[Stack]

Raises
  • ProjectError – If no project is opened.
  • ServiceNotFoundError – If Substance 3D Painter has not started all its services yet.
  • ValueError – If the Texture Set is invalid.

See also

TextureSet.get_stack().

get_stack
get_stack(stack_name: str = '') → Stack

Get a stack of this Texture Set from its name.

Parameters

stack_name (str) – The stack name. Leave empty if the Texture Set does not use material layering.

Note

The stack name is case sensitive.

Returns

The stack.

Return type

Stack

Raises
  • ProjectError – If no project is opened.
  • ServiceNotFoundError – If Substance 3D Painter has not started all its services yet.
  • ValueError – If the Texture Set is invalid.

See also

TextureSet.all_stacks().

get_resolution
get_resolution() → Resolution

Get the Texture Set resolution.

Returns

The resolution of this Texture Set in pixels.

Return type

Resolution

Raises
  • ProjectError – If no project is opened.
  • ServiceNotFoundError – If Substance 3D Painter has not started all its services yet.
  • ValueError – If the Texture Set is invalid.

See also

TextureSet.set_resolution(), set_resolutions().

set_resolution
set_resolution(new_resolution: Resolution)

Set the resolution of the Texture Set.

See resolution restrictions: Resolution.

Note

For any Texture Set, you can find its accepted resolutions in the “Texture Set Settings” window, in the “Size” menu.

Parameters

new_resolution (Resolution) – The new resolution for this Texture Set.

Raises
  • ProjectError – If no project is opened.
  • ServiceNotFoundError – If Substance 3D Painter has not started all its services yet.
  • ValueError – If new_resolution is not a valid resolution.
  • ValueError – If the Texture Set is invalid.

See also

TextureSet.get_resolution(), set_resolutions().

has_uv_tiles
has_uv_tiles() → bool

Check if the Texture Set uses the UV Tiles workflow.

Returns

True if the Texture Set uses the UV Tiles workflow, False otherwise.

Return type

bool

Raises

ProjectError – If no project is opened.

See also

all_uv_tiles()

all_uv_tiles
all_uv_tiles() → List[UVTile]

Get the list of the Texture Set UV Tiles, ordered by U then V coordinates.

Returns

List of the Texture Set UV Tiles, ordered by U then V coordinates.

Return type

List[UVTile]

Raises

ProjectError – If no project is opened.

See also

has_uv_tiles()

get_uvtiles_resolution
get_uvtiles_resolution() → Dict[UVTile, Resolution]

Get all UV Tiles that have a different resolution from the Texture Set, associated to their effective resolution.

Returns

The dictionary of uvtiles and their associated resolution.

Return type

Dict[UVTile, Resolution]

Raises

ProjectError – If no project is opened.

See also

UVTile.get_resolution()

set_uvtiles_resolution
set_uvtiles_resolution(resolutions: Dict[UVTile, Resolution])

Set the resolution of the given UV Tiles to the associated resolution.

Parameters

resolutions (Dict[UVTile, Resolution]) – The dictionary of UV Tiles and their associated resolution.

Raises

ProjectError – If no project is opened.

See also

UVTile.set_resolution()

reset_uvtiles_resolution
reset_uvtiles_resolution(uvtiles: List[UVTile])

Reset the resolution of the given UV Tiles to the parent Texture Set’s resolution.

Parameters

uvtiles (List[UVTile]) – The list of UV Tiles to be reset.

Raises

ProjectError – If no project is opened.

See also

UVTile.reset_resolution()

all_mesh_names
all_mesh_names() → List[str]

Get the list of meshes of the Texture Set. When using UV Tiles, the result is the union of the mesh names of every UV Tiles.

Raises

See also

UVTile.all_mesh_names()

get_mesh_map_resource
get_mesh_map_resource(usage: MeshMapUsage) → Optional[ResourceID]

Query the Mesh map for the given usage of the Texture Set.

Parameters

usage (MeshMapUsage) – Which Mesh map usage is queried.

Returns

The Mesh map resource or None.

Return type

ResourceID

set_mesh_map_resource
set_mesh_map_resource(usage: MeshMapUsage, new_mesh_map: Optional[ResourceID]) → None

Replace the Mesh map for the given usage of the Texture Set.

Parameters
  • usage (MeshMapUsage) – Which Mesh map usage to replace.
  • new_mesh_map (ResourceID, optional) – The new Mesh map or None to unset.
Raises
  • ResourceNotFoundError – If the resource new_mesh_map is not found or is not of type IMAGE.
  • ValueError – If the resource is already used for another Mesh map usage for the Texture Set.

 Adobe

Get help faster and easier

New user?

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online