스마트 재질

스마트 재질은 레이어의 사전 설정입니다. 이러한 효과는 3D 모델에 적용되는 프로젝트 간에 레이어의 복잡한 설정을 저장하고 다시 사용하는 데 사용할 수 있습니다.

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 a Smart Material
smart_material = sp.resource.search("s:starterassets "
                                    "u:smartmaterial "
                                    "n:Aluminium ")[0]
my_smart_material = sp.layerstack.insert_smart_material(
    position_stack_top, smart_material.identifier())

# Print the name of the parent layer node
print(my_smart_material.get_name())

# Select the layers contained by the parent layer
sp.layerstack.set_selected_nodes(my_smart_material.sub_layers())

함수 및 클래스

substance_painter.layerstack.insert_smart_material(position: InsertPosition, smart_material: ResourceID) -> GroupLayerNode substance_painter.layerstack.insert_smart_material

지정된 위치에 스마트 재질을 삽입합니다.

매개 변수:

상승:

  • ValueError - 잘못된 위치로 인해 삽입이 실패한 경우. InsertPosition 보기
  • ValueError - smart_material이 올바른 리소스가 아니거나 Usage.SMART_MATERIAL 사용이 없는 경우.

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

반환 형식: GroupLayerNode

substance_painter.layerstack.create_smart_material(group: GroupLayerNode, name: str) -> 리소스 substance_painter.layerstack.create_smart_material

지정된 group에서 이름이 name인 스마트 재질을 만듭니다.

매개 변수:

  • group(GroupLayerNode) - 스마트 재질의 루트 폴더입니다.
  • 이름 (str) - 스마트 재질 이름입니다.

반환: 리소스로 만든 스마트 재질.

반환 형식: 리소스

substance_painter.layerstack.export_as_smart_material(그룹: GroupLayerNode, 이름: str, 경로: str) substance_painter.layerstack.export_as_smart_material

지정된 group을(를) 지정된 path에서 이름이 name인 스마트 재질으로 내보냅니다. substance_painter.layerstack.create_smart_material()과(와) 달리 스마트 재질은 셸프에 저장되지 않고 파일 시스템에만 기록됩니다.

매개 변수:

  • group(GroupLayerNode) - 스마트 재질의 루트 폴더입니다.
  • 이름 (str) - 스마트 재질 이름입니다. 이 이름은 파일 이름으로도 사용됩니다. 파일이 이미 있으면 덮어씁니다.
  • path (str) - 스마트 재질을 내보낼 경로입니다. 경로가 없으면 생성됩니다.
recommendation-more-help
substance-3d-dev-help-painter-python-guide