Selezione stack di livelli
Il modulo layerstack consente di selezionare livelli ed effetti.
Esempi
Attivazione canale specifico
# This example shows how to activate specific channels on selected nodes in the layerstack.
# Before running this example, open a project and select some layers/effects from the UI
import substance_painter as sp
# Get the active stack
stack = sp.textureset.get_active_stack()
# Get the selected nodes in the layerstack
selected_nodes = sp.layerstack.get_selected_nodes(stack)
updated_nodes = []
# Iterate over the selected nodes
for node in selected_nodes:
if type(node) is sp.layerstack.FillLayerNode or type(node) is sp.layerstack.FillEffectNode:
# Set the active channels of the Fill to BaseColor
node.active_channels = {sp.layerstack.ChannelType.BaseColor}
updated_nodes.append(node)
# Select the edited nodes
sp.layerstack.set_selected_nodes(updated_nodes)
Ottieni selezione
substance_painter.layerstack.get_selected_node(stack: Stack) -> List[LayerNode | GroupLayerNode | PaintLayerNode | InstanceLayerNode | NodoLivelloRiempimento | GeneratorEffectNode | PaintEffectNode | FillEffectNode | LevelsEffectNode | CompareMaskEffectNode | FilterEffectNode | ColorSelectionEffectNode | AnchorPointEffectNode] substance_painter.layerstack.get_selected_nodes
Ottiene i nodi selezionati di una pila, ordinati come nella Pila livelli.
Parametri: stack (stack) - Stack su query.
Restituisce: i nodi selezionati dello stack.
Tipo di valore restituito: Elenco[NodoLivello | GroupLayerNode | PaintLayerNode | InstanceLayerNode | FillLayerNode | GeneratorEffectNode | PaintEffectNode | FillEffectNode | LevelsEffectNode | CompareMaskEffectNode | FilterEffectNode | ColorSelectionEffectNode | AnchorPointEffectNode]
substance_painter.layerstack.get_selection_type(layer: LayerNode) -> SelectionType substance_painter.layerstack.get_selection_type
Restituisce la parte di un livello selezionata (contenuto, maschera, ecc.).
Parametri: livello (NodoLivello) - Livello da sottoporre a query.
Genera: Errore valore - Se il livello non appartiene al set di texture attualmente selezionato.
Restituisce: la parte del livello selezionata.
Tipo restituito: SelectionType
Imposta selezione
substance_painter.layerstack.set_selected_node(nodi: List[GeneratorEffectNode | PaintEffectNode | FillEffectNode | LevelsEffectNode | CompareMaskEffectNode | FilterEffectNode | ColorSelectionEffectNode | AnchorPointEffectNode] | Elenco[NodoLivello]) substance_painter.layerstack.set_selected_nodes
Seleziona i nodi specificati nell’interfaccia utente della Pila livelli.
Nodi Pararm: nodi da selezionare.
Generazioni:
- Errore valore - Se i nodi non appartengono al set di texture attualmente selezionato.
- RuntimeError - Se chiamato da una sezione
ScopedModification
Parametri: nodi (Elenco**[GeneratorEffectNode | PaintEffectNode | FillEffectNode | LevelsEffectNode | CompareMaskEffectNode | FilterEffectNode | ColorSelectionEffectNode | *AnchorPointEffectNode *] | Elenco*[*LayerNode}{41 *
substance_painter.layerstack.set_selection_type(layer: LayerNode, layer_selection_type: SelectionType) substance_painter.layerstack.set_selection_type
Selezionate la parte del livello da selezionare.
Parametri:
- livello (NodoLivello) - Livello da selezionare.
- livello_selezione_tipo (SelectionType) - Parte del livello da selezionare (contenuto, maschera, ecc.).
Generazioni:
- Errore valore - Se il livello non appartiene al set di texture attualmente selezionato.
- RuntimeError - Se chiamato da una sezione
ScopedModification
Enums
classe substance_painter.layerstack.SelectionType(value) substance_painter.layerstack.SelectionType
Membri:
ContentMaskGeometryMaskProperties