기준점
AnchorPointEffectNode은(는) 레이어 스택의 모든 리소스 또는 요소를 노출하고 레이어 스택의 다른 영역에서 다른 용도와 다른 조정 집합을 사용하여 참조할 수 있도록 하는 노드 유형입니다.
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")
# Apply a material
aluminium_material = sp.resource.search("s:starterassets "
"u:substance "
"n:metal")[0]
my_fill_layer.set_material_source(aluminium_material.identifier())
# Add an anchor point
insert_position = sp.layerstack.InsertPosition.inside_node(
my_fill_layer, sp.layerstack.NodeStack.Content)
anchor_point = sp.layerstack.insert_anchor_point_effect(insert_position, "My Anchor Point")
# Insert Fill Layer
my_fill_layer2 = sp.layerstack.insert_fill(position_stack_top)
my_fill_layer2.set_name("My Fill Layer 2")
# Add a black mask and a fill effect in the mask stack
my_fill_layer2.add_mask(sp.layerstack.MaskBackground.Black)
insert_position = sp.layerstack.InsertPosition.inside_node(
my_fill_layer2, sp.layerstack.NodeStack.Mask)
my_fill_effect = sp.layerstack.insert_fill(insert_position)
# Load the anchor point on the Fill effect
my_fill_effect.set_source(None, anchor_point) # Use None as the mask stack is mono-channel
# Print the parent of the Anchor Point
print("Parent of " + anchor_point.get_name() + ": " + anchor_point.get_parent().get_name())
# Select the Fill effect
sp.layerstack.set_selected_nodes([my_fill_effect])
함수 및 클래스
substance_painter.layerstack.insert_anchor_point_effect(position: InsertPosition, name: str) -> AnchorPointEffectNode substance_painter.layerstack.insert_anchor_point_effect
고정점 효과를 삽입합니다.
매개 변수:
- position (InsertPosition) - 삽입 위치는
NodeStack.Content이(가) 있는LayerNode안이나NodeStack.Mask또는EffectNode보다 높거나 낮아야 합니다. - 이름(str) - 앵커 포인트의 이름입니다.
상승:
ValueError - 잘못된 위치로 인해 삽입이 실패한 경우. InsertPosition 보기
반환: 새 기준점입니다.
반환 형식: AnchorPointEffectNode
class substance_painter.layerstack.AnchorPointEffectNode(uid) substance_painter.layerstack.AnchorPointEffectNode
기준점 효과를 조작할 수 있는 노드입니다.
recommendation-more-help
substance-3d-dev-help-painter-python-guide