Ebenenstapelauswahl
Das Layerstack-Modul ermöglicht die Auswahl von Ebenen und Effekten.
Beispiele
Spezifische Kanalaktivierung
# 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)
Auswahl abrufen
substance_painter.layerstack.get_selected_nodes(Stapel: Stapel) -> List[LayerNode | GroupLayerNode | PaintLayerNode | InstanceLayerNode | FillLayerNode | GeneratorEffectNode | PaintEffectNode | FillEffectNode | LevelsEffectNode | CompareMaskEffectNode | FilterEffectNode | ColorSelectionEffectNode | AnchorPointEffectNode] substance_painter.layerstack.get_selected_nodes
Ruft die markierten Stapel eines Ebenenstapels ab, sortiert nach Knoten im Knoten.
Parameter: Stapel (Stapel) - abzufragender Stapel.
Gibt: Die ausgewählten Knoten des Stapels zurück.
Rückgabetyp: List[LayerNode | 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
Gibt den ausgewählten Teil einer Ebene zurück (Inhalt, Maske usw.).
Parameter: Ebene (Ebenenknoten) - abzufragende Ebene.
Löst Folgendes aus: ValueError - Wenn die Ebene nicht zum aktuell ausgewählten Textursatz gehört.
Gibt Folgendes zurück: Der ausgewählte Teil der Ebene.
Rückgabetyp: SelectionType
Auswahl festlegen
substance_painter.layerstack.set_selected_nodes(nodes: List[GeneratorEffectNode | PaintEffectNode | FillEffectNode | LevelsEffectNode | CompareMaskEffectNode | FilterEffectNode | ColorSelectionEffectNode | AnchorPointEffectNode] | List[LayerNode]) substance_painter.layerstack.set_selected_nodes
Wählen Sie die angegebenen Ebenenstapel in der Knoten-Benutzeroberfläche aus.
Pararmaknoten: auszuwählende Knoten.
Löst Folgendes aus:
- ValueError - Wenn die Knoten nicht zum aktuell ausgewählten Textursatz gehören.
- RuntimeError - Wird aus einem
ScopedModification-Abschnitt aufgerufen
Parameter: Knoten (Liste**[GeneratorEffectNode | PaintEffectNode | FillEffectNode | LevelsEffectNode || 1} CompareMaskEffectNode | FilterEffectNode | ColorSelectionEffectNode | *AnchorPointEffectNode *] | }List*[*LayerNode *]*)
substance_painter.layerstack.set_selection_type(layer: LayerNode, layer_selection_type: SelectionType) substance_painter.layerstack.set_selection_type
Wählen Sie den Teil der Ebene aus, den Sie auswählen möchten.
Parameter:
- layer (LayerNode) - auszuwählende Ebene.
- Layer_selection_type (SelectionType): Teil der Ebene, die Sie auswählen möchten (Inhalt, Maske usw.).
Löst Folgendes aus:
- ValueError - Wenn die Ebene nicht zum aktuell ausgewählten Textursatz gehört.
- RuntimeError - Wird aus einem
ScopedModification-Abschnitt aufgerufen
Enumerationen
class substance_painter.layerstack.SelectionType(value) substance_painter.layerstack.SelectionType
Mitglieder:
ContentMaskGeometryMaskProperties