绘画图层和效果

PaintLayerNode和PaintEffectNode是可以用画笔和粒子绘制的节点类型。

示例

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

函数和类

substance_painter.layerstack.insert_node(position: InsertPosition) -> PaintLayerNode绘画 | PaintEffectNode substance_painter.layerstack.insert_paint

插入绘画效果或图层(取决于插入位置)。

参数: 位置 (InsertPosition) — 插入位置。

引发:

ValueError — 如果由于位置无效而导致插入失败。 请参阅InsertPosition。

返回:​插入的节点。

返回类型: PaintLayerNode | PaintEffectNode

类substance_painter.layerstack.PaintLayerNode(uid) substance_painter.layerstack.PaintLayerNode

基数: LayerNode

允许操作绘画图层的节点。

NOTE
无法从Python API访问笔触。

类substance_painter.layerstack.PaintEffectNode(uid) substance_painter.layerstack.PaintEffectNode

基数: Node

允许操作绘画效果的节点。

NOTE
无法从Python API访问笔触。
recommendation-more-help
substance-3d-dev-help-painter-python-guide