User Guide Cancel

channel | Substance 3D Painter Python API

channel

Channel class

class substance_painter.textureset.

Channel

Channel(channel_id: Optional[int] = None)

A Substance 3D Painter channel.

A channel can be one of the predefined types (BaseColor, Specular, Roughness, etc.) or a user defined type (User0 to User7), corresponding to the material. The channel belongs to a stack. The stack can have one or more of them, but it can have only one channel of each ChannelType.

Example

format
format() → ChannelFormat

Get the channel format. The format indicates both if the channel is color or grayscale, its dynamic range, its bits per component, and if the storage is linear or sRGB.

Returns

This channel format.

Return type

ChannelFormat

label
label() → str

Get the user label for User channels (User0 to User7).

Returns

This channel user label. This is the empty string for non User channels.

Return type

str

See also

Channel.type(), ChannelType.

is_color
is_color() → bool

Check if the channel is in color or grayscale format.

Returns

True if the channel format is a color format.

Return type

bool

is_floating
is_floating() → bool

Check if the channel is in floating point or normalized fixed point format.

Returns

True if the channel format is a floating point format.

Return type

bool

bit_depth
bit_depth() → int

Get the number of bits per component.

Returns

The channel bit depth per component.

Return type

int

type
type() → ChannelType

Get the channel type.

Returns

This channel type.

Return type

ChannelType

See also

Channel.label().

edit
edit(channel_format: ChannelFormat, label: Optional[str] = None) → None

Change the channel format and label.

Parameters
  • channel_format (ChannelFormat) – The new texture format of the channel.
  • label (str, optional) – Label of the channel in case of User channel as type.
Raises
  • ProjectError – If no project is opened.
  • ValueError – If there is no stack labeled stack_id in this Texture Set.
  • ValueError – If there is no channel of type channel_type in this Texture Set.
  • ValueError – If a label was provided but channel_type is not a user type. Standard channel types have fixed labels.
  • ValueError – If the channel is invalid.

Get help faster and easier

New user?