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.
Seesource_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.
Seeactive_channels. - RuntimeError – If the source is in
SourceMode.Material.
Seesource_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. Seesubstance_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. Seesubstance_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:
- channeltype (ChannelType | None) – Must be None in mono channel context.
- source (ResourceID | Color | AnchorPointEffectNode) – the source parameter.
Raises:
- EditionContextException – If the channeltype is not valid in the current context.
Seeactive_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. Seesubstance_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. Seesubstance_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:
Material: only one source is used to write to several
channels, seeget_material_source()andset_material_source().Split: each source write to a single channel, seeget_source()andset_source().None: the current context is not multi-channel (ex: a mask),
seeget_source()andset_source().
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.
Seesource_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.
Seeactive_channels. - RuntimeError – If the source is in
SourceMode.Material.
Seesource_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. Seesubstance_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. Seesubstance_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:
- channeltype (ChannelType | None) – Must be None in mono channel context.
- source (ResourceID | Color | AnchorPointEffectNode) – the source parameter.
Raises:
- EditionContextException – If the channeltype is not valid in the current context.
Seeactive_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. Seesubstance_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. Seesubstance_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:
Material: only one source is used to write to several
channels, seeget_material_source()andset_material_source().Split: each source write to a single channel, seeget_source()andset_source().None: the current context is not multi-channel (ex: a mask),
seeget_source()andset_source().
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 isProjectionMode.UV.
For a complete description of the parameters, see
UV Projection documentation.
Parameters:
- 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.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 isProjectionMode.Triplanar.
For a complete description of the parameters, see
Triplanar Projection documentation.
Parameters:
- filtering_mode (FilteringMode) – How to filter the image.
- shape_crop_mode (ShapeCropMode) – How the fill is cropped.
- hardness (float) – How hard is the transition between planes of the projection.
- uv_transformation (UVTransformationParams) – UV transformation.
- projection_3d (Projection3DParams) – 3D projection.
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 isProjectionMode.Planar.
For a complete description of the parameters, see
Planar Projection documentation.
Parameters:
- filtering_mode (FilteringMode) – How to filter the image.
- uv_wrapping_mode (UVWrapMode) – UV Wrapping behaviour.
- shape_crop_mode (ShapeCropMode) – How the fill is cropped.
- depth_culling (ProjectionCullingParams) – Depth culling settings.
- backface_culling (ProjectionCullingParams) – Backface culling settings.
- backface_culling_angle (float) – Minimum angle which determines when faces that are looking
away should be ignored, between 45 and 135. - uv_transformation (UVTransformationParams) – UV transformation.
- projection_3d (Projection3DParams) – 3D projection.
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 isProjectionMode.Spherical.
For a complete description of the parameters, see
Spherical Projection documentation.
Parameters:
- filtering_mode (FilteringMode) – How to filter the image.
- uv_wrapping_mode (UVWrapMode) – UV Wrapping behaviour.
- shape_crop_mode (ShapeCropMode) – How the fill is cropped.
- uv_transformation (UVTransformationParams) – UV transformation.
Spherical projection do not support UV transformation physical size options. - projection_3d (Projection3DParams) – 3D projection.
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 isProjectionMode.Cylindrical.
For a complete description of the parameters, see
Cylindrical Projection documentation.
Parameters:
- filtering_mode (FilteringMode) – How to filter the image.
- uv_wrapping_mode (UVWrapMode) – UV Wrapping behaviour.
- shape_crop_mode (ShapeCropMode) – How the fill is cropped.
- angle (float) – Size of the projection on the perimeter of the cylinder.
- backface_culling (ProjectionCullingParams) – Backface culling parameters.
- uv_transformation (UVTransformationParams) – UV transformation.
- projection_3d (Projection3DParams) – 3D projection.
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 isProjectionMode.Warp.
For a complete description of the parameters, see
Warp Projection documentation.
Parameters:
- filtering_mode (FilteringMode) – How to filter the image.
- uv_wrapping_mode (UVWrapMode) – UV Wrapping behaviour.
- shape_crop_mode (ShapeCropMode) – How the fill is cropped.
- projection_depth (float) – How far the projection goes along its Z axis.
- depth_culling (ProjectionCullingParams) – Depth culling parameters.
- uv_transformation (UVTransformationParams) – UV transformation.
- projection_3d (Projection3DParams) – 3D projection.
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 isProjectionMode.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:
- scale_mode (ScaleMode) – How scale should be interpreted.
For aProjectionMode.Sphericalprojection,
onlyScaleMode.Factorsis supported.
UsingScaleMode.MaterialPhysicalSizeis only possible when
applied to a resource with physical size information. - scale (List*[float]*) – The u/v stretch applied to the texture.
When scale_mode isScaleMode.Factors,
use plain factor for stretching.
When scale_mode isScaleMode.MaterialPhysicalSize, scale must be None
and the value will be forced to the actual material physical size.
When scale_mode isScaleMode.CustomPhysicalSize, then scale is
expressed in centimeters and overrides the size defined by the material
(useful when material has no physical size information). - rotation (float) – Rotation applied to the texture.
- offset (List*[float]*) – Offset applied to the texture.
The offset is unavailable for aProjectionMode.Triplanar
projection.
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 isProjectionMode.Planarand 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].
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.
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. Seesubstance_painter.layerstack.is_3d_projection_mode().
Members:
FillUVTriplanarPlanarSphericalCylindricalWarpUVSetToUVSetclass substance_painter.layerstack.FilteringMode(value) substance_painter.layerstack.FilteringMode
Members:
BilinearHQBilinearSharpNearestclass substance_painter.layerstack.UVWrapMode(value) substance_painter.layerstack.UVWrapMode
Members:
RepeatNoneRepeatHorizontallyRepeatVerticallyRepeatclass substance_painter.layerstack.ShapeCropMode(value) substance_painter.layerstack.ShapeCropMode
Members:
CroppedToShapeExtendsOutsideShapeclass substance_painter.layerstack.ScaleMode(value) substance_painter.layerstack.ScaleMode
Members:
FactorsMaterialPhysicalSizeCustomPhysicalSizeclass 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. SeeProjectionMode for projection modes description.
Members:
MirrorRadialclass substance_painter.layerstack.SymmetryAxis(value) substance_painter.layerstack.SymmetryAxis
Members:
XYZ