レベルエフェクト

LevelsEffectNodeは、画像のカラー範囲を調整するために使用される効果です。 これにより、カラーやグレースケール値のバランスと階調を調整できます。

例

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

初期設定のパラメーターを使用して、レベルエフェクトを挿入します。

パラメーター:

位置 (InsertPosition) – インサート位置は、LayerNodeのNodeStack.ContentまたはNodeStack.Maskの内側、またはEffectNodeの上/下である必要があります。

Rails:

ValueError – 無効な位置が原因で挿入に失敗した場合。 InsertPositionを参照してください。

挿入されたノードを​返します。

戻り値の型: LevelsEffectNode

substance_painter.layerstack.LevelsEffectNode(uid)クラス substance_painter.layerstack.LevelsEffectNode

ベース: Node

レベルエフェクトを操作できるノードです。

property affected_channel: ChannelType substance_painter.layerstack.LevelsEffectNode.affected_channel

現在のレベルエフェクトの影響を受けるチャンネル。

取得メソッド:​影響を受けるチャネルを返します。

設定:​影響を受けるチャネルを設定します。

種類: チャネルの種類

get_parameters() -> LevelsParamsMono | LevelsParamsRGB substance_painter.layerstack.LevelsEffectNode.get_parameters

このレベルエフェクトの現在のパラメーターを取得します。

戻り値:​現在のレベルパラメーター。

戻り値の型: LevelsParamsMono | LevelsParamsRGB

set_parameters(params: LevelsParamsMono | LevelsParamsRGB) -> None substance_painter.layerstack.LevelsEffectNode.set_parameters

このレベルエフェクトに新しいパラメーターを設定します。

パラメーター: params (LevelsParamsMono | LevelsParamsRGB) – 新しいパラメーター。

戻り値の型:​なし

Params

class substance_painter.levels.LevelsParamsRGB(input_min: Tuple[float, float, float] = (0.0, 0.0, 0.0), input_max: Tuple[float, float, float] = (1.0, 1.0, 1.0), gamma: Tuple[float, float, float] = (1.0, 1.0), output_min: Tuple[float, float, float] = (0.0, 0), output_maxfloat,float,float = (1.0, 1.0, 1.0), clamp: bool = False) substance_painter.levels.LevelsParamsRGB

レベル補正パラメーター(RGBカラーモードの場合)。

パラメーター:

  • input_min (Tuple​ [ ​float​**, float*,* float*]*) – 入力の最小しきい値。
  • input_max (Tuple​ [ ​float​**, float*,* float*]*) – 最大入力しきい値。
  • ガンマ (タプル​ [ ​浮動小数点​**, 浮動小数点*,* 浮動小数点*]*) – ガンマ
  • output_min (Tuple​ [ ​float​**, float*,* float*]*) – 出力の最小しきい値。
  • output_max (タプル​ [ ​浮動小数点​**, 浮動小数点*,* 浮動小数点*]*) – 最大出力しきい値。
  • clamp (bool) – 値をクランプするかどうかを指定します。

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

輝度または1つのカラーモードのみの場合に、レベルパラメーターです。

パラメーター:

  • input_min (float) – 最小入力しきい値。
  • input_max (float) – 最大入力しきい値。
  • ガンマ (浮動小数点) – ガンマ
  • output_min (float) – 出力の最小しきい値。
  • output_max (float) – 最大出力しきい値。
  • clamp (bool) – 値をクランプするかどうかを指定します。

substance_painter.levels.LevelsParams substance_painter.levels.LevelsParams

LevelsParamsMonoのエイリアス | LevelsParamsRGB

レベルパラメーターは、3つのチャンネル(RGB)または1つのカラーチャンネル(1つのカラーまたは輝度)に対して表現できます。 LevelsParamsは、2つの可能なパラメータフレーバーを再グループ化するために使用されます。

recommendation-more-help
substance-3d-dev-help-painter-python-guide