Material inteligente

Los materiales inteligentes son ajustes preestablecidos de capas. Se pueden utilizar para guardar y reutilizar configuraciones complejas de capas en proyectos que se adaptan al modelo 3D.

Ejemplos

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())

Funciones y clases

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

Inserte un material inteligente en la posición dada.

Parámetros:

Aumentos:

  • ValueError: si se produjo un error en la inserción debido a una posición no válida. Consulte InsertPosition.
  • ValueError: si smart_material no es un recurso válido o no tiene Usage.SMART_MATERIAL uso.

Devuelve: El nodo insertado.

Tipo de valor devuelto: GroupLayerNode

substance_painter.layerstack.create_smart_material(group: GroupLayerNode, nombre: str) -> Recurso substance_painter.layerstack.create_smart_material

Cree un material inteligente con el nombre name a partir del group especificado.

Parámetros:

  • group (GroupLayerNode): la carpeta raíz del material inteligente.
  • nombre (str): el nombre del material inteligente.

Devuelve: El material inteligente creado como recurso.

Tipo de valor devuelto: Recurso

substance_painter.layerstack.export_as_smart_material(group: GroupLayerNode, nombre: str, ruta: str) substance_painter.layerstack.export_as_smart_material

Exporte el group dado como un material inteligente con el nombre name en el path dado. A diferencia de substance_painter.layerstack.create_smart_material(), el material inteligente no se almacena en un estante, sino que solo se escribe en el sistema de archivos.

Parámetros:

  • group (GroupLayerNode): la carpeta raíz del material inteligente.
  • nombre (str): el nombre del material inteligente. Este nombre también se utiliza como nombre de archivo. Si el archivo ya existe, se sobrescribirá.
  • ruta (str): la ruta a la que se va a exportar el material inteligente. Si la ruta no existe, se creará.
recommendation-more-help
substance-3d-dev-help-painter-python-guide