인스턴스 레이어

InstanceLayerNode은(는) 메시 종속 결과를 생성할 수 있는 동안 여러 레이어 및 텍스처 집합에서 레이어 매개 변수를 동기화할 수 있는 노드 유형입니다. 소스 레이어만 수정할 수 있습니다.

TIP
참고 항목: 레이어 인스턴싱 설명서.

예

import substance_painter as sp

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

# Get top position of the Stack
position_stack_top = sp.layerstack.InsertPosition.from_textureset_stack(stack)

# Insert Fill Layer
my_fill_layer = sp.layerstack.insert_fill(position_stack_top)
my_fill_layer.set_name("My Fill Layer")

# Create two instances of the Fill layer
insert_position = sp.layerstack.InsertPosition.below_node(my_fill_layer)
instance1 = sp.layerstack.instantiate(insert_position, my_fill_layer)
instance1.set_name("Instance 1")

instance2 = sp.layerstack.instantiate(insert_position, my_fill_layer)
instance2.set_name("Instance 2")

# Print instances of the parent layer
instances = my_fill_layer.instances()
print("Instances of " + my_fill_layer.get_name() + ":")
for instance in instances:
    print("- " + instance.get_name())

# Print parent of each instance
print("Parent of " + instance1.get_name() + ": " + instance1.instance_source().get_name())
print("Parent of " + instance2.get_name() + ": " + instance2.instance_source().get_name())

# Select the Instances
sp.layerstack.set_selected_nodes([instance1, instance2])

함수 및 클래스

substance_painter.layerstack.instantiate(position: InsertPosition, layer: LayerNode) -> InstanceLayerNode substance_painter.layerstack.instantiate

지정된 레이어를 인스턴스화합니다. 개념에 익숙하지 않은 경우 레이어 인스턴싱에 대한 설명서를 참조하십시오. 레이어 인스턴싱 설명서.

매개 변수:

상승:

ValueError - 잘못된 위치로 인해 삽입이 실패한 경우. InsertPosition 보기

삽입된 노드를 반환합니다.

반환 형식: InstanceLayerNode

class substance_painter.layerstack.InstanceLayerNode(uid) substance_painter.layerstack.InstanceLayerNode

인스턴스 레이어를 조작할 수 있는 노드입니다.

원본 레이어에서 InstanceLayerNode 목록을 검색하려면 LayerNode.instances()을(를) 참조하십시오.

instance_source() -> LayerNode substance_painter.layerstack.InstanceLayerNode.instance_source

이 인스턴스의 소스 레이어를 반환합니다.

반환: 이 인스턴스인 경우 원본 레이어입니다.

반환 형식: LayerNode

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