等級效應
LevelsEffectNode 是一種用來調整影像色彩範圍的效果。 它能平衡和調色顏色和/或灰階的明暗。
TIP
另見:等級影響文件。
範例
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)
# Insert Fill Layer
my_fill_layer = sp.layerstack.insert_fill(position_stack_top)
my_fill_layer.set_name("My Fill Layer")
# Load noise into Metallic channel
noise_resource = sp.resource.search("s:starterassets "
"u:procedural "
"n:3D Perlin Noise")[0]
my_fill_layer.set_source(sp.layerstack.ChannelType.Metallic, noise_resource.identifier())
# Add a Levels effect in the content stack
inside_content = sp.layerstack.InsertPosition.inside_node(
my_fill_layer, sp.layerstack.NodeStack.Content)
my_levels_effect = sp.layerstack.insert_levels_effect(inside_content)
# Update the affected channel to Metallic
my_levels_effect.affected_channel = sp.layerstack.ChannelType.Metallic
# Update the Levels effect parameters
parameters = my_levels_effect.get_parameters()
# Note: `parameters` is a LevelsParamsMono because Metallic channel has only a luminance channel
parameters.input_min = 0.25
parameters.input_max = 0.75
my_levels_effect.set_parameters(parameters)
# Select the Levels effect
sp.layerstack.set_selected_nodes([my_levels_effect])
函數與類別
substance_painter.layerstack.insert_levels_effect(position: InsertPosition) -> LevelsEffectNode substance_painter.layerstack.insert_levels_effect
插入一個帶有預設參數的音量效果。
參數:
位置(插入位置🔗)– 插入位置必須位於LayerNode帶有 NodeStack.Content 的 或 NodeStack.Mask 的 內,或高於/低於 的 EffectNode。
加薪:
ValueError – 若插入因位置無效而失敗。 參見 InsertPosition。
回傳: 插入的節點。
回傳類型:LevelsEffectNode
class substance_painter.layerstack.LevelsEffectNode(uid) substance_painter.layerstack.LevelsEffectNode
基地: Node
一個可以操控等級效果的節點。
TIP
另見:水準效應文件
屬性affected_channel:ChannelType substance_painter.layerstack.LevelsEffectNode.affected_channel
受電流電平效應影響的通道。
Getter: 回傳受影響的頻道。
設定者: 設定受影響的頻道。
類型:ChannelType
get_parameters() -> LevelsParamsMono |LevelsParamsRGB substance_painter.layerstack.LevelsEffectNode.get_parameters
取得這個等級效應的最新參數。
回報: 當前的水準參數。
回傳類型:LevelsParamsMono | LevelsParamsRGB
set_parameters(參數:LevelsParamsMono |LevelsParamsRGB)-> 無 substance_painter.layerstack.LevelsEffectNode.set_parameters
為這個等級效果設定新的參數。
參數:參數(LevelsParamsMono 🔗 |** LevelsParamsRGB *)– 新的參數。***
返回類型: 無
參數
class substance_painter.levels.levelsParamsRGB(input_min: 元組[浮點、浮點、浮點] = (0.0, 0.0, 0.0), input_max: 元組[浮點、浮點、浮點] = (1.0, 1.0, 1.0), gamma: 元組[浮點數點數、浮點點數、浮點] 數 = (1.0, 1.0, 1.0), output_min: 元組[浮點數點數 浮點點數] 浮點點數 = (0.0, 0.0, 0.0), output_max: 元組[浮點點數點數(float float 浮點點數)、浮點點數(float float 浮點數)、浮點] 點數 浮點數(float float 浮點數 substance_painter.levels.LevelsParamsRGB
A 級參數,在 RGB 色彩模式下。
參數:
- input_min (元組 [ float**, float*,* float*])– 最小輸入閾值。
- input_max (元組 [ float**, float*,* float*])– 最大輸入閾值。
- 伽瑪(元組 [ 浮點 , 浮點,浮*點])– 伽瑪。
- output_min (元組 [ float**, float*,* float*])– 最小輸出閾值。
- output_max (元組 [ float**, float*,* float*])– 最大輸出閾值。
- **夾(**布爾)– 值是否應該被夾持。
class substance_painter.levels.LevelsParamsMono(input_min: float = 0.0, input_max: float = 1.0, gamma: float = 1.0, output_min: float = 0.0, output_max: float = 1.0, clamp: bool = False) substance_painter.levels.LevelsParamsMono
A級參數,在亮度模式下或僅有一種色彩模式時。
參數:
- input_min (float)– 最小輸入閾值。
- input_max*(float*)– 最大輸入閾值。
- Gamma (花車)– Gamma。
- output_min*(float*)– 最小輸出閾值。
- output_max*(float*)– 最大輸出閾值。
- **夾(**布爾)– 值是否應該被夾持。
substance_painter.levels.levelsParams substance_painter.levels.LevelsParams
| 的別名LevelsParamsMono LevelsParamsRGB
電平參數可表示為三個聲道(RGB)或僅一個色彩通道(僅一個顏色或亮度)。 LevelsParams 用於重新組合兩種可能的參數。
recommendation-more-help
substance-3d-dev-help-painter-python-guide