SourceReference

SourceReference은(는) layerstack에서 AnchorPointEffectNode을(를) 사용할 수 있는 원본 유형입니다.

예

import substance_painter as sp

# Get the currently displayed stack
stack = sp.textureset.get_active_stack()

# Insert a paint layer
position = sp.layerstack.InsertPosition.from_textureset_stack(stack)
paint = sp.layerstack.insert_paint(position)

# Insert an anchor point in the content stack
position = sp.layerstack.InsertPosition.inside_node(paint, sp.layerstack.NodeStack.Content)
anchor = sp.layerstack.insert_anchor_point_effect(position, "anchor")

# Insert a fill layer with a mask
position = sp.layerstack.InsertPosition.from_textureset_stack(stack)
fill = sp.layerstack.insert_fill(position)
fill.add_mask(sp.layerstack.MaskBackground.White)

# Insert a reference on `anchor` in multi-channel context
source = fill.set_material_source(anchor)

# Edit the channel mapping
new_mapping = {
    sp.textureset.ChannelType.BaseColor: sp.textureset.ChannelType.Metallic,
    sp.textureset.ChannelType.Metallic: sp.textureset.ChannelType.BaseColor,
    sp.textureset.ChannelType.Roughness: sp.textureset.ChannelType.Height,
    sp.textureset.ChannelType.Normal: sp.textureset.ChannelType.BaseColor,
    sp.textureset.ChannelType.Height: sp.textureset.ChannelType.Metallic
}
for dst_chn, src_chn in new_mapping.items():
    source.channel_mapping[dst_chn] = src_chn

# Select the Fill layer
sp.layerstack.set_selected_nodes([fill])

class substance_painter.source.SourceReference(uid) substance_painter.source.SourceReference

앵커 포인트에 대한 참조를 나타내는 클래스입니다.

property channel_mapping: ChannelMapping substance_painter.source.SourceReference.channel_mapping

채널 매핑 속성입니다.

Getter:​에서 채널 매핑 속성을 반환합니다.

상승:

EditionContextException - 참조의 현재 컨텍스트가 다중 채널이 아닌 경우

referenced_channel 속성: ChannelType substance_painter.source.SourceReference.referenced_channel

소스의 참조된 채널입니다.

Getter: 원본의 참조된 채널을 반환합니다.

Setter: 원본의 참조된 채널을 설정합니다.

상승:

EditionContextException - 참조의 현재 컨텍스트가 단일 채널이 아니거나 대상 기준점의 컨텍스트가 다중 채널이 아닌 경우

anchor 속성: AnchorPointEffectNode substance_painter.source.SourceReference.anchor

이 소스에서 사용하는 앵커입니다.

Getter: 소스에서 사용된 앵커를 반환합니다.

alpha_matte 속성: AlphaMatte substance_painter.source.SourceReference.alpha_matte

이 소스에서 사용하는 알파 매트입니다.

Getter: 소스의 알파 매트를 반환합니다.

세터: 소스의 알파 매트를 설정합니다.

get_levels() -> LevelsParamsMono | LevelsParamsRGB substance_painter.source.SourceReference.get_levels

이 소스의 레벨에서 사용되는 매개 변수를 가져옵니다.

반환: 이 원본의 수준에서 사용하는 매개 변수입니다.

반환 형식: LevelsParamsMono | LevelsParamsRGB

set_levels(params: LevelsParamsMono | LevelsParamsRGB) -> 없음 substance_painter.source.SourceReference.set_levels

이 소스의 레벨에서 사용되는 매개 변수를 설정합니다.

매개 변수: 매개 변수 (LevelsParamsMono | LevelsParamsRGB) - 이 원본의 수준에서 사용되는 매개 변수입니다.

반환 형식: 없음

class substance_painter.source.ChannelMapping(uid) substance_painter.source.ChannelMapping

이 클래스는 소스 참조의 활성 채널에 dict 방식으로 액세스할 수 있도록 합니다. channel_mapping 속성을 참조하십시오.

예:

import substance_painter as sp
mapping = some_SourceReference_object.channel_mapping
mapping[sp.textureset.ChannelType.BaseColor] = sp.textureset.ChannelType.Specular
for channel in mapping:
    print(mapping[channel])
TIP
참고 항목: 자세한 기술 정보는 공식 KeysView ABCs 컨테이너 설명서 및 __getitem__ 및 __setitem__ 메서드를 참조하십시오.

열거형

class substance_painter.source.AlphaMatte(value) substance_painter.source.AlphaMatte

구성원:

이름
설명
KeepAlpha
알파를 유지해
ExtractAlpha
알파를 추출합니다.
DefaultBackgroundColor
기본 배경색으로 알파를 매트합니다.
NOTE
멤버를 정의하는 데 사용되는 이름은 .name 특성을 통해 문자열로 사용할 수 있습니다(python enum.Enum 참조).
recommendation-more-help
substance-3d-dev-help-painter-python-guide