채널 클래스

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

Substance 3D Painter 채널.

채널은 미리 정의된 유형(BaseColor, Specular, 거칠기 등) 중 하나일 수 있습니다 또는 재질에 해당하는 사용자 정의 유형(User0 - User31)입니다. 채널은 스택에 속합니다. 스택에는 하나 이상의 채널이 있을 수 있지만 각 ChannelType의 채널은 하나만 있을 수 있습니다.

예

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)

매개 변수: 채널_id(int)

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

채널 형식을 가져옵니다. 형식은 채널이 컬러인지 회색 음영인지 여부, 동적 범위, 구성 요소당 비트 수 및 스토리지가 선형인지 또는 sRGB인지를 모두 나타냅니다.

반환: 이 채널 형식입니다.

반환 형식: 채널 형식

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

사용자 채널(User0 - User31)에 대한 사용자 레이블을 가져옵니다.

반환: 이 채널 사용자 레이블. 사용자 채널이 아닌 채널의 빈 문자열입니다.

반환 형식: str

​>[!TIP]
​>
​> 참고 항목: Channel.type(), ChannelType.

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

채널이 컬러 포맷인지 회색 음영 포맷인지 확인합니다.

채널 형식이 색상 형식인 경우 True을(를) 반환합니다.

반환 형식: bool

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

채널이 부동 소수점 형식인지 아니면 정규화된 고정 소수점 형식인지 확인합니다.

채널 형식이 부동 소수점 형식인 경우 True을(를) 반환합니다.

반환 형식: bool

bit_깊이() -> int {#substance_painter.textureset.Channel.bit_depth}

구성 요소당 비트 수를 가져옵니다.

반환: 구성 요소당 채널 비트 심도.

반환 형식: int

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

채널 유형을 가져옵니다.

반환: 이 채널 형식입니다.

반환 형식: 채널 형식

​>[!TIP]
​>
​> 참고 항목: Channel.label().

edit(channel_format: ChannelFormat, label: str | 없음 = 없음) -> 없음 {#substance_painter.textureset.Channel.edit}

채널 포맷과 레이블을 변경합니다.

매개 변수:

  • channel_format (ChannelFormat) - 채널의 새 텍스처 형식입니다.
  • 레이블 (str*,* 선택 사항) - 유형이 사용자 채널인 경우 채널의 레이블입니다.

상승:

  • 프로젝트 오류 - 프로젝트가 열려 있지 않은 경우.
  • ValueError - 이 텍스처 집합에 stack_id 레이블이 지정된 스택이 없는 경우.
  • ValueError - 이 텍스처 집합에 channel_type 유형의 채널이 없는 경우.
  • ValueError - 레이블이 제공되었지만 channel_type이(가) 사용자 유형이 아닌 경우. 표준 채널 유형에는 고정 레이블이 있습니다.
  • ValueError - 채널이 잘못된 경우.

반환 형식: 없음

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