Fill layer and effect

FillLayerNode and FillEffectNode are types of nodes that cannot be painted on, instead a material can be loaded into it or resources can be loaded into channels individually.

Examples

Apply grunge in a fill effect

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 Fill 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 Fill Layer
my_fill_layer = sp.layerstack.insert_fill(position_stack_top)
my_fill_layer.set_name("My Fill Layer")

# The Fill layer is created with the SourceMode 'Split'
# Check if the BaseColor channel is available
if sp.layerstack.ChannelType.BaseColor in my_fill_layer.get_stack().all_channels().keys():
    # Change BaseColor color
    my_fill_layer.set_source(
        sp.layerstack.ChannelType.BaseColor, sp.colormanagement.Color(0.0, 0.3, 0.2))

# Check if the Roughness channel is available
if sp.layerstack.ChannelType.Roughness in my_fill_layer.get_stack().all_channels().keys():
    # Load noise into roughness
    noise_resource = sp.resource.search("s:starterassets "
                                        "u:procedural "
                                        "n:3D Perlin Noise Fractal")[0]
    my_fill_layer.set_source(sp.layerstack.ChannelType.Roughness, noise_resource.identifier())

# Add a Fill effect in the content stack
inside_content = sp.layerstack.InsertPosition.inside_node(
    my_fill_layer, sp.layerstack.NodeStack.Content)
my_fill_effect = sp.layerstack.insert_fill(inside_content)

# Note: Fill layers and Fill effects in the content stack are multi-channels
# and get/set_material_source() functions require to be in multi-channel mode
# To check the mode, use `source_mode` attribute
#   - SourceMode.Material or SourceMode.Split are multi-channels
#   - None is mono-channel (ex: a fill in the mask stack)
if my_fill_effect.source_mode is not None:
    # Apply material in material mode
    aluminium_material = sp.resource.search("s:starterassets "
                                            "u:substance "
                                            "n:metal")[0]
    my_fill_effect.set_material_source(aluminium_material.identifier())
    # SourceMode is automatically updated to 'Material'

# Add a mask and a fill effect in the mask stack
my_fill_layer.add_mask(sp.layerstack.MaskBackground.Black)
inside_mask = sp.layerstack.InsertPosition.inside_node(
    my_fill_layer, sp.layerstack.NodeStack.Mask)
my_fill_effect_mask = sp.layerstack.insert_fill(inside_mask)

# Note: all Fill effects in the mask stack are mono-channel
# get/set_material_source() functions are not allowed

# Apply grunge in the fill effect
grunge = sp.resource.search("s:starterassets "
                            "u:procedural "
                            "n:Grunge Rust Fine")[0]
# There is no channel to specify in the mask stack, use 'None' instead
my_fill_effect_mask.set_source(None, grunge.identifier())

# Change projection to triplanar
my_fill_layer.set_projection_mode(sp.layerstack.ProjectionMode.Triplanar)

# Adjust scale of the projection
projection_params = my_fill_layer.get_projection_parameters()
projection_params.projection_3d.scale = [0.5, 0.5, 0.5]
my_fill_layer.set_projection_parameters(projection_params)

# Select the Fill layer
sp.layerstack.set_selected_nodes([my_fill_layer])

Functions and classes

substance_painter.layerstack.insert_fill(position: InsertPosition) -> FillLayerNode | FillEffectNode substance_painter.layerstack.insert_fill

Insert a Fill effect or layer (depending on the insert position).

Parameters: position (InsertPosition) – Insert position.

Raises:

ValueError – If insertion failed due to an invalid position.
See InsertPosition.

Returns: The inserted node.

Return type: FillLayerNode | FillEffectNode

class substance_painter.layerstack.FillLayerNode(uid) substance_painter.layerstack.FillLayerNode

Bases: FillParamsEditorMixin, SourceEditorMixin, LayerNode

A node allowing manipulation of a Fill layer.

property active_channels: Set[ChannelType] substance_painter.layerstack.FillLayerNode.active_channels

The set of active channels of the source.

Getter:

Returns the active channels of the source. To get the list of channels
for a given stack, see substance_painter.textureset.Stack.all_channels().

Setter:

Sets the active channels of the source, channels not listed will be
disabled.

get_material_source() -> SourceSubstance | SourceReference substance_painter.layerstack.FillLayerNode.get_material_source

Get the source in material mode.

Raises:

  • RuntimeError – If the source is not in SourceMode.Material.
    See source_mode.
  • EditionContextException – If the current context in not multi-channel.

Returns: the source.

Return type: SourceSubstance | SourceReference

get_projection_mode() -> ProjectionMode substance_painter.layerstack.FillLayerNode.get_projection_mode

Get the current projection mode.

Returns: The current projection mode.

Return type: ProjectionMode

get_projection_parameters() -> UVProjectionParams | TriplanarProjectionParams | PlanarProjectionParams | WarpProjectionParams | SphericalProjectionParams | CylindricalProjectionParams | UVSetToUVSetProjectionParams | None substance_painter.layerstack.FillLayerNode.get_projection_parameters

Get the current projection parameters.
Each kind of Projection Mode returns a specific kind of ProjectionParams, supporting a
different set of features.
Fill mode support no parameters, and returns None.

Returns: The current projection parameters, or None for Fill.

Return type: UVProjectionParams | TriplanarProjectionParams | PlanarProjectionParams | WarpProjectionParams | SphericalProjectionParams | CylindricalProjectionParams | UVSetToUVSetProjectionParams | None

get_source(channeltype: ChannelType | None = None) -> SourceUniformColor | SourceBitmap | SourceVectorial | SourceSubstance | SourceReference | SourceFont substance_painter.layerstack.FillLayerNode.get_source

Get the source for the given channel type.

Parameters: channeltype (ChannelType | None) – Must be None in mono channel context.

Raises:

  • EditionContextException – If the channeltype is not valid in the current context.
    See active_channels.
  • RuntimeError – If the source is in SourceMode.Material.
    See source_mode.

Returns: the source at channel type.

Return type: SourceUniformColor | SourceBitmap | SourceVectorial | SourceSubstance | SourceReference | SourceFont

get_symmetry_parameters() -> MirrorSymmetryParams | RadialSymmetryParams substance_painter.layerstack.FillLayerNode.get_symmetry_parameters

Get the current symmetry parameters.
Each kind of symmetry mode returns a specific kind of SymmetryParams, supporting a
different set of features.
Symmetry is only available for 3D projection modes. See
substance_painter.layerstack.is_3d_projection_mode().

Raises: ValueError – If the symmetry is not supported in the current context.

Returns: The current symmetry parameters.

Return type: MirrorSymmetryParams | RadialSymmetryParams

is_symmetry_enabled() -> bool substance_painter.layerstack.FillLayerNode.is_symmetry_enabled

Check if symmetry is enabled.
Symmetry is only available for 3D projection modes. See
substance_painter.layerstack.is_3d_projection_mode().

Raises: ValueError – If the symmetry is not supported in the current context.

Returns: True if symmetry is enabled, False otherwise.

Return type: bool

reset_material_source() -> None substance_painter.layerstack.FillLayerNode.reset_material_source

Reset the source in material mode.

Raises: EditionContextException – If the current context in not multi-channel.

Return type: None

reset_source(channeltype: ChannelType | None = None) -> None substance_painter.layerstack.FillLayerNode.reset_source

Reset the source at channel type.

Parameters: channeltype (ChannelType | None) – Must be None in mono channel context.

Raises:

EditionContextException – If the channeltype is not valid in the current context.
See active_channels.

Return type: None

set_material_source(source: ResourceID | AnchorPointEffectNode) -> SourceSubstance | SourceReference substance_painter.layerstack.FillLayerNode.set_material_source

Set the source in material mode.

Parameters: source (ResourceID | AnchorPointEffectNode) – the source parameter.

Raises:

  • ValueError – If the source parameter is not valid.
  • EditionContextException – If the current context in not multi-channel.

Returns: the source.

Return type: SourceSubstance | SourceReference

set_projection_mode(projection_mode: ProjectionMode) substance_painter.layerstack.FillLayerNode.set_projection_mode

Switch to a new projection mode.

Parameters: projection_mode (ProjectionMode) – The new projection mode.

Raises: ValueError – If the projection mode is not supported in the current context.

set_projection_parameters(projection_parameters: UVProjectionParams | TriplanarProjectionParams | PlanarProjectionParams | WarpProjectionParams | SphericalProjectionParams | CylindricalProjectionParams | UVSetToUVSetProjectionParams) substance_painter.layerstack.FillLayerNode.set_projection_parameters

Set projection parameters and update the current projection mode accordingly.

Parameters: projection_parameters (UVProjectionParams | TriplanarProjectionParams | PlanarProjectionParams | WarpProjectionParams | SphericalProjectionParams | CylindricalProjectionParams | UVSetToUVSetProjectionParams) – The new parameters to apply.

Raises: ValueError – If the projection parameters are not supported in the current context.

set_source(channeltype: ChannelType | None, source: ResourceID | Color | AnchorPointEffectNode) -> SourceUniformColor | SourceBitmap | SourceVectorial | SourceSubstance | SourceReference | SourceFont substance_painter.layerstack.FillLayerNode.set_source

Set the source for the given channel type.

Parameters:

Raises:

  • EditionContextException – If the channeltype is not valid in the current context.
    See active_channels.
  • ValueError – If the source parameter is not valid.

Returns: the source at channel type.

Return type: SourceUniformColor | SourceBitmap | SourceVectorial | SourceSubstance | SourceReference | SourceFont

set_sources_from_preset(preset: ResourceID) -> None substance_painter.layerstack.FillLayerNode.set_sources_from_preset

Setup the fill with the given preset.

Parameters: preset (ResourceID) – the resource preset.

Raises: ValueError – If preset is not a valid resource preset.

Return type: None

set_symmetry_enabled(enabled: bool) substance_painter.layerstack.FillLayerNode.set_symmetry_enabled

Set the symmetry enabled state.
Symmetry is only available for 3D projection modes. See
substance_painter.layerstack.is_3d_projection_mode().

Parameters: enabled (bool) – True to enable symmetry, False to disable it.

Raises: ValueError – If the symmetry is not supported in the current context.

set_symmetry_parameters(symmetry_parameters: MirrorSymmetryParams | RadialSymmetryParams) substance_painter.layerstack.FillLayerNode.set_symmetry_parameters

Set the symmetry parameters and update the current symmetry mode accordingly.
This does not enable symmetry. Explicitely use set_symmetry_enabled() to enable it.
Symmetry is only available for 3D projection modes. See
substance_painter.layerstack.is_3d_projection_mode().

Example to set and enable radial symmetry:

symmetry_parameters = sp.layerstack.RadialSymmetryParams()
symmetry_parameters.axis = sp.layerstack.SymmetryAxis.X
symmetry_parameters.flip_u = False
symmetry_parameters.flip_v = True
symmetry_parameters.axis_position = [0, 0.1, -0.1]
symmetry_parameters.angle_span = 70
symmetry_parameters.count = 10
my_layer.set_symmetry_parameters(symmetry_parameters)
my_layer.set_symmetry_enabled(True)

Parameters: symmetry_parameters (MirrorSymmetryParams | RadialSymmetryParams) – The new parameters to apply.

Raises: ValueError – If the symmetry is not supported in the current context.

property source_mode: SourceMode substance_painter.layerstack.FillLayerNode.source_mode

The current context in which the source is edited:

For more details, see Apply grunge in a fill effect.

Getter: Returns the source mode.

class substance_painter.layerstack.FillEffectNode(uid) substance_painter.layerstack.FillEffectNode

Bases: FillParamsEditorMixin, SourceEditorMixin, Node

A node allowing manipulation of a Fill effect.

property active_channels: Set[ChannelType] substance_painter.layerstack.FillEffectNode.active_channels

The set of active channels of the source.

Getter:

Returns the active channels of the source. To get the list of channels
for a given stack, see substance_painter.textureset.Stack.all_channels().

Setter:

Sets the active channels of the source, channels not listed will be
disabled.

get_material_source() -> SourceSubstance | SourceReference substance_painter.layerstack.FillEffectNode.get_material_source

Get the source in material mode.

Raises:

  • RuntimeError – If the source is not in SourceMode.Material.
    See source_mode.
  • EditionContextException – If the current context in not multi-channel.

Returns: the source.

Return type: SourceSubstance | SourceReference

get_projection_mode() -> ProjectionMode substance_painter.layerstack.FillEffectNode.get_projection_mode

Get the current projection mode.

Returns: The current projection mode.

Return type: ProjectionMode

get_projection_parameters() -> UVProjectionParams | TriplanarProjectionParams | PlanarProjectionParams | WarpProjectionParams | SphericalProjectionParams | CylindricalProjectionParams | UVSetToUVSetProjectionParams | None substance_painter.layerstack.FillEffectNode.get_projection_parameters

Get the current projection parameters.
Each kind of Projection Mode returns a specific kind of ProjectionParams, supporting a
different set of features.
Fill mode support no parameters, and returns None.

Returns: The current projection parameters, or None for Fill.

Return type: UVProjectionParams | TriplanarProjectionParams | PlanarProjectionParams | WarpProjectionParams | SphericalProjectionParams | CylindricalProjectionParams | UVSetToUVSetProjectionParams | None

get_source(channeltype: ChannelType | None = None) -> SourceUniformColor | SourceBitmap | SourceVectorial | SourceSubstance | SourceReference | SourceFont substance_painter.layerstack.FillEffectNode.get_source

Get the source for the given channel type.

Parameters: channeltype (ChannelType | None) – Must be None in mono channel context.

Raises:

  • EditionContextException – If the channeltype is not valid in the current context.
    See active_channels.
  • RuntimeError – If the source is in SourceMode.Material.
    See source_mode.

Returns: the source at channel type.

Return type: SourceUniformColor | SourceBitmap | SourceVectorial | SourceSubstance | SourceReference | SourceFont

get_symmetry_parameters() -> MirrorSymmetryParams | RadialSymmetryParams substance_painter.layerstack.FillEffectNode.get_symmetry_parameters

Get the current symmetry parameters.
Each kind of symmetry mode returns a specific kind of SymmetryParams, supporting a
different set of features.
Symmetry is only available for 3D projection modes. See
substance_painter.layerstack.is_3d_projection_mode().

Raises: ValueError – If the symmetry is not supported in the current context.

Returns: The current symmetry parameters.

Return type: MirrorSymmetryParams | RadialSymmetryParams

is_symmetry_enabled() -> bool substance_painter.layerstack.FillEffectNode.is_symmetry_enabled

Check if symmetry is enabled.
Symmetry is only available for 3D projection modes. See
substance_painter.layerstack.is_3d_projection_mode().

Raises: ValueError – If the symmetry is not supported in the current context.

Returns: True if symmetry is enabled, False otherwise.

Return type: bool

reset_material_source() -> None substance_painter.layerstack.FillEffectNode.reset_material_source

Reset the source in material mode.

Raises: EditionContextException – If the current context in not multi-channel.

Return type: None

reset_source(channeltype: ChannelType | None = None) -> None substance_painter.layerstack.FillEffectNode.reset_source

Reset the source at channel type.

Parameters: channeltype (ChannelType | None) – Must be None in mono channel context.

Raises:

EditionContextException – If the channeltype is not valid in the current context.
See active_channels.

Return type: None

set_material_source(source: ResourceID | AnchorPointEffectNode) -> SourceSubstance | SourceReference substance_painter.layerstack.FillEffectNode.set_material_source

Set the source in material mode.

Parameters: source (ResourceID | AnchorPointEffectNode) – the source parameter.

Raises:

  • ValueError – If the source parameter is not valid.
  • EditionContextException – If the current context in not multi-channel.

Returns: the source.

Return type: SourceSubstance | SourceReference

set_projection_mode(projection_mode: ProjectionMode) substance_painter.layerstack.FillEffectNode.set_projection_mode

Switch to a new projection mode.

Parameters: projection_mode (ProjectionMode) – The new projection mode.

Raises: ValueError – If the projection mode is not supported in the current context.

set_projection_parameters(projection_parameters: UVProjectionParams | TriplanarProjectionParams | PlanarProjectionParams | WarpProjectionParams | SphericalProjectionParams | CylindricalProjectionParams | UVSetToUVSetProjectionParams) substance_painter.layerstack.FillEffectNode.set_projection_parameters

Set projection parameters and update the current projection mode accordingly.

Parameters: projection_parameters (UVProjectionParams | TriplanarProjectionParams | PlanarProjectionParams | WarpProjectionParams | SphericalProjectionParams | CylindricalProjectionParams | UVSetToUVSetProjectionParams) – The new parameters to apply.

Raises: ValueError – If the projection parameters are not supported in the current context.

set_source(channeltype: ChannelType | None, source: ResourceID | Color | AnchorPointEffectNode) -> SourceUniformColor | SourceBitmap | SourceVectorial | SourceSubstance | SourceReference | SourceFont substance_painter.layerstack.FillEffectNode.set_source

Set the source for the given channel type.

Parameters:

Raises:

  • EditionContextException – If the channeltype is not valid in the current context.
    See active_channels.
  • ValueError – If the source parameter is not valid.

Returns: the source at channel type.

Return type: SourceUniformColor | SourceBitmap | SourceVectorial | SourceSubstance | SourceReference | SourceFont

set_sources_from_preset(preset: ResourceID) -> None substance_painter.layerstack.FillEffectNode.set_sources_from_preset

Setup the fill with the given preset.

Parameters: preset (ResourceID) – the resource preset.

Raises: ValueError – If preset is not a valid resource preset.

Return type: None

set_symmetry_enabled(enabled: bool) substance_painter.layerstack.FillEffectNode.set_symmetry_enabled

Set the symmetry enabled state.
Symmetry is only available for 3D projection modes. See
substance_painter.layerstack.is_3d_projection_mode().

Parameters: enabled (bool) – True to enable symmetry, False to disable it.

Raises: ValueError – If the symmetry is not supported in the current context.

set_symmetry_parameters(symmetry_parameters: MirrorSymmetryParams | RadialSymmetryParams) substance_painter.layerstack.FillEffectNode.set_symmetry_parameters

Set the symmetry parameters and update the current symmetry mode accordingly.
This does not enable symmetry. Explicitely use set_symmetry_enabled() to enable it.
Symmetry is only available for 3D projection modes. See
substance_painter.layerstack.is_3d_projection_mode().

Example to set and enable radial symmetry:

symmetry_parameters = sp.layerstack.RadialSymmetryParams()
symmetry_parameters.axis = sp.layerstack.SymmetryAxis.X
symmetry_parameters.flip_u = False
symmetry_parameters.flip_v = True
symmetry_parameters.axis_position = [0, 0.1, -0.1]
symmetry_parameters.angle_span = 70
symmetry_parameters.count = 10
my_layer.set_symmetry_parameters(symmetry_parameters)
my_layer.set_symmetry_enabled(True)

Parameters: symmetry_parameters (MirrorSymmetryParams | RadialSymmetryParams) – The new parameters to apply.

Raises: ValueError – If the symmetry is not supported in the current context.

property source_mode: SourceMode substance_painter.layerstack.FillEffectNode.source_mode

The current context in which the source is edited:

For more details, see Apply grunge in a fill effect.

Getter: Returns the source mode.

substance_painter.layerstack.is_3d_projection_mode(projection_mode: ProjectionMode) -> bool substance_painter.layerstack.is_3d_projection_mode

Check if the projection mode is a 3D projection.

Parameters: projection_mode (ProjectionMode) – Projection mode to check.

Returns: True if the current projection mode is a 3D projection.

Return type: bool

Params

class substance_painter.layerstack.UVProjectionParams(filtering_mode: ~substance_painter.layerstack.FilteringMode | None = None, uv_wrapping_mode: ~substance_painter.layerstack.UVWrapMode | None = None, uv_transformation: ~substance_painter.layerstack.UVTransformationParams = ) substance_painter.layerstack.UVProjectionParams

Parameters that control the fill behaviour when the projection mode is
ProjectionMode.UV.
For a complete description of the parameters, see
UV Projection documentation.

Parameters:

class substance_painter.layerstack.TriplanarProjectionParams(filtering_mode: ~substance_painter.layerstack.FilteringMode | None = None, shape_crop_mode: ~substance_painter.layerstack.ShapeCropMode | None = None, hardness: float | None = None, uv_transformation: ~substance_painter.layerstack.UVTransformationParams = , projection_3d: ~substance_painter.layerstack.Projection3DParams = ) substance_painter.layerstack.TriplanarProjectionParams

Parameters that control the fill behaviour when the projection mode is
ProjectionMode.Triplanar.
For a complete description of the parameters, see
Triplanar Projection documentation.

Parameters:

class substance_painter.layerstack.PlanarProjectionParams(filtering_mode: ~substance_painter.layerstack.FilteringMode | None = None, uv_wrapping_mode: ~substance_painter.layerstack.UVWrapMode | None = None, shape_crop_mode: ~substance_painter.layerstack.ShapeCropMode | None = None, depth_culling: ~substance_painter.layerstack.ProjectionCullingParams = , backface_culling: ~substance_painter.layerstack.ProjectionCullingParams = , backface_culling_angle: float | None = None, uv_transformation: ~substance_painter.layerstack.UVTransformationParams = , projection_3d: ~substance_painter.layerstack.Projection3DParams = ) substance_painter.layerstack.PlanarProjectionParams

Parameters that control the fill behaviour when the projection mode is
ProjectionMode.Planar.
For a complete description of the parameters, see
Planar Projection documentation.

Parameters:

class substance_painter.layerstack.SphericalProjectionParams(filtering_mode: ~substance_painter.layerstack.FilteringMode | None = None, uv_wrapping_mode: ~substance_painter.layerstack.UVWrapMode | None = None, shape_crop_mode: ~substance_painter.layerstack.ShapeCropMode | None = None, uv_transformation: ~substance_painter.layerstack.UVTransformationParams = , projection_3d: ~substance_painter.layerstack.Projection3DParams = ) substance_painter.layerstack.SphericalProjectionParams

Parameters that control the fill behaviour when the projection mode is
ProjectionMode.Spherical.
For a complete description of the parameters, see
Spherical Projection documentation.

Parameters:

class substance_painter.layerstack.CylindricalProjectionParams(filtering_mode: ~substance_painter.layerstack.FilteringMode | None = None, uv_wrapping_mode: ~substance_painter.layerstack.UVWrapMode | None = None, shape_crop_mode: ~substance_painter.layerstack.ShapeCropMode | None = None, angle: float | None = None, backface_culling: ~substance_painter.layerstack.ProjectionCullingParams = , uv_transformation: ~substance_painter.layerstack.UVTransformationParams = , projection_3d: ~substance_painter.layerstack.Projection3DParams = ) substance_painter.layerstack.CylindricalProjectionParams

Parameters that control the fill behaviour when the projection mode is
ProjectionMode.Cylindrical.
For a complete description of the parameters, see
Cylindrical Projection documentation.

Parameters:

class substance_painter.layerstack.WarpProjectionParams(filtering_mode: ~substance_painter.layerstack.FilteringMode | None = None, uv_wrapping_mode: ~substance_painter.layerstack.UVWrapMode | None = None, shape_crop_mode: ~substance_painter.layerstack.ShapeCropMode | None = None, projection_depth: float | None = None, depth_culling: ~substance_painter.layerstack.ProjectionCullingParams = , uv_transformation: ~substance_painter.layerstack.UVTransformationParams = , projection_3d: ~substance_painter.layerstack.Projection3DParams = ) substance_painter.layerstack.WarpProjectionParams

Parameters that control the fill behaviour when the projection mode is
ProjectionMode.Warp.
For a complete description of the parameters, see
Warp Projection documentation.

Parameters:

class substance_painter.layerstack.UVSetToUVSetProjectionParams(source_uv_set: int | None = None, filtering_mode: ~substance_painter.layerstack.FilteringMode | None = None, uv_wrapping_mode: ~substance_painter.layerstack.UVWrapMode | None = None, uv_transformation: ~substance_painter.layerstack.UVTransformationParams = ) substance_painter.layerstack.UVSetToUVSetProjectionParams

Parameters that control the fill behaviour when the projection mode is
ProjectionMode.UVSetToUVSet.
For a complete description of the parameters, see
UVSetToUVSet Projection documentation.

Parameters:

  • source_uv_set (int) – Mesh UV set index used as projection source (0: no effect).
  • filtering_mode (FilteringMode) – How to filter the image.
  • uv_wrapping – UV Wrapping behaviour.
  • uv_transformation (UVTransformationParams) – UV transformation.
  • uv_wrapping_mode (UVWrapMode)

class substance_painter.layerstack.UVTransformationParams(scale_mode: ScaleMode | None = None, scale: List[float] | None = None, rotation: float | None = None, offset: List[float] | None = None) substance_painter.layerstack.UVTransformationParams

UV projection transformation parameters.

Parameters:

class substance_painter.layerstack.Projection3DParams(offset: List[float] | None = None, rotation: List[float] | None = None, scale: List[float] | None = None) substance_painter.layerstack.Projection3DParams

3D projection transformation parameters.

Parameters:

  • offset (List*[float]*) – 3D offset.
  • rotation (List*[float]*) – 3D rotation.
  • scale (List*[float]*) – 3D scale.
    Z scaling is unavalaible when projection mode is
    ProjectionMode.Planar and depth culling is disabled.

class substance_painter.layerstack.ProjectionCullingParams(enabled: bool | None = None, hardness: float | None = None) substance_painter.layerstack.ProjectionCullingParams

Projection culling parameters.
Either a depth culling or a backface culling.

Parameters:

  • enabled (bool) – Whether the culling is enabled or not.
  • hardness (float) – Hardness of the culling, between 0 and 1.

substance_painter.layerstack.ProjectionParams substance_painter.layerstack.ProjectionParams

Each Projection Mode has its own projection parameters.
ProjectionParams is used to regroup them.

class substance_painter.layerstack.MirrorSymmetryParams(axis: SymmetryAxis | None = None, flip_u: bool | None = None, flip_v: bool | None = None, axis_position: List[float] | None = None) substance_painter.layerstack.MirrorSymmetryParams

Parameters that control the mirror symmetry behaviour.

Parameters:

  • axis (SymmetryAxis) – Axis along which to mirror.
  • flip_u (bool) – Whether to flip UVs along the U axis.
  • flip_v (bool) – Whether to flip UVs along the V axis.
  • axis_position (List*[float]*) – Position of the mirror plane along each axis, clamped between [-10, -10,
    -10] and [10, 10, 10].
TIP
See also:
FillLayerNode.get_symmetry_mode()
FillLayerNode.get_symmetry_parameters()

class substance_painter.layerstack.RadialSymmetryParams(axis: SymmetryAxis | None = None, flip_u: bool | None = None, flip_v: bool | None = None, axis_position: List[float] | None = None, count: int | None = None, angle_span: float | None = None) substance_painter.layerstack.RadialSymmetryParams

Parameters that control the radial symmetry behaviour.

When setting symmetry, some parameters will get clamped:

Parameters:

  • axis (SymmetryAxis) – Axis along which to mirror.
  • flip_u (bool) – Whether to flip UVs along the U axis.
  • flip_v (bool) – Whether to flip UVs along the V axis.
  • axis_position (List*[float]*) – Position of the mirror plane along each axis, clamped between [-10, -10,
    -10] and [10, 10, 10].
  • count (int) – Number of copies, clamped between 2 and 16.
  • angle_span (float) – Angle span of the copies, in degrees, clamped between -360 and 360.
TIP
See also:
FillLayerNode.get_symmetry_mode()
FillLayerNode.get_symmetry_parameters()

substance_painter.layerstack.SymmetryParams substance_painter.layerstack.SymmetryParams

Each Symmetry Mode has its own symmetry parameters.
SymmetryParams is used to regroup them.

Enums

class substance_painter.layerstack.ProjectionMode(value) substance_painter.layerstack.ProjectionMode

See Fill projections documentation for a complete
description of all Projection modes.

Symmetry is only available for 3D projection modes. See
substance_painter.layerstack.is_3d_projection_mode().

Members:

Name
Description
Fill
Fill (match per UV Tile) is a special 2D projection useful for UV Tile projects.
UV
2D projection that only works in the 2D texture space.
Triplanar
3D projection that combines multiple planar projections together.
Planar
3D projection that projects an image in a direction as a plane.
Spherical
3D projection that projects images and patterns around an object following a sphere area.
Cylindrical
3D projection that projects images and patterns around an object following a cylinder area.
Warp
3D projection that deforms a texture by editing points of a grid.
UVSetToUVSet
Projection from an additional UV set to the current UV set.
NOTE
The name used to define members is available as a string via the .name attribute (see python enum.Enum).

class substance_painter.layerstack.FilteringMode(value) substance_painter.layerstack.FilteringMode

Members:

Name
Description
BilinearHQ
Advanced bilinear filtering.
BilinearSharp
Simple bilinear filtering.
Nearest
No filtering.
NOTE
The name used to define members is available as a string via the .name attribute (see python enum.Enum).

class substance_painter.layerstack.UVWrapMode(value) substance_painter.layerstack.UVWrapMode

Members:

Name
Description
RepeatNone
No repeat.
RepeatHorizontally
Repeat horizontally.
RepeatVertically
Repeat vertically.
Repeat
Repeat horizontally and vertically.
NOTE
The name used to define members is available as a string via the .name attribute (see python enum.Enum).

class substance_painter.layerstack.ShapeCropMode(value) substance_painter.layerstack.ShapeCropMode

Members:

Name
Description
CroppedToShape
The projection is confined within the projection area.
ExtendsOutsideShape
The projection continues beyond the projection area.
NOTE
The name used to define members is available as a string via the .name attribute (see python enum.Enum).

class substance_painter.layerstack.ScaleMode(value) substance_painter.layerstack.ScaleMode

Members:

Name
Description
Factors
The texture is repeated by a number of times.
MaterialPhysicalSize
Automatic adjustement of the texture according to the mesh size and texture size.
CustomPhysicalSize
Specify a physical size manually and adapt to the mesh size.
NOTE
The name used to define members is available as a string via the .name attribute (see python enum.Enum).

class substance_painter.layerstack.SymmetryMode(value) substance_painter.layerstack.SymmetryMode

Symmetry (Mirror or Radial) is only applied when a 3D projection mode is set on a Fill Layer. See
ProjectionMode for projection modes description.

Members:

Name
Description
Mirror
Axial symmetry.
Radial
Radial symmetry.
NOTE
The name used to define members is available as a string via the .name attribute (see python enum.Enum).

class substance_painter.layerstack.SymmetryAxis(value) substance_painter.layerstack.SymmetryAxis

Members:

Name
Description
X
The X axis.
Y
The Y axis.
Z
The Z axis.
NOTE
The name used to define members is available as a string via the .name attribute (see python enum.Enum).
recommendation-more-help
substance-3d-dev-help-painter-python-guide