Efecto Niveles
LevelsEffectNode es un efecto utilizado para ajustar los rangos de color de una imagen. Permite equilibrar y tonificar colores y/o valores de escala de grises.
Ejemplos
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])
Funciones y clases
substance_painter.layerstack.insert_levels_effect(position: InsertPosition) -> LevelsEffectNode substance_painter.layerstack.insert_levels_effect
Inserte un efecto de niveles con los parámetros predeterminados.
Parámetros:
position (InsertPosition): la posición de inserción debe estar dentro de un objeto LayerNode con NodeStack.Content o NodeStack.Mask o por encima/por debajo de un objeto EffectNode.
Aumentos:
ValueError: si se produjo un error en la inserción debido a una posición no válida. Consulte InsertPosition.
Devuelve: El nodo insertado.
Tipo de valor devuelto: LevelsEffectNode
class substance_painter.layer.LevelsEffectNode(uid) substance_painter.layerstack.LevelsEffectNode
Bases: Node
Nodo que permite manipular un efecto de niveles.
property applied_channel: ChannelType substance_painter.layerstack.LevelsEffectNode.affected_channel
Canal afectado por el efecto de nivel actual.
Obtener: Devuelve el canal afectado.
Setter: Establece el canal afectado.
Tipo: ChannelType
get_parameters() -> LevelsParamsMono | LevelsParamsRGB substance_painter.layerstack.LevelsEffectNode.get_parameters
Obtenga los parámetros actuales de este efecto de niveles.
Devuelve: Los parámetros de nivel actuales.
Tipo de valor devuelto: LevelsParamsMono | LevelsParamsRGB
set_parameters(parámetros: LevelsParamsMono | LevelsParamsRGB) -> Ninguno substance_painter.layerstack.LevelsEffectNode.set_parameters
Defina nuevos parámetros para este efecto de niveles.
Parámetros: parámetros (LevelsParamsMono | LevelsParamsRGB): los nuevos parámetros.
Tipo de valor devuelto: Ninguno
Parámetros
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, 1.0), output_min: Tuple[float, float, float] = (0.0, 0.0, 0.0), output_max: Tuple[float, float, float] = (1.0, 1.0, 1.0), abrazadera: bool = False) substance_painter.levels.LevelsParamsRGB
Parámetros de niveles, en el modo de color RGB.
Parámetros:
- input_min (Tuple [ float**, float*,* float*]*): el umbral mínimo de entrada.
- input_max (Tuple [ float**, float*,* float*]*): el umbral máximo de entrada.
- gamma (Tuple [ float**, float*,* float*]*) - Gamma.
- output_min (Tuple [ float**, float*,* float*]*): el umbral mínimo de salida.
- output_max (Tuple [ float**, float*,* float*]*): el umbral máximo de salida.
- clamp (bool): Especifica si los valores deben fijarse o no.
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, abrazadera: bool = False) substance_painter.levels.LevelsParamsMono
Parámetros de niveles, en Luminancia o en un solo modo de color.
Parámetros:
- input_min (float): el umbral mínimo de entrada.
- input_max (float): umbral máximo de entrada.
- gamma (float) - Gamma.
- output_min (float): el umbral mínimo de salida.
- output_max (float): el umbral de salida máximo.
- clamp (bool): Especifica si los valores deben fijarse o no.
substance_painter.levels.LevelsParams substance_painter.levels.LevelsParams
alias de LevelsParamsMono | LevelsParamsRGB
Los parámetros de niveles se pueden expresar para tres canales (RGB) o solo un canal de color (solo un color o una luminancia). LevelsParams se utiliza para reagrupar los dos posibles parámetros de los sabores.