Substance 3D Painter Python API 0.3.5 Documentation
The Python API provides access to Substance 3D Painter functionalities via Python
scripts for Substance 3D Painter. This documentation contains the detailed API as
well as examples and samples.
This documentation is about a scripting API; follow this link for the
Substance 3D Painter documentation.
Overview
Changelog
0.3.7 (Substance 3D painter 12.1.0)
-
-
* Update enumeration
substance_painter.textureset.ChannelTypeto expose OpenPBR channel names by default and keep legacy/Adobe Standard Material channel names as aliases for backward compatibility.
-
-
-
* Add
substance_painter.layerstack.GeometryMaskMeshParamsandsubstance_painter.layerstack.GeometryMaskUVTilesParamscontaining a list of Meshes/UVTiles and a boolean that explicitly controls if the list is included or excluded from the geometry mask.
- Add
substance_painter.layerstack.LayerNode.get_geometry_mask()andsubstance_painter.layerstack.LayerNode.set_geometry_mask()to query and edit geometry mask settings through a unified and generic API for Meshes and UVTiles. - Function
substance_painter.layerstack.LayerNode.set_geometry_mask_type()is now deprecated, usesubstance_painter.layerstack.LayerNode.set_geometry_mask()instead. - Function
substance_painter.layerstack.LayerNode.set_geometry_mask_enabled_meshes()is now deprecated, usesubstance_painter.layerstack.LayerNode.set_geometry_mask()instead. - Function
substance_painter.layerstack.LayerNode.set_geometry_mask_enabled_uv_tiles()is now deprecated, usesubstance_painter.layerstack.LayerNode.set_geometry_mask()instead.
-
0.3.6 (Substance 3D painter 12.0.2)
-
-
* Add
substance_painter.project.AutoUnwrapUVTilesSettingsclass to control auto unwrap process during project creation and mesh reloading.
-
Update
substance_painter.project.create()to control auto unwrap process at project creation. -
Update
substance_painter.project.reload_mesh()to control auto unwrap process when reloading mesh.note warning WARNING Auto unwrap settings must now be explicitly provided to substance_painter.project.create()andsubstance_painter.project.reload_mesh(), and don’t rely on user preferences or project saved settings anymore.
-
-
-
* Add
substance_painter.layerstack.export_as_smart_material()andsubstance_painter.layerstack.export_as_smart_mask()to create and save a smart material or a smart mask in the filesystem without adding it in the shelf.
-
0.3.5 (Substance 3D painter 11.1.0)
-
-
* The
substance_painter.properties.PropertynamedPerVertex(boolean type) has been removed from the Curvature From Map baker. The new behavior is now always forced toPerVertex = False(or in the UI, the Per Fragment mode).
- The two
substance_painter.properties.PropertynamedTonemappingMinandTonemappingMax(float type) have been removed in favor of a newsubstance_painter.properties.PropertynamedTonemappingBounds(array of 2 float).
-
-
-
* Add
substance_painter.layerstack.is_3d_projection_mode()to query which projection mode is compatible with symmetry.
- Add
substance_painter.layerstack.FillLayerNode.get_symmetry_parameters()to get symmetry parameters on Fill layers. - Add
substance_painter.layerstack.FillEffectNode.get_symmetry_parameters()to get symmetry parameters on Fill effects. - Add
substance_painter.layerstack.FillLayerNode.set_symmetry_parameters()to set symmetry parameters on Fill layers. - Add
substance_painter.layerstack.FillEffectNode.set_symmetry_parameters()to set symmetry parameters on Fill effects.
-
-
-
- * Add member
log2_offsetinsubstance_painter.source.ResolutionOverrideto configure scaling inAutomode. - * Add property
substance_painter.source.SourceSubstance.resolutionto edit resolution override of the substance.
- * Add member
-
0.3.4 (Substance 3D painter 11.0.0)
-
-
* Add support for automatic cage feature in the baking parameters. The
substance_painter.properties.PropertynamedUseCage(boolean type) has been removed in favor of a newsubstance_painter.properties.PropertynamedCageMode(enum type).
-
-
-
* Add a new event
substance_painter.event.ReloadResourcesStartedto be notified when resource reloading starts.
- Add a new event
substance_painter.event.ReloadResourcesEndedto be notified when resource reloading ends.
-
-
-
* Add
substance_painter.layerstack.create_smart_material()to save a smart material.
- Add
substance_painter.layerstack.create_smart_mask()to save a smart mask.
-
-
-
* Add
substance_painter.resource.list_project_resources(),substance_painter.resource.list_project_outdated_resources()andsubstance_painter.resource.replace_project_resources()to list and replace resources in the project.
- Function
substance_painter.resource.list_layer_stack_resources()is now deprecated, usesubstance_painter.resource.list_project_resources()instead. - Function
substance_painter.resource.update_layer_stack_resource()is now deprecated, usesubstance_painter.resource.replace_project_resources()instead. - Add
substance_painter.resource.is_reload_modified_resources_running()to check if the resource reloading process is currently running. - Add
substance_painter.resource.reload_modified_resources_async()to trigger the resource reloading process. - Add
substance_painter.resource.Shelf.refresh()to refresh a particulat shelf only.
-
-
-
* Add properties
substance_painter.textureset.TextureSet.nameandsubstance_painter.textureset.TextureSet.descriptionto read/edit textureset’s name and description.
- Add properties
substance_painter.textureset.UVTile.nameandsubstance_painter.textureset.UVTile.descriptionto read/edit uvtile’s name and description. - Function
substance_painter.textureset.TextureSet.name()is now deprecated, use propertysubstance_painter.textureset.TextureSet.nameinstead.
-
-
-
* Add
substance_painter.source.ResolutionOverrideto configure resolution related parameters of a source vectorial or a source font.
- Members
resolution_modeandresolution_valueinsubstance_painter.source.SourceVectorialParamsare now deprecated, usesubstance_painter.source.SourceVectorialParams.resolutioninstead. - Members
resolution_modeandresolution_valueinsubstance_painter.source.SourceFontParamsare now deprecated, usesubstance_painter.source.SourceFontParams.resolutioninstead. - Rename
substance_painter.source.VectorialResolutionModetosubstance_painter.source.ResolutionMode. substance_painter.source.VectorialResolutionModeis now deprecated and an alias tosubstance_painter.source.ResolutionMode.
-
0.3.3 (Substance 3D painter 10.1.1)
-
-
* Fix members order of enumeration
substance_painter.resource.Usage.
- Fix members order and add VECTORIAL to enumeration
substance_painter.resource.Type.
-
0.3.2 (Substance 3D painter 10.1.0)
-
-
* Add
substance_painter.project.GltfSettingsto pass gltf specific options.
- Add a member
mesh_settingsinsubstance_painter.project.Settingswith typesubstance_painter.project.GltfSettingsorsubstance_painter.project.UsdSettings. - Member
usd_settingsinsubstance_painter.project.Settingsis now deprecated, usemesh_settingsinstead. - Add a member
mesh_settingsinsubstance_painter.project.MeshReloadingSettingswith typesubstance_painter.project.UsdSettings. - Member
usd_settingsinsubstance_painter.project.MeshReloadingSettingsis now deprecated, usemesh_settingsinstead.
-
0.3.1 (Substance 3D painter 10.0.1)
-
-
* Fix
substance_painter.layerstack.set_selection_type()to allow properties selection of an instance parent layer.
- Fix
substance_painter.layerstack.FillLayerNode.set_source(),substance_painter.layerstack.FillLayerNode.set_material_source(),substance_painter.layerstack.FillEffectNode.set_source()andsubstance_painter.layerstack.FillEffectNode.set_material_source()
to forbid creation of cycles with anchor points.
It will now throw aValueError.
-
-
-
* Fix
substance_painter.source.SourceSubstance.set_source()to forbid creation of cycles with anchor points.
It will now throw aValueError.
- Add
substance_painter.source.SourceBitmap.list_available_color_spaces()to query available colorspaces for a bitmap.
-
0.3.0 (Substance 3D painter 10.0.0)
This version introduces new modules to be able to edit your project layerstack.
With this new modules you will be able to navigate, access, edit, remove and add every
type of layers and effects available in the UI of Substance Painter.
-
-
* New module to manipulate the layer stack.
-
-
-
* New module to manipulate layer’s sources.
-
-
-
substance_painter.colormanagement* New module with colormanagement facilities for layerstack edition.
-
-
-
* Add ability to get substance presets details using
substance_painter.resource.Resource.internal_properties()function.
-
-
-
* Add
substance_painter.export.PredefinedExportPresetandsubstance_painter.export.list_predefined_export_presets()
to retrieve predefined export presets and list their output maps.
- Add
substance_painter.export.ResourceExportPresetandsubstance_painter.export.list_resource_export_presets()
to retrieve resource export presets (editable presets from shelves) and list their output maps.
-
0.2.12 (Substance 3D painter 9.1.1)
-
-
* Add
substance_painter.project.get_uuid()to query the project UUID.
-
0.2.11 (Substance 3D painter 9.1.0)
-
-
* Add ability to disable engine computations
- Add
substance_painter.application.close()to close Substance 3D Painter.
-
-
-
* Add
substance_painter.display.Camerato manipulate camera settings.
-
-
-
* Add a new event
substance_painter.event.EngineComputationsStatusChangedto be notified when engine computations status changes.
- Add a new event
substance_painter.event.CameraPropertiesChangedto be notified when the properties of a camera change.
-
-
-
* Add ability to export the mesh of the current project.
- Add ability to get the default export path used for exporting textures.
-
-
-
* Add
substance_painter.project.BoundingBoxandsubstance_painter.project.get_scene_bounding_box()to query dimensions of the scene.
-
0.2.10 (Substance 3D painter 9.0.0)
-
-
* Fix textures exported in EXR with 32f bit depth were incorrectly saved in 16f.
-
-
-
* Add
substance_painter.project.UsdSettingsinsubstance_painter.project.Settingsto support USD parameters for project creation.
- Add
substance_painter.project.UsdSettingsinsubstance_painter.project.MeshReloadingSettingsto support USD parameters for mesh reloading.
-
0.2.9 (Substance 3D Painter 8.3.1)
-
-
* New module to expose primitives used in async computations.
-
-
-
* Add a new event
substance_painter.event.BakingProcessProgressto be notified about baking process progress.
- Add a new event
substance_painter.event.BakingProcessAboutToStartto be notified of the start of a baking process. - Allow to configure throttling period for
substance_painter.event.TextureStateEvent.
-
-
-
* Add
substance_painter.baking.bake_selected_textures_async()to bake all selected texture set.
- Fix
substance_painter.baking.bake_async()to take UV Tiles selection into account. - Now async functions return a
substance_painter.async_utils.StopSourceto allow for cancellation.
-
0.2.8 (Substance 3D Painter 8.3.0)
-
-
* New module to expose functionnalities on the application level.
- Add
substance_painter.application.version_info()to query Substance 3D Painter version as a tuple. - Add
substance_painter.application.version()to query Substance 3D Painter version as a string.
-
-
-
* Add a new event
substance_painter.event.BakingProcessEndedto be notified of the end of the baking process.
-
-
-
* Add
substance_painter.project.last_saved_substance_painter_version()to query wich Substance 3D
Painter version was used to last save the project.
-
-
-
* Add
substance_painter.textureset.TextureSet.uv_tile()to get a specific UV Tile.
-
-
-
* Add Baking to
substance_painter.ui.UIMode.
- Add
substance_painter.ui.get_current_mode()to query the current UI mode. - Add
substance_painter.ui.switch_to_mode()to switch to some UI mode.
-
This version introduces the modules:
0.2.7 (Substance 3D Painter 8.2.0)
-
-
* Add new values to
substance_painter.resource.Typeenumeration.
- Add
substance_painter.resource.Resource.children()to query child resources of a resource. - Add
substance_painter.resource.Resource.parent()to query parent resource of a resource.
-
-
-
* Add
substance_painter.textureset.MeshMapUsageto enumerate possible Mesh map usages.
- Add
substance_painter.textureset.TextureSet.get_mesh_map_resource()to query the resource set as some Mesh map usage. - Add
substance_painter.textureset.TextureSet.set_mesh_map_resource()to replace the resource for some Mesh map usage.
-
-
-
* Add
substance_painter.ui.get_layout()to save UI layout state.
- Add
substance_painter.ui.get_layout_mode()to query the UI mode of a saved state. - Add
substance_painter.ui.set_layout()to restore a saved UI state. - Add
substance_painter.ui.reset_layout()to reset UI state to default.
-
-
-
* Add a new event
substance_painter.event.TextureStateEventto be notified of document textures edition.
-
0.2.6 (Substance 3D Painter 8.1.2)
-
-
*
substance_painter.project.create()andsubstance_painter.project.Settings
now supports using a custom unit scale for mesh size.
-
-
-
* Add
substance_painter.textureset.TextureSet.all_mesh_names()to query the list of mesh names used in a Texture Set.
- Add
substance_painter.textureset.UVTile.all_mesh_names()to query the list of mesh names used in a UV Tile.
-
-
-
* Add
substance_painter.resource.Usageenumeration to describe resource usages.
- Add
substance_painter.resource.Typeenumeration to describe resource types. - Add
substance_painter.resource.Resource.category()to query the category of a resource. - Add
substance_painter.resource.Resource.usages()to query the usages of a resource. - Add
substance_painter.resource.Resource.gui_name()to query the name of a resource. - Add
substance_painter.resource.Resource.type()to query the type of a resource. - Add
substance_painter.resource.Resource.tags()to query the tags of a resource. - Add
substance_painter.resource.Resource.internal_properties()to query a dictionnary of a resource internal properties.
-
0.2.5 (Substance 3D Painter 8.1.0)
This version upgrades to Python 3.9.9.
-
-
*
substance_painter.project.create()supports PAINTER_ACE_CONFIG
environment variable, to setup the project color management mode.
substance_painter.project.create()now raise an error if OCIO
or PAINTER_ACE_CONFIG environment variable is set to an invalid
configuration.
-
0.2.4 (Substance 3D Painter 7.4.3)
This version exposes the tone mapping operator to the Python API, and adds
a hook to execute code when Substance 3D Painter is not busy.
-
-
* Add
substance_painter.display.get_tone_mapping()to query the
project tone mapping.
- Add
substance_painter.display.set_tone_mapping()to set the
project tone mapping.
-
-
-
* Add
substance_painter.project.execute_when_not_busy()to execute
code when Substance 3D Painter is no longer busy.
-
0.2.3 (Substance 3D Painter 7.4.0)
This version makes it possible to work with JavaScript from the Python API.
It also allows creating projects with OCIO color management capabilities.
-
-
* Add
substance_painter.js.evaluate()to evaluate some JavaScript code.
-
-
-
*
substance_painter.project.create()supports OCIO environment variable,
to setup the project color management mode.
-
0.2.2 (Substance 3D Painter 7.3.0)
This version adds functions to help with scripted project loading, project
mesh reloading and UV Tiles manipulation. It also improves error handling
in several modules.
-
-
*
substance_painter.display.set_color_lut_resource()andsubstance_painter.display.set_environment_resource()throw a
TypeError instead of a ValueError when an argument has a type different
from expected.
-
-
-
* Add
substance_painter.event.Dispatcher.connect_strong()to connect
strong reference callbacks to the event dispatcher.
-
-
-
* Add
substance_painter.project.is_busy()to query whether Substance
3D Painter is busy.
- Project saving functions are disabled when Substance 3D Painter is
busy. - Add
substance_painter.project.last_imported_mesh_path()to query the
path to the last imported mesh. - Add
substance_painter.project.reload_mesh()to load a new mesh in the
current opened project. substance_painter.project.create()throws a TypeError instead
of a ValueError when its settings argument has a type different from
expected.
-
-
-
* Add
substance_painter.resource.show_resources_in_ui()to highlight a
list of resources in the aplication UI.
substance_painter.resource.update_layer_stack_resource()throws
a TypeError when an argument has a type different from expected.
-
-
-
* Add
substance_painter.textureset.UVTileto interact with UV Tiles.
Add ability to manipulate UV Tiles resolutions.
substance_painter.textureset.TextureSet.from_name()throws a
TypeError instead of a ValueError when its argument has a type different
from expected.
-
0.2.1 (Substance 3D Painter 7.2.1)
This version adds functions to list and update resources used by the layer
stack.
-
-
* Add
substance_painter.resource.list_layer_stack_resources()to
list resources used by the layer stack and mesh maps.
- Add
substance_painter.resource.update_layer_stack_resource()to
update resources used by the layer stack and mesh maps.
-
0.2.0 (Substance 3D Painter 7.2.0)
-
-
* Add
substance_painter.resource.Resource.show_in_ui()to highlight
a resource in the UI.
- Modify
substance_painter.resource.Shelves.user_shelf()to take
user settings into account.
-
-
-
* Modify
substance_painter.textureset.ChannelTypeto include
the new available texture channels.
-
-
-
* Add
substance_painter.ui.add_plugins_toolbar_widget()to add
a widget to the plugins toolbar.
-
0.1.0 (Substance Painter 7.1.0)
This version adds several features to manage resources, shelves and UV Tiles.
-
- Add
substance_painter.event.ProjectEditionLeftevent. - Add
substance_painter.event.ShelfCrawlingStartedevent. - Add
substance_painter.event.ShelfCrawlingEndedevent.
- Add
-
-
* Add
substance_painter.resource.Resourceto manipulate substance
painter resources.
- Add
substance_painter.resource.search()to search for available
resources. - Add
substance_painter.resource.Shelf. - Add
substance_painter.resource.Shelvesfor shelves manipulation
facilities.
-
0.0.3 (Substance Painter 6.2.2)
-
-
* Document the use of existing export presets.
- Add a module overview example.
-
0.0.2 (Substance Painter 6.2.0)
This version adapts the module substance_painter.project to the new
UV Tile workflow.
-
- Change the constructor of
substance_painter.project.Settings.
- Change the constructor of
0.0.1 (Substance Painter 6.1.0)
Initial version of the Substance Painter Python API.
It uses Python 3.7.6 and introduces the modules: