顏料層與效果

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_paint(position: InsertPosition) -> PaintLayerNode |PaintEffectNode substance_painter.layerstack.insert_paint

插入一個 Paint 效果或圖層(視插入位置而定)。

參數:​位置(InsertPosition)– 插入位置。

加薪:

ValueError – 若插入因位置無效而失敗。 參見 InsertPosition。

回傳: 插入的節點。

回傳類型:​PaintLayerNode | PaintEffectNode

class substance_painter.layerstack.PaintLayerNode(uid) substance_painter.layerstack.PaintLayerNode

基地: LayerNode

一個允許操作 Paint 圖層的節點。

NOTE
筆劃無法從 Python API 存取。

class substance_painter.layerstack.PaintEffectNode(uid) substance_painter.layerstack.PaintEffectNode

基地: Node

一個允許操作繪畫效果的節點。

NOTE
筆劃無法從 Python API 存取。
recommendation-more-help
substance-3d-dev-help-painter-python-guide