Stack 클래스

class substance_painter.textureset.Stack(stack_id: int | 없음 = 없음) substance_painter.textureset.Stack

Substance 3D Painter 채색 가능 스택.

스택은 재료에 대응하는 다수의 채널(BaseColor, Specular, 거칠음 등)을 포함할 수 있다. 스택은 하나 이상의 스택을 포함할 수 있는 텍스처 세트에 속합니다.

일반적으로 하나의 스택만 사용되며 해당 스택은 사용자에게 투명합니다. 텍스처 세트를 선택하면 스택이 선택됩니다. 그러나 [텍스처 세트]에서는 사용자 정의 셰이더가 있는 레이어 재질을 사용할 수 있으며 이 경우 특정 스택을 선택해야 합니다.

텍스처 세트에서 재질 레이어를 사용하지 않으면 다음과 같이 스택을 검색할 수 있습니다.

import substance_painter.textureset

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

# Alternatively, get the stack from a Texture Set instance:
my_texture_set = substance_painter.textureset.TextureSet.from_name("TextureSetName")
paintable_stack = my_texture_set.get_stack()

텍스처 세트에서 재질 레이어를 사용하는 경우 다음과 같이 스택을 읽어들일 수 있습니다.

import substance_painter.textureset

# Get the stack called "Mask1" from the Texture Set "TextureSetName":
paintable_stack = substance_painter.textureset.Stack.from_name("TextureSetName",
                                                               "Mask1")

# Alternatively, get the stack from a Texture Set instance:
my_texture_set = substance_painter.textureset.TextureSet.from_name("TextureSetName")
paintable_stack = my_texture_set.get_stack("Mask1")

# Show the name of the stack:
print(paintable_stack.name())

스택의 채널을 쿼리, 추가, 제거 또는 편집할 수 있습니다.

import substance_painter.textureset

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

# List all the channels of the "TextureSetName" Texture Set:
for k,v in paintable_stack.all_channels().items():
    print("{0}: {1}".format(k, str(v.format())))

# Add a scattering channel to the "TextureSetName" Texture Set:
paintable_stack.add_channel(substance_painter.textureset.ChannelType.Scattering,
                            substance_painter.textureset.ChannelFormat.L8)

# Query details of the added scattering channel:
if paintable_stack.has_channel(substance_painter.textureset.ChannelType.Scattering):
    channel = paintable_stack.get_channel(
        substance_painter.textureset.ChannelType.Scattering)
    print("The Texture Set now has a scattering channel with {0} bits per pixel."
        .format(channel.bit_depth()))

# Change the scattering channel to 16 bits inside the "TextureSetName" Texture Set:
paintable_stack.edit_channel(
    channel_type = substance_painter.textureset.ChannelType.Scattering,
    channel_format = substance_painter.textureset.ChannelFormat.L16)

# Remove the scattering channel from "TextureSetName":
paintable_stack.remove_channel(substance_painter.textureset.ChannelType.Scattering)
TIP
참고 항목: TextureSet, 텍스처 집합 설명서.

매개 변수: stack_id(int)

static from_name(텍스처_세트_이름: str, 스택_이름: str = ‘’) substance_painter.textureset.Stack.from_name

해당 이름에서 스택을 가져옵니다.

매개 변수:

  • 텍스처_집합_이름 (str) - 텍스처 집합 이름입니다.
  • stack_name(str) - 스택 이름입니다. 텍스처 세트에서 재질 레이어를 사용하지 않는 경우 비워 둡니다.
NOTE
텍스처 세트 및 스택 이름은 대/소문자를 구분합니다.

상승:

  • 프로젝트 오류 - 프로젝트가 열려 있지 않은 경우.
  • ServiceNotFoundError - Substance 3D Painter에서 아직 모든 서비스를 시작하지 않은 경우.
  • ValueError - texture_set_name이(가) 문자열이 아닌 경우
  • ValueError - 이름이 texture_set_name인 텍스처 집합이 없는 경우
  • ValueError - 이름이 stack_name인 스택이 없는 경우

매개 변수:

  • 텍스처_집합_이름(str)
  • stack_name(str)

name() -> str substance_painter.textureset.Stack.name

스택 이름을 가져옵니다. 스택 이름이 비어 있는 경우 해당 스택 이름이 속한 텍스처 세트에서 재질 레이어를 사용합니다.

반환: 스택 이름입니다.

반환 형식: str

상승:

  • 프로젝트 오류 - 프로젝트가 열려 있지 않은 경우.
  • ServiceNotFoundError - Substance 3D Painter에서 아직 모든 서비스를 시작하지 않은 경우.
  • ValueError - 스택이 잘못된 경우.

material() substance_painter.textureset.Stack.material

이 스택이 속한 텍스처 세트를 가져옵니다.

반환: 이 스택이 속한 텍스처 집합입니다.

반환 형식: TextureSet

상승:

  • 프로젝트 오류 - 프로젝트가 열려 있지 않은 경우.
  • ServiceNotFoundError - Substance 3D Painter에서 아직 모든 서비스를 시작하지 않은 경우.
  • ValueError - 스택이 잘못된 경우.
TIP
참고 항목: TextureSet, all_texture_sets().

all_channels() -> Dict[ChannelType, Channel] substance_painter.textureset.Stack.all_channels

스택의 모든 채널을 나열합니다.

반환: 스택의 모든 채널에 대한 맵입니다.

반환 형식: dict[채널 형식, 채널]

상승:

add_channel(channel_type: ChannelType, channel_format: ChannelFormat, label: str | 없음 = 없음) -> 채널 substance_painter.textureset.Stack.add_channel

스택에 새 채널을 추가합니다.

NOTE
add_channel은 재질 레이어에서 사용할 수 없습니다.

매개 변수:

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

반환: 생성된 채널입니다.

반환 형식: 채널

상승:

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

remove_channel(channel_type: ChannelType) -> 없음 substance_painter.textureset.Stack.remove_channel

스택에서 채널을 제거합니다.

NOTE
remove_channel은 재질 레이어에서 사용할 수 없습니다.

매개 변수: channel_type(ChannelType) - 채널 유형입니다.

상승:

  • 프로젝트 오류 - 프로젝트가 열려 있지 않은 경우.
  • ValueError - 이 텍스처 집합에 channel_type 유형의 채널이 없는 경우.
  • ValueError - 스택이 잘못된 경우.
  • ValueError - 텍스처 세트에서 재질 레이어를 사용하는 경우.

반환 형식: 없음

edit_channel(channel_type: ChannelType, channel_format: ChannelFormat, label: str | 없음 = 없음) -> 없음 substance_painter.textureset.Stack.edit_channel

채널의 텍스처 형식 및 레이블을 변경합니다.

매개 변수:

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

상승:

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

반환 형식: 없음

has_channel(channel_type: ChannelType) -> bool substance_painter.textureset.Stack.has_channel

스택에 채널이 있는지 확인합니다.

매개 변수: channel_type(ChannelType) - 채널 유형입니다.

반환: True(스택에 지정된 형식의 채널이 있는 경우), False(그렇지 않은 경우).

반환 형식: bool

상승:

  • 프로젝트 오류 - 프로젝트가 열려 있지 않은 경우.
  • ValueError - 스택이 잘못된 경우.

get_channel(channel_type: ChannelType) -> 채널 substance_painter.textureset.Stack.get_channel

해당 유형에서 기존 채널을 가져옵니다.

매개 변수: 채널_유형(채널) - 채널 유형입니다.

반환: 채널.

반환 형식: 채널

상승:

  • 프로젝트 오류 - 프로젝트가 열려 있지 않은 경우.
  • ServiceNotFoundError - Substance 3D Painter에서 아직 모든 서비스를 시작하지 않은 경우.
  • ValueError - 채널이 없는 경우.
recommendation-more-help
substance-3d-dev-help-painter-python-guide