Classe canale

class substance_painter.textureset.Channel(channel_id: int | Nessuno = Nessuno) {#substance_painter.textureset.Channel}

Un canale Substance 3D Painter.

Un canale può essere uno dei tipi predefiniti (BaseColor, Specular, Rugosità e così via) o un tipo definito dall’utente (da User0 a User31), corrispondente al materiale. Il canale appartiene a una pila. Lo stack può avere uno o più di essi, ma può avere un solo canale di ogni ChannelType.

Esempio

import substance_painter.textureset


# Get the unnamed stack of "TextureSetName":
paintable_stack = substance_painter.textureset.Stack.from_name("TextureSetName")


# Get the channel "BaseColor" of that stack:
base_color_channel = paintable_stack.get_channel(
        substance_painter.textureset.ChannelType.BaseColor)


# Print the color format and bit depth of the base color channel:
print("The channel format uses {0} {1}.".format(
        "RGB" if base_color_channel.is_color() else "L",
        base_color_channel.bit_depth()))


# Change the format and bit depth of the base color channel:
base_color_channel.edit(
        channel_format = substance_painter.textureset.ChannelFormat.RGB16)

Parametri: canale_id (int)

format() -> ChannelFormat {#substance_painter.textureset.Channel.format}

Ottieni il formato del canale. Il formato indica sia se il canale è a colori o in scala di grigi, il suo intervallo dinamico, i suoi bit per componente, sia se lo storage è lineare o sRGB.

Restituisce: Questo formato di canale.

Tipo restituito: ChannelFormat

label() -> str {#substance_painter.textureset.Channel.label}

Ottieni l’etichetta utente per i canali utente (da User0 a User31).

Restituisce: questa etichetta utente del canale. Stringa vuota per i canali non utente.

Tipo restituito: str

​>[!TIP]
​>
​> Vedere anche: Channel.type(), ChannelType.

is_color() -> bool {#substance_painter.textureset.Channel.is_color}

Verifica se il canale è in formato a colori o in scala di grigio.

Restituisce: True se il formato del canale è un formato di colore.

Tipo restituito: bool

is_floating() -> bool {#substance_painter.textureset.Channel.is_floating}

Controllare se il canale è in formato a virgola mobile o a virgola fissa normalizzato.

Restituisce: True se il formato del canale è a virgola mobile.

Tipo restituito: bool

bit_profondità() -> int {#substance_painter.textureset.Channel.bit_depth}

Ottieni il numero di bit per componente.

Restituisce: la profondità di bit del canale per componente.

Tipo restituito: int

type() -> ChannelType {#substance_painter.textureset.Channel.type}

Ottieni il tipo di canale.

Restituisce: Questo tipo di canale.

Tipo restituito: ChannelType

​>[!TIP]
​>
​> Vedere anche: Channel.label().

edit(channel_format: ChannelFormat, etichetta: str | Nessuno = Nessuno) -> Nessuno {#substance_painter.textureset.Channel.edit}

Cambia il formato e l’etichetta del canale.

Parametri:

  • canale_formato (FormatoCanale) - Il nuovo formato di texture del canale.
  • etichetta (str*,* facoltativo) - Etichetta del canale in caso di tipo Canale utente.

Generazioni:

  • Errore progetto - Se non è aperto alcun progetto.
  • Errore valore - Se non è presente uno stack con etichetta stack_id in questo set di texture.
  • Errore valore - Se in questo set di texture non è presente alcun canale di tipo channel_type.
  • Errore valore - Se è stata specificata un’etichetta ma channel_type non è un tipo utente. I tipi di canale standard hanno etichette fisse.
  • Errore valore - Se il canale non è valido.

Tipo restituito: Nessuno

recommendation-more-help
substance-3d-dev-help-painter-python-guide