Calque de peinture et effet

PaintLayerNode et PaintEffectNode sont des types de nœuds sur lesquels vous pouvez peindre avec des pinceaux et des particules.

Exemples

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)

# It is also possible to create a Paint Effect with InsertPosition.inside_node()
# sp.layerstack.InsertPosition.inside_node(node, sp.layerstack.NodeStack.Content)
# sp.layerstack.InsertPosition.inside_node(node, sp.layerstack.NodeStack.Mask)

# Insert Paint Layer
my_paint_layer = sp.layerstack.insert_paint(position_stack_top)
my_paint_layer.set_name("My Paint Layer")

# Choose the passthrough Blending Mode
blending_mode = sp.layerstack.BlendingMode.Passthrough
# Check if node has a Blending feature (e.g.: Levels Effect does not)
if my_paint_layer.has_blending():
    # Apply the Blending Mode to the BaseColor Channel
    my_paint_layer.set_blending_mode(blending_mode, sp.textureset.ChannelType.BaseColor)

# Select the Paint layer
sp.layerstack.set_selected_nodes([my_paint_layer])

Fonctions et classes

substance_painter.layerstack.insert_peinture(position : InsertPosition) -> PaintLayerNode | PaintEffectNode substance_painter.layerstack.insert_paint

Insérez un effet ou un calque de Peinture (selon la position d’insertion).

Paramètres : position (InsertPosition) - Insérer la position.

Élévations :

ValueError : si l’insertion a échoué en raison d’une position non valide. Voir InsertPosition.

Renvoie : le nœud inséré.

Type de retour : PaintLayerNode | PaintEffectNode

classe substance_painter.layerstack.PaintLayerNode(uid) substance_painter.layerstack.PaintLayerNode

Bases : LayerNode

Nœud permettant la manipulation d’un Calque de peinture.

NOTE
Les contours ne sont pas accessibles depuis l’API Python.

classe substance_painter.layerstack.PaintEffectNode(uid) substance_painter.layerstack.PaintEffectNode

Bases : Node

Nœud permettant la manipulation d’un effet de Peinture.

NOTE
Les contours ne sont pas accessibles depuis l’API Python.
recommendation-more-help
substance-3d-dev-help-painter-python-guide