Maschera avanzata
Le maschere avanzate sono predefiniti della serie di effetti maschera. Possono essere utilizzati per salvare e riutilizzare configurazioni di maschere complesse tra progetti diversi.
Esempi
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")
# Add a mask
my_fill_layer.add_mask(sp.layerstack.MaskBackground.Black)
# Insert a Smart Mask in the mask stack
insert_position = sp.layerstack.InsertPosition.inside_node(
my_fill_layer, sp.layerstack.NodeStack.Mask)
smart_mask = sp.resource.search("s:starterassets "
"u:smartmask "
"n:Concrete Edges ")[0]
my_smart_mask = sp.layerstack.insert_smart_mask(insert_position, smart_mask.identifier())
# Select all the effects contained in the Smart Mask preset
sp.layerstack.set_selected_nodes(my_smart_mask)
Funzioni e classi
substance_painter.layerstack.insert_smart_mask(position: InsertPosition, smart_mask: ResourceID) -> Elenco[GeneratorEffectNode | PaintEffectNode | FillEffectNode | LevelsEffectNode | CompareMaskEffectNode | FilterEffectNode | ColorSelectionEffectNode | AnchorPointEffectNode] substance_painter.layerstack.insert_smart_mask
Inserite una maschera avanzata in una pila di maschere.
Parametri:
- posizione (InserisciPosizione) - La posizione di inserimento deve trovarsi all’interno di un
LayerNodeconNodeStack.Masko sopra/sotto unEffectNodenello stack di maschere. - smart_mask (ResourceID): maschera avanzata da creare. La risorsa deve avere un utilizzo
Usage.SMART_MASK.
Generazioni:
- Errore valore - Se l’inserimento non è riuscito a causa di una posizione non valida. Vedere
InsertPosition. - Errore valore - Se smart_mask non è una risorsa valida o non è utilizzato
Usage.SMART_MASK.
Restituisce: i nodi inseriti.
Tipo di valore restituito: Elenco[GeneratorEffectNode | PaintEffectNode | FillEffectNode | LevelsEffectNode | CompareMaskEffectNode | FilterEffectNode | ColorSelectionEffectNode | AnchorPointEffectNode]
substance_painter.layerstack.create_smart_mask(layer: LayerNode, name: str) -> Risorsa substance_painter.layerstack.create_smart_mask
Creare una maschera avanzata con nome name dalla pila di maschere del layer specificato.
Parametri:
- layer (LayerNode): livello principale dello stack di maschere da creare.
- name (str) - Nome della maschera avanzata.
Restituisce: la maschera avanzata creata come risorsa.
Tipo restituito: Risorsa
substance_painter.layerstack.export_as_smart_mask(layer: LayerNode, name: str, path: str) substance_painter.layerstack.export_as_smart_mask
Esporta la pila di maschere del layer specificato come maschera avanzata con nome name nel path specificato. A differenza di substance_painter.layerstack.create_smart_mask(), la maschera avanzata non è memorizzata in uno scaffale ma solo scritta nel file system.
Parametri:
- layer (LayerNode): livello principale dello stack di maschere da creare.
- name (str) - Nome della maschera avanzata. Questo nome viene utilizzato anche come nome del file. Se il file esiste già, verrà sovrascritto.
- percorso (str): il percorso in cui esportare la maschera avanzata. Se il percorso non esiste, verrà creato.