Module mset
getToolbagVersion() -> int
Returns the current toolbag version, as an integer (e.g. 5021).
getGraphicsAdapterName() -> str
Returns the name of the graphics device in use.
getPluginPath() -> str
Returns the current plugin path (eg. "C:/Program Files/Marmoset Toolbag 5/data/plugins/Example.py").
quit()
Quits the application. Any unsaved changes will be lost.
loadScene(filePath: str, downloadMissingLibraryAssets: bool = False)
Loads a Marmoset Toolbag scene file. Unsaved changes to any currently open scenes are lost.
saveScene(filePath: str)
Saves a Marmoset Toolbag scene file. If a scene file path is not specified, the scene will be saved to its existing location.
newScene()
Creates a new empty scene. Any unsaved changes in the current scene will be lost.
getSceneUnitScale() -> float
Returns the current unit size of the scene, in meters. For example, a scene working in centimeters will return 0.01.
getScenePath() -> str
Returns the path of the current scene file.
importModel(filePath: str) -> SceneObject
Imports the specified model into the existing scene, using the scene's current import settings. Returns the imported object.
importMaterial(filePath: str, name: str = '') -> Material
Imports the specified material file into the scene. If no name is given, one will be automatically assigned. This function supports import from Toolbag materials, MTL files, Valve/Dota materials, and named texture files. Returns the imported material.
renderCamera(path: str = '', width: int = -1, height: int = -1, sampling: int = -1, transparency: bool = False, camera: str = '', viewportPass: str = '') -> Image
Renders an image with the given camera, or the main camera if none is specified. This will use the current resolution/format settings from the render scene object. Viewport pass accepts a render pass string (from component view / render passes dropdown box), if the string is not on the list or an empty string is used, the Full Quality pass is rendered by default.Returns an Image instance. Optionally takes a path parameter, which specifies where to write the image. If no path is specified, no image file will be written.
renderImages(width: int = -1, height: int = -1, sampling: int = -1, transparency: bool = False)
Renders images with the render scene object's current settings and cameras. To render a single image, see renderCamera().
renderVideos(width: int = -1, height: int = -1, sampling: int = -1, transparency: bool = False)
Captures an animation into a video file or image sequence. The animation will be written into the file path(s) specified in the scene's render object.
exportViewer(path: str = '', title: str = '', author: str = '', authorURL: str = '', textureQuality: str = 'high', highResThumbnail: bool = False, html: bool = False, autoStartHTML: bool = False, fullframeHTML = False, presetHTML: bool = False, width: int = -1, height: int = -1, exportAnimations: bool = False, exportModelShowcase: bool = False, autoPlayAnimations: bool = False, showPlaybackControls: bool = False)
Exports a Marmoset Viewer (.mview) archive. This file will be written to the file path specified, or to the scene's default location if no path is specified.
exportSceneUSD(path: str = '', models: bool = True, lights: bool = True, skies: bool = True, cameras: bool = True, materials: bool = True, normals: bool = True, uvmaps: bool = True, vertexcolors: bool = True, triangulate: bool = False, subdivision: bool = False, displacement: bool = False, copyfilereferences: bool = False, skiptextures: bool = False, uniquetextures: bool = False)
Exports a Universal Scene Description (.usdx) archive. This file will be written to the file path specified, or to the scene's default location if no path is specified. This format supports models, lights, skies, cameras, and materials (converted to their closest equivalent). Mesh data can include normals, uvmaps, and vertex colors. Meshes can be exported with original polygons or triangulated - subdivision and displacement can be directly applied to the output meshes - this may increase the file size. Note: When displacement is enabled, subdivision will also be enabled. The copyfilereferences option will export referenced files bundled with this file when True (False to keep their absolute paths the same). Note:This option is ignored when exporting a .usdz file The uniquetextures option decides whether to overwrite, or create a unique texture name in the case where the same file name exists at the export path (when skiptextures is False).
exportSceneGLTF(path: str = '', models: bool = True, lights: bool = True, cameras: bool = True, materials: bool = True, normals: bool = True, tangents: bool = True, uvmaps: bool = True, vertexcolors: bool = True, subdivision: bool = False, displacement: bool = False, texturequality: int = 3, metalnessthreshold: float = 0.8)
Exports a WebGL-ready glTF (.glb) archive. This file will be written to the file path specified, or to the scene's default location if no path is specified. This format supports models, lights, cameras, and materials (converted to their closest equivalent). Mesh data can include normals, tangents, uvmaps and vertex colors. Meshes are triangulated by default - subdivision and displacement can be directly applied to the output meshes - this may increase the file size. Note: When displacement is enabled, subdivision will also be enabled. Texture quality is set from 0 to 3, with 3 being the highest. The specular metalness conversion threshold is a value above which materials will be converted to metalness.
exportSceneFBX(path: str = '', models: bool = True, lights: bool = True, cameras: bool = True, materials: bool = True, embedassets: bool = False, uvmaps: bool = True, triangulate: bool = False, subdivision: bool = False, displacement: bool = False)
Exports an Autodesk FBX (.fbx) archive. This file will be written to the file path specified, or to the scene's default location if no path is specified. This format supports models, lights, cameras, and materials (converted to their closest equivalent).Mesh vertex data can include uvmaps (normals are included by default).Meshes can be exported with original polygons or triangulated - subdivision and displacement can be directly applied to the output meshes - this may increase the file size. Note: When displacement is enabled, subdivision will also be enabled. The embedassets option is used to save textures in the export file (depending on the format being exported this may not be possible).
exportSceneOBJ(path: str = '', models: bool = True, materials: bool = True, uvmaps: bool = True, subdivision: bool = False, displacement: bool = False)
Exports an Alias/WaveFront Object (.obj) archive. This file will be written to the file path specified, or to the scene's default location if no path is specified. This format supports models and materials (converted to their closest equivalent). Mesh vertex data can include uvmaps (normals are included by default).Meshes are triangulated by default - subdivision and displacement can be directly applied to the output meshes - this may increase the file size. Note: When displacement is enabled, subdivision will also be enabled.
exportSceneCOLLADA(path: str = '', models: bool = True, lights: bool = True, materials: bool = True, embedassets: bool = False, uvmaps: bool = True, subdivision: bool = False, displacement: bool = False)
Exports a COLLAborative Design Activity (.dae) archive. This file will be written to the file path specified, or to the scene's default location if no path is specified. This format supports models, lights, and materials (converted to their closest equivalent). Mesh vertex data can include uvmaps (normals are included by default). Meshes are triangulated by default - subdivision and displacement can be directly applied to the output meshes - this may increase the The embedassets option is used to save textures in the export file (depending on the format being exported this may not be possible).
frameObject(object: SceneObject)
Centers and frames the given object in the current camera.
frameScene()
Centers and frames the entire scene in the current camera.
getSceneBounds() -> List[List[float]]
Gets the bounds of the entire scene. Formatted as [min_xyz, max_xyz]
findObject(searchString: str)
Finds an Object in the scene by string name.
setSelectedObjects(objs: List[SceneObject]) -> bool
Select the provided scene objects. Returns true if successful. See also 'getSelectedObjects'.
getSelectedObject() -> SceneObject
Returns the currently selected Object. If multiple objects are selected this function will return the first selection. See also 'getSelectedObjects'.
getSelectedObjects() -> List[SceneObject]
Returns all currently selected scene Objects as a list.
getAllObjects() -> List[SceneObject]
Returns all scene Objects as a list.
groupObjects(list: List[SceneObject])
Groups an array of SceneObjects.
getAllMaterials() -> List[Material]
Returns all materials as a list.
findMaterial(name: str) -> Material
Finds a Material by string name.
getSelectedMaterial() -> Material
Returns the currently selected Material.
getSelectedMaterialGroup() -> List[Material]
Returns the currently selected Material group as an array of materials.
bakeAll()
Bakes all objects in the scene.
getCamera()
Gets the current active camera from the currently focused viewport.
setCamera(camera: CameraObject)
Sets the current active camera for viewport and screenshot rendering.
getTimeline() -> Timeline
Returns the current scene's timeline, for animation control.
getLibrary() -> Library
Returns your current installation's library. Used to configure your library with custom assets.
getPreferences() -> Preferences
Returns your preferences. Used to configure yourToolbag instalation.
getTraceBackendType() -> str
Returns the type of the trace backend in use.
getOptimalTraceBackendType() -> str
Returns optimal trace backend type for the current GPU.
shutdownPlugin()
Halts execution and shuts down the currently running plugin.
fail(msg: str)
Generates a failure message to an automated testing log. Mainly for internal use.
log(msg: str)
Prints text to the application log, similar to print(). No return will be appended.
err(msg: str)
Prints text to the application log, as an error. No return will be appended.
clearTestLog()
Marmoset internal use for testing.
freeUnusedResources()
Frees from memory any retained but unused resources (such as textures). Generally this function is unnecessary, but it can be useful to keep total memory use lower in scripts that batch process large numbers of resources. Called automatically whenever a new scene is created or loaded.
showOpenFileDialog(fileTypes: List[str] = [], multiple: bool = False) -> str
Prompts the user with a file open dialog box, and resumes after the user selects a file. Returns the selected file path, or an empty string if the user canceled the dialog. Permitted file extensions can be optionally specified by the fileTypes array, which can contain one or more of: 'images', 'models', 'materials', which specify categories of file types, individual file extensions supported by Marmoset Toolbag (such as 'jpg', 'fbx', etc.), or at most one custom file extension. Specify extension names in lower case without the '.' character. Multiple files my be selected, and paths will be returned as an array, if 'multiple' is set to True.
showOpenFolderDialog() -> str
Prompts the user with a folder open dialog box, and resumes after the user selects a folder. Returns the selected file path, or an empty string if the user canceled the dialog.
showSaveFileDialog(fileTypes: List[str] = []) -> str
Prompts the user with a file save dialog box, and resumes after the user selects a file destination. Returns the selected file path, or an empty string if the user canceled the dialog. Permitted file extensions can be optionally specified by the fileTypes array, which can contain one or more of: 'images', 'models', 'materials', which specify categories of file types, individual file extensions supported by Marmoset Toolbag (such as 'jpg', 'fbx', etc.), or at most one custom file extension. Specify extension names in lower case without the '.' character.
showOkCancelDialog(title: str, prompt: str) -> bool
Prompts the user with a modal dialog box. The window is given a titlebar named 'title' and prompt text 'prompt'. Returns True or False depending on whether OK or Cancel is selected.
showOkDialog(title: str, prompt: str) -> bool
Prompts the user with a modal dialog box. The window is given a titlebar named 'title' and prompt text 'prompt'. Returns True when OK is selected.
compressFile(filePath: str, archiveOutputPath: str)
Compresses a file on disk into a gzipped tarball archive (tgz).
compressFolder(folderPath: str, archiveOutputPath: str)
Compresses a folder, including all subdirectories, into a gzipped tarball archive (tgz).
readAndExportStamp(inputPath: str, outputPath: str)
Marmoset internal use for stamp brush creation
getStoreItem(key: str) -> Any
Get data in a shared persistent store that is accessable across plugins.
setStoreItem(key: str, val: Any)
Store data in a shared persistent store that is accessable across plugins.
Scene Object
duplicate(name: str = '') -> SceneObject
Duplicates the object, optionally assigning it a new name. Returns the new object.
getChildren() -> List[SceneObject]
Returns a list of all immediate children of the object.
findInChildren(searchStr: str) -> SceneObject
Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.
setKeyframe(lerp: str = '', property: str = '')
Sets a keyframe on this object with the assigned interpolation function ("linear", "step", "spline", or "splineBreak"). This setting defaults to editor's default. If no property string is specified, all object properties will be keyframed.
Render Object in scene. Manages render configuration can render images/videos.
Inherited Members
The final scene render configuration.
"rasterUseShadowCascades": type Use cascaded shadow maps for directional lights. This can provide better resolution distribution over larger scenes.
"shadowCascadeDistance": type A bias value for how distance the furthest shadow cascade is from the camera.
"shadowBias": type A bias value for how distance the furthest shadow cascade is from the camera.
"occludeAmbient": type Whether screen space ambient occlusion should occlude ambient light in raster rendering.
"occludeDiffuse": type Whether screen space ambient occlusion should occlude diffuse light in raster rendering.
"occludeSpecular": type Whether screen space ambient occlusion should occlude specular light in raster rendering.
"occlusionStrength": type Whether screen space ambient occlusion should occlude ambient light in raster rendering.
occlusionMode: str Occlusion mode. Valid values are 'Disabled', 'Screen', 'Raytraced'.
"reflectionDiffuseIntensity": type The level of brightness the diffuse reflections have.
"reflectionDiffuseDistance": type The distance diffuse reflections should be allowed to propigate.
"rayTraceAdvancedSampling": type Whether advanced sampling is enabled. Reduces noise in scenes with many lights. Has moderate impact on render time and viewport performance.
"rayTraceTransmissionBounces": type The maximum number of transmission bounces a ray can perform.
"rayTraceDirectRadianceClamp": type The maximum direct brightness allowed when ray tracing. Useful to reduce fireflies.
"rayTraceIndirectRadianceClamp": type The maximum indirect brightness allowed when ray tracing. Useful to reduce fireflies.
"rayTraceDiffuseIntensity": type The base intensity of diffuse interactions. Can be scaled for a more stylistic look.
"rayTraceReflectionIntensity": type The base intensity of reflection interactions. Can be scaled for a more stylistic look.
"rayTraceSampleAccumulation": type The number of samples total allowed to be traced in the viewport each frame.
rayTraceDenoiseMode: str The current denoising mode. Can be 'off', 'cpu', or 'gpu'.
rayTraceDenoiseQuality: str The current level of denoising quality. Can be 'low', 'medium', or 'high'.
rayTraceDenoiseStrength: float The current level of denoising quality. Is a value between 0.0 and 1.0.
rayTraceVolumetricFogAnisotropy: float The current level of volumetric anisotropy. Is a value between -1.0 and 1.0.
"albedoEnergyConservation": type Albedo is energy converving. Applies to the albedo and specular render passes.
normalSpace: str The normal space to render when using a Normal render pass. Valid values are 'tangent', 'object', and 'view'.
positionNormalization: str The normal view to render when using a Position render pass. Valid values are 'Bounding Sphere', 'Bounding Box', and 'Disabled'.
depthNormalization: str The normal view to render when using a Depth render pass. Valid values are 'Bounding Sphere', 'Bounding Box', and 'Disabled'.
fogSkyIllumination: float Influence of sky illumination on fog. Is a value between 0.0 and 1.0.
fogLightIllumination: float Influence of light illumination on fog. Is a value between 0.0 and 10.0.
Render Output options, the configuration of image or video export.
format: str The output format for this export. can be 'JPEG', 'PNG', 'TGA', 'PSD', 'PSD (16-bit)', 'EXR (16-bit)', 'EXR (32-bit)', 'DDS (16-bit)', 'DDS (32-bit)', 'PFM (32-bit)', 'MP4 Lossless' on MacOS or 'AVI Lossless' on Windows, 'MPEG4', or 'Auto'.
compressionQuality: int The level of compression for compressed video file formats like avi. Can be between 0 and 100. Does not apply to image exports.
rayTraceDenoiseMode: str The current denoising mode for this output. Can be 'off', 'cpu', or 'gpu'.
Options when configuring a render pass to render with Toolbag.
Options when configuring a camera to render with Toolbag.
Backdrop Object
Inherited Members
Transform Object
Inherited Members
Light Object
temperature: float The black body color temperature of the light. This value is in degrees Kelvin, in the range 1,000 to 10,000. This setting only takes effect when enabled (see useTemperature).
Camera Limits Settings
Camera Lens Settings
dofEnabled: bool Enables the depth of field effect. This is a legacy variable, consider using 'dofMode' instead.
dofAnamorphicRatio: float Anamorphic lens ratio for horizontal distortion of depth of field.
distortionChromaticAberration: float Strength of the chromatic aberration effect.
distortionCAGreen: float Strength of the chromatic aberration in the green component.
distortionCABlue: float Strength of the chromatic aberration in the blue component.
lensFlareCoating: float Adds coating to the entire lens system, causing lens flare more apparent.
motionBlurEnable: bool Toggles motion blur effect for final render animations and stills.
motionBlurEnableLoopingAnimation: bool Toggles last frame to wrap back to the first frame for future frame accumulation.
Camera Post Effect
toneMappingMode: str Tone mapping mode (allowed values are: 'linear', 'reinhard', 'hejl', 'aces', 'agx')
contrastCenter: float A value above which color values are brightened, and below which color values are darkened to achive the contrast effect.
filmGrainMode: str Sets the style of grain. (allowed values are: 'Off', 'Film', 'Digital')
filmGrainTilingMode: str Sets the texture or coarseness of the grain effect. (allowed values are: 'Fine', 'Medium', 'Coarse')
filmGrainDirtIntensity: float Sets the overall opacity of the scratches and stains.
Camera Object
orbitRadius: float The radius about which the camera orbits. This value won't move the camera directly, but affects orbit behavior when the camera view is rotated.
orthoScale: float The scale of this camera in orthographic mode. Measured in scene units.
Shadow Catcher Object
edgeFade: bool Enables a fading of shadow opacity towards the edges of the shadow catcher plane.
fadeTexturePath: str File path of the fade texture, which is used to control the shadow fade pattern.
textureChannel: str The active channel in the fade texture (must be one of: 'R', 'G', 'B', 'A').
roughnessTexturePath: str The texture used to specify surface roughness. White corresponds to a rough surface while black corresponds to smooth surfaces.
roughnessTextureChannel: str Determines the channel of the texture from which to read roughness content (must be one of: 'R', 'G', 'B', 'A').
invertRoughness: bool Inverts the output of the roughness shader. Useful for loading gloss maps in place of roughness maps.
specularFresnel: float Sets the intensity of the Fresnel effect, or how reflective surfaces are at grazing angles.
specularTexturePath: str The texture that will be used to set the color and intensity of the specular reflections.
Skybox Scene Object
saveSky(path: str)
Saves the current sky to the specified file path as a .tbsky archive.
backgroundColor: List[float] The background color when rendering with the skybox mode set to 'color'.
childLightBrightness: float The brightness of child lights on this skybox object.
time: float Time of day, in hours, generally from 0 to 24, although values outside this range will also work. Only applies to procedural skies.
timeZone: int Time zone, specified in hours offset from UTC. Only applies to procedural skies.
latitude: float Degrees latitude on earth, from -90 south to 90 north. Only applies to procedural skies.
longitude: float Degrees longitude on earth, from -180 west to 180 east. Only applies to procedural skies.
turbidity: float A value from 0 to 1 which controls the particulate density in the atmosphere. Only applies to procedural skies.
sunBrightness: float Scales the apparent brightness of the sun, relative to the sky. A value of 1 is most realistic. Only applies to procedural skies.
sunScale: float Scales the apparent size of the sun. A value of 1 is most realistic. Only applies to procedural skies.
groundColorNear: vec Color of the ground plane near the scene. Only applies to procedural skies.
groundColorFar: vec Color of the ground plane near the horizon. Only applies to procedural skies.
whiteBalance: float Color temperature shift of the sun and sky. Only applies to procedural skies.
tint: float Color balance shift of the sun and sky, complementary to white balance. Only applies to procedural skies.
Inherited Members
Fog Object
Inherited Members
Turntable Object
Mesh
triangles: List[float] Mesh triangle indices, as a list of int groups of 3 ( e.g. [0,1,2, 1,3,2] )
polygons: List[int] Mesh polygon groups, as a list of int groups of 2, start and count ( e.g. [0,2, 1,2] )
vertices: List[float] Mesh vertex positions, as a list of float groups of 3 ( e.g. [x,y,z, x,y,z] )
secondaryUVs: List[float] Mesh secondary texture coordinates, as a list of float groups of 2 ( e.g. [u,v, u,v] )
Mesh Object
addSubmesh(name: str, material: Material = None, startIndex: int = 0, indexCount: int = -1)
Adds and returns a SubMeshObject to the MeshObject, rendering the specified range of indices. name: Name of the SubMeshObject material: The Material assigned to the submesh. startIndex: The index of the first vertex of the submesh. indexCount: The number of indices following 'startIndex', or -1 to cover all remaining indices in the mesh.
tangentSpace: str Mesh tangent space for normal mapping. This must be one of the following values: 'Custom' 'Marmoset', 'Mikk', 'Maya', '3D Studio Max', 'Unity'
fixMirroredTangents: bool Fix tangent issues that arise with mirrored UVs in certain tangent spaces.
subdivisionLevel: bool If this object isn't visible to the camera. Useful for emissive surfaces you may want hidden.
subdivisionMode: str The method used for subdivision. Can be 'Catmull-Clark', 'Regular', or 'PN Triangles'.
subdivisionSharpenCorners: bool If corners should be sharp when subdividing. Helps keep the shape of your mesh with catmull-clark subdivisions.
subdivisionSmoothing: float The level of smoothing that should be done with PN Triangle subdivision.
subdivisionWireframeMode: str How wireframes should look with subdivisions. Can be 'Isolines' or 'Polygons'.
subdivisionGeometryReduction: str The level of geometry decimation that should be done while subdividing. Helps with real time performance.
Sub Mesh Object
Inherited Members
Gradient Data, used with Texture Project layers to control various effects.
addColor(color: List[float], position: float, weight: float)
Adds a color to this gradient.
setColor(index: int, color: List[float], weight: float)
Sets a given color of this gradient.
Level Data, used with Texture Project layers to control various effects.
Spline Data, used with Texture Project layers to control various effects.
A Projector object that controls layer projection.
projectionMethod: str The projection method of this projector (uv, triplanar, positional, brush, or planar).
normalWeight: float The amount of normal fading. Used in triplanar projection to blend normals.
position: List[float] A list of 3 floats (x, y, z) describing the position of this projector.
A Material Surface Map, with customizable parameters.
Per map settings for layers/brushes.
A Texture Project Layer (Fill, Stroke, etc.).
addContentChild(contentType: str) -> TextureProjectLayer
Add a content child to the current layer.
addMaskChild(maskType: str) -> TextureProjectLayer
Add a mask child to the current layer.
getBlendMode(projectMap: str)
Gets the blend mode of this layer for a given project map.
setBlendMode(projectMap: str, mode: str)
Sets the blend mode of this layer for a given project map.
duplicate() -> TextureProjectLayer
Duplcates this layer in this painter project. Returns duplicated layer.
isDescendantOfMask()
Checks if this layer is a descendant of a mask layer for this painter project.
isCarveGroupRegularMask()
Checks if this layer is a carve group regular mask.
A Texture Project Output Map
format: str The extension type for this output map. Can be one of the following: 'PNG', 'TGA', 'JPG', 'PSD'
bitrate: int The bitrate for this output map. Can be 8 or 16. PNG supports 8/16 bit, TGA supports 8 bit, JPG supports 8 bit, PSD supports 8/16 bit
Scene Object for Texture Projects.
addLinkedMaterial(mat: Material)
Add a linked material to this texture project.
addDefaultProjectMaps()
Convenience function, adds the default set of project maps (PBR Metalness + Normals, Occlusion, Bump) to this texture project.
removeProjectMap(name: str)
Add a project map to this texture project.
getAllProjectMaps() -> List[str]
Gets all project maps from this texture project to get/set any settings it might have.
getProjectMapFormat(name: str) -> str
Get the format of a given texture project map.
setProjectMapFormat(name: str, format: str)
Set the format of a given texture project map. Can be one of the following: 'RGB 8-bit (sRGB)', 'RGB 8-bit (Linear)', 'RGB 16-bit (sRGB)', 'RGB 16-bit (Linear)', 'Grayscale 8-bit (sRGB)', 'Grayscale 8-bit (Linear)', 'Grayscale 16-bit (sRGB)', 'Grayscale 16-bit (Linear)'
setInputMap(name: str, tex: Union[Texture, str])
Sets an input map to this texture project to be used as base information during texture generation.
getInputMap(name: str) -> Texture
Sets an input map to this texture project to be used as base information during texture generation.
getOutputMapCount() -> int
Get the number of project maps in this texture project.
getOutputMap(index: int) -> TextureProjectOutputMap
Get an output map coresponding to this index or name for this texture project.
addOutputMap(suffix: str, type: str, format: str, bitrate: int, rgb: str, a: str) -> TextureProjectOutputMap
Add and configure an output map for this texture project. For parameter info, see TextureProjectOutputMap.
removeOutputMap(index: Union[int, TextureProjectOutputMap])
Remove an output map for this texture project.
exportOutputMap(index: int)
Exports a single output map given a zero-based index.
exportOutputMapTiles(index: int, baseName: str, tiles:List[int], tilesCount: int)
Exports a single output map given a zero-based index.
exportAllOutputMaps()
Convenience function that exports all output maps for this painter project according to your export settings.
addLayer(layerType: str) -> TextureProjectLayer
Add a layer to the top of this texture project.
getSelectedLayers() -> List[TextureProjectLayer]
Get a list of all selected layers in this texture project.
findLayerByName(layerType: str) -> TextureProjectLayer
Finds and returns a layer by name, if multiple layers share the same name, the first one that matches will be returned.
getAllLayers() -> List[TextureProjectLayer]
Get a list of all layers in this texture project.
getActiveLayer() -> TextureProjectLayer
Gets the currently active layer selected in this texture project.
getAllLayerTypes() -> List[str]
Get all types of layers that can be created in a texture project.
recomposite()
Rerender this texture project. Useful if you're having trouble seeing changes in your texture renders.
generateExportAsset(index: int) -> Image
Generates an output map asset image given an zero-based index.
viewportUndersample: int Resolution undersampling scale (viewport res = full res / undersampling). Meant to improve viewport performance at the cost of quality. Does not affect final output.
previewUndersample: int Resolution undersampling scale. (preview res = full res / undersampling). Improves performance at the cost of quality when actively editing or painting on a layer. Does not affect final output.
useThicknessAsScatter: bool Use tickness as scatter subroutine with materials.
reflectionWorkflow: str The current reflection workflow. Can be either 'metalness' or 'specular'
metalnessThresholdCenter: float The center region where materials are defined as non-metal vs metal.
metalnessThresholdRange: float The range of values that are interpolated between non-metal and metal.
outputPath: str The directory of the texture project exports. For the file name itself, see outputPathBaseName.
outputPathBaseName: str The base file name of the texture project exports. Suffixes are appended to this string upon export. For example, if the base name is 'output', an albedo map is written as 'output_albedo'. Files are written to the directory specified by 'outputPath'.
Inherited Members
Baker Map Settings
Position Baker Map Settings
Inherited Members
Normal Baker Map Settings
Inherited Members
Height Baker Map Settings
innerDistance: float Inner height map distance from the low poly mesh, in world units. This value maps to black in the height map.
outerDistance: float Outer height map distance from the low poly mesh, in world units. This value maps to white in the height map.
Inherited Members
Curvature Baker Map Settings
Inherited Members
Thickness Baker Map Settings
Inherited Members
Bent Normal Baker Map Settings
ignoreGroups: bool Determines whether bake groups will be ignored when baking bent normals.
Inherited Members
Bent Normal Baker Map Settings
floorOcclusion: float Determines whether an artificial floor plane will be used for ambient occlusion baking.
ignoreGroups: bool Determines whether bake groups will be ignored when baking ambient occlusion.
cosineWeight: float Weights from -1 to 1, increasing values result in more 'cavity' shadows.
Inherited Members
UVIsland Baker Map Settings
enableSVGUVIsland: bool Enables the exporting of an SVG version of the UV Island map.
Inherited Members
Metalness Baker Map Settings
Inherited Members
Wireframe Baker Map Settings
Inherited Members
Baker Object
bakePSD()
Bakes with the current configuration, into a single layered PSD file.
importModel(path: str)
Imports a model file via the Baker's quick loader. path: string path to model file
addGroup(name: str)
Adds a BakeGroup to the BakerObject. name: The Name of the BakeGroup returns: The BakeGroup
savePreset(name: str)
saves the current configuration of the BakerObject. name: The Name of the Preset
loadPreset(name: str)
loads a given preset for the BakerObject. name: The Name of the Preset
getTextureSetCount() -> int
Gets the number of texture sets in the current BakerObject. returns: integer number of texture sets.
getTextureSetName(i: int) -> str
Gets the name of a given texture set. i: The index of the Texture Set you want returns: the string name of the texture set.
getTextureSetEnabled(i: int) -> bool
Gets the enabled status of a texture set. i: The index of the texture set you want returns: True if the texture set is enabled False if not.
setTextureSetEnabled(i: int, enabled: bool)
Sets whether or the texture set specified is enabled or disabled. i: The index of the Texture Set you want enabled: if the texture set should bake or not.
getTextureSetWidth(i: int) -> int
Gets the width of a texture set. i: The index of the texture set you want returns: Width of texture set.
setTextureSetWidth(i: int, width: int)
Sets the width of a given texture set. i: The index of the Texture Set you want width: your desired width of the texture set.
getTextureSetHeight(i: int) -> int
Gets the height of a texture set. i: The index of the texture set you want returns: Height of the texture set.
setTextureSetHeight(i: int, height: int)
Sets the height of a given texture set. i: The index of the Texture Set you want height: your desired height of the texture set.
getUDIMTileCount() -> int
Gets the number of UDIM tiles in the current Baker. returns: integer number of UDIM tiles
getUDIMTileName(i: int) -> str
Gets the name of a given UDIM tile. i: The index of the UDIM tile you want returns: the string name of the UDIM tile.
getUDIMTileEnabled(i: int) -> bool
Gets the enabled status of a UDIM tile. i: The index of the UDIM tile you want returns: True if the UDIM tile is enabled False if not.
setUDIMTileEnabled(i: int, enabled: bool)
Sets whether or the UDIM tile specified is enabled or disabled. i: The index of the UDIM tile you want enabled: if the UDIM tile should bake or not.
getUDIMTileWidth(i: int) -> int
Gets the width of a UDIM tile. i: The index of the UDIM tile you want returns: Width of UDIM tile.
setUDIMTileWidth(i: int, width: int)
Sets the width of a given UDIM tile. i: The index of the UDIM tile you want width: your desired width of the UDIM tile.
getUDIMTileHeight(i: int) -> int
Gets the height of a UDIM tile. i: The index of the UDIM tile you want returns: Height of the UDIM tile.
setUDIMTileHeight(i: int, height: int)
Sets the height of a given UDIM tile. i: The index of the UDIM tile you want height: your desired height of the UDIM tile.
getAllMaps() -> List[BakerMap]
Gets a list of all baker maps. returns: A list of all baker map handles
getMap(name: str) -> BakerMap
Gets a baker map handle. name: The Name of the Map you want returns: A handle to the Baker Output Map
applyPreviewMaterial()
Applys a preview material on all baker low poly mesh objects.
linkTextureProject(proj: TextureProjectObject) -> None
Links a texture project to this baker. The textureset parameter may be an empty string if the bake project doesn't use texture sets.
outputBits: int Bit depth of the output format; must be one of the following values: 8, 16, 32.
edgePadding: str Edge padding amount. Must be one of the following values: 'None', 'Moderate', 'Extreme'.
"outputSoften": float Determines how much the baked result will be softened; must be between 0.0 and 1.0.
"ignoreTransforms": bool Determines whether transforms on meshes will be used when baking.
"smoothCage": bool Determines whether the cage mesh will use smooth vertex normals, ignoring any hard edges.
"ignoreBackfaces": bool Determines whether back sides of faces will be ignored when baking.
"fixMirroredTangents": bool Fixes mirrored tangents, use this setting if you're seeing artifacts in your normal map bakes from your tangent space.
Inherited Members
Baker Target Object
"excludeWhenIgnoringGroups": bool Whether this target will be used when ignoring groups in cone based ray passes (AO, Bent Normals).
Inherited Members
Material
getSubroutine(subroutine: str) -> MaterialSubroutine
Returns the subroutine in a given slot, specified by string name in the UI. See also setSubroutine().
setSubroutine(subroutine: str, shader: str)
Assigns a shader type to a given subroutine. Both parameters are string names. 'shader' must be a valid shader name, and 'subroutine' must be one of: 'subdivision', 'displacement', 'surface', 'microsurface', 'albedo', 'diffusion', 'reflectivity', 'reflection', 'clearcoat reflection', 'clearcoat microsurface', 'clearcoat reflectivity', 'occlusion', 'emissive', 'transparency', 'texture'.
getGroup() -> str
Returns the string name of the group the material is assigned to or an empty string, if the material is in no group.
setGroup(name: str)
Assigns the material to a new or existing group. Use '' to assign the material to no group.
duplicate(name: str = '') -> Material
Duplicates the Material, optionally assigning it a name. If no name is specified, one will be automatically generated. Returns the new material.
assign(object: SceneObject, includeChildren: bool = True)
Assigns the material to a scene object. If 'includeChildren' is true, this material will also be applied to the children of the object.
getAssignedObjects() -> List[SceneObject]
Returns a list of all scene objects to which this material is assigned.
renderPreview(width: int, height: int)
Renders the material, applied to a sample mesh, to a preview image. Returns an Image instance.
setKeyframe(lerp: str)
Sets a keyframe on this object with the assigned interpolation function ("linear", "step", "spline", or "splineBreak"). This setting defaults to editor's default.
name: Material The name of the Material. Please note that Materials must have unique names in Toolbag scenes.
displacement: MaterialSubroutine The MaterialSubroutine currently assigned to the Displacement Slot
microsurface: MaterialSubroutine The MaterialSubroutine currently assigned to the Microsurface Slot
diffusion: MaterialSubroutine The MaterialSubroutine currently assigned to the Diffusion Slot
transmission: MaterialSubroutine The MaterialSubroutine currently assigned to the Transmission Slot
reflectivity: MaterialSubroutine The MaterialSubroutine currently assigned to the Reflectivity Slot
reflection: MaterialSubroutine The MaterialSubroutine currently assigned to the Reflection Slot
clearCoatReflection: MaterialSubroutine The MaterialSubroutine currently assigned to the Clear Coat Reflection Slot
clearCoatMicrosurface: MaterialSubroutine The MaterialSubroutine currently assigned to the Clear Coat Microsurface Slot
clearcoatReflectivity: MaterialSubroutine The MaterialSubroutine currently assigned to the Clear Coat Reflectivity Slot
occlusion: MaterialSubroutine The MaterialSubroutine currently assigned to the Occlusion Slot
emission: MaterialSubroutine The MaterialSubroutine currently assigned to the Emission Slot
transparency: MaterialSubroutine The MaterialSubroutine currently assigned to the Transparency Slot
Material Subroutine
getFieldNames() -> List[str]
Returns a list of all field names of the subroutine.
getField(name: str) -> Union[None, int, float, str, Texture]
Returns the value of a field.
GPU Texture
renderPreview(width: int, height: int, name = '')
Renders a preview of the texture, at the given resolution, with an optional name specifying the numberof frames for use in brushes / animations (eg. myname_4x.mpic). Returns an Image instance.
path: str The file path of the texture. Note: You cannot set the path of a Texture, only get it.
useFiltering: bool Determines whether the texture is filtered bilinearly (smooth) or by nearest neighbor (pixelated).
A CPU-side image. Used for image loading and saving, and pixel manipulations. See Texture for material and rendering uses.
getPixelFormat() -> str
Returns the current pixel format, or -1 if the image is invalid. See convertPixelFormat() for a list of format values.
convertPixelFormat(format: str)
Converts the image to the specified format. Some formats of interest: BGRA8: "PIXEL_FORMAT_BGRA8", RGBA16: "PIXEL_FORMAT_RGBA16", RGBA_FLOAT16: "PIXEL_FORMAT_RGBA_FLOAT16", RGBA_FLOAT32: "PIXEL_FORMAT_RGBA_FLOAT32", RGB10_A2: "PIXEL_FORMAT_RGB10_A2", R8: "PIXEL_FORMAT_R8", R16: "PIXEL_FORMAT_R16", RG8: "PIXEL_FORMAT_RG8", RG16: "PIXEL_FORMAT_RG16", R_FLOAT16: "PIXEL_FORMAT_R_FLOAT16", RG_FLOAT16: "PIXEL_FORMAT_RG_FLOAT16", R_FLOAT32: "PIXEL_FORMAT_R_FLOAT32", RG_FLOAT32: "PIXEL_FORMAT_RG_FLOAT32", R11G11B10_FLOAT: "PIXEL_FORMAT_R11G11B10_FLOAT"
compressBCn(mode: int)
Encodes the image in a GPU-friendly block-compressed format. Currently supported modes are 4, 5, 6, and 7. Source images must be in an 8bit-per-channel color mode (such as BGRA8 or R8), except for mode 6, which requires a floating point color format. BC4 (mode=4) encodes grayscale in 4 bits per pixel. BC5 (mode=5) encodes two color channels in 8 bits per pixel. This is often useful for normal maps. BC6H(mode=6) encodes HDR RGB color in 8 bits per pixel. This is useful for high dynamic range images, such as backgrounds or panoramas. BC7 (mode=7) encodes RGB color and an alpha channel in 8 bits per pixel.
generateMipmaps(sRGB: bool = False)
Generates mipmaps for the image. Can optionally account for sRGB color space.
linearTosRGB()
Converts the color space of this image from Linear to sRGB.
sRGBToLinear()
Converts the color space of this image from sRGB to Linear.
flipVertical()
Vertically flips an image. Some pixel formats, such as BC7, may not be flippable.
writeOut(path: str)
Writes the image contents to a file on disk. The file format is determined by the file extension.
createTexture(sRGB: bool = True)
Creates a Texture object from the image contents, ready for GPU use.
External Object
Animation Timeline
setTime(time: float)
Sets the current animation time, in seconds. This time may be rounded to the nearest frame.
getFrameRate() -> int
Returns the scene's animation frame rate, in frames per second.
resample(frameRate: int)
Alters the animation timeline's frame rate, in frames per second. This will resample existing keyframes to fit the new frame rate, and alter the appropriate frame counts.
currentFrame: int Current animation frame. This value must be within the valid range of 0 to totalFrames.
totalFrames: int Total frame count for the animation. This value must be greater than zero.
selectionStart: int The first frame of the selected time range. Must be less than totalFrames and greater than zero.
The Marmoset Library. Provides access to a library of thousands of materials, textures, smart materials, skies, and much more. Customize your library to suit your needs.
addAsset(desc: Dict)
Add an asset to your current library distribution. You must supply a dictionary with the following keys: { name: str, author: str, link: str, tags: str, type: str, path: str }.Tags are comma separated, and type must be one of the following:'Materials', 'Skies', 'Textures', 'Smart Materials', 'Smart Masks', 'Brushes'.
The preferences.
"unsavedChangesPrompts": type If enabled, you will be prompted to save any unsaved work when closing a scene.
"browseForMissingFiles": type Displays prompts to locate missing external files, such as textures and animations, during scene loads.
"browseForMissingMeshes": type Displays prompts to locate missing external meshes during scene loads.
"autoTextureReload": type Changed textures will be automatically reloaded when Toolbag regains focus.
"updateCheck": type Determines whether or not you will be prompted to install new updates. If enabled, Toolbag will check for new versions every time it opens.
"updateCheckAllowBeta": type Toolbag will check for and update to the latest beta builds when they are available. Enable this if you want to test out the latest features under development. Take care; beta builds may have bugs. Restart Toolbag for this setting to take effect.
"displayTooltips": type Disabling this would remove these helpful little boxes. Pro-moves only.
"tabletCompatibilityMode": type Enables enhanced tablet compatibility. This setting can sometimes solve issues with tablet input, and disables some mouse features.
"defaultWatermark": type Determines whether or not the "Rendered in Marmoset Toolbag" watermark is enabled when creating a new scene.
defaultTangentMethod: str Sets the tangent space that will be applied to meshes when imported. Choose the application that you most frequently use to bake normal maps. Allowed values are 'Marmoset', 'Mikk', 'Maya' and '3DS Max'.
defaultTangentHandedness: str Newly created bake and texture projects will default to this tangent space handedness. Allowed values are 'Right-Handed' and 'Left-Handed'.
defaultSceneUnit: str Determines which unit system to use for new scenes. This setting should match the unit setting in your 3D modeling application. Allowed values are 'mm', 'cm', 'm', 'km', 'in', 'ft', 'yd' and 'mi'.
rayTraceBackend: str Selects a ray tracing engine for rendering and baking. "Accelerated" attempts to provide the best performance and makes use of new GPU features such as NVIDIA's RTX. "Generic" works on all GPUs but is not as fast. Changing this setting requires an app restart. Allowed values are 'Generic' and 'DXR' (if supported).
"importModelsAsReferences": type Model files will import as file references instead of simply grouped objects. This allows for quick in-place model reloading. Note that disabling this feature will prevent animated meshes from being imported.
"importAbcWithMaterials": type Model files will import along with any available material definitions, including textures and other parameters where available.
"importFbxWithMaterials": type Model files will import along with any available material definitions, including textures and other parameters where available.
"importObjWithMaterials": type Model files will import along with any available material definitions, including textures and other parameters where available.
"importPlyWithMaterials": type Model files will import along with any available material definitions, including textures and other parameters where available.
"importStlWithMaterials": type Model files will import along with any available material definitions, including textures and other parameters where available.
"importUsdWithMaterials": type Model files will import along with any available material definitions, including textures and other parameters where available.
"import8mlWithMaterials": type Model files will import along with any available material definitions, including textures and other parameters where available.
"autoModelReload": type Model files will be automatically reloaded when Toolbag regains focus. This only applies to external model references; models not imported as references will not reload.
"outputDirectory": type Sets the default directory where rendered images are saved when creating a new scene.
sceneStartPref: str Selects whether, on startup, Toolbag will open a blank scene, the last opened scene, or the template scene. Allowed values are 'Empty', 'Last Opened' and 'Template'.
newScenePref: str Determines whether new scenes are empty or created from the template scene. Allowed values are 'Empty' and 'Template'.
"rememberDimensions": type If enabled, the Toolbag window will load with the same position and size as it was when last closed.
"undoVerificationCheck": type Runs an extra integrity check on the scene when an action is undone or redone. Also displays diagnostic data in the performance window.
tabletBackend: str The default backend when using a digitizer, defaults to the latest available to your operating system. Allowed values are 'Windows Pointer' and 'WinTab'.
"libraryAutoUpdate": type Automatically update assets when a new version is available.
"autoSaves": type Automatically save a backup of your scene to the autosave folder at the specified time interval.
"autoSaveMaxCount": type Determines the maximum number of autosaves to keep for a given scene. Older autosaves will be deleted when this value is exceeded. Using a value of 0 will retain all files.
autoSaveFolderSize: float Maximum amount of space the autosave folder can use. Older autosaves will be deleted when total size of the folder exceeds this value.
User Interface Control
UIWindow
addReturn()
Adds a line return to the window, placing all following elements on the next line.
addSpace(width: float)
Adds a space of fixed width to the window, placing all following elements after it.
addStretchSpace()
Adds a stretchable space to the Window, placing all following elements after it at the end of the current line.
getElements() -> List[UIControl]
Returns a list of all contained controls.
UIScrollBox
containedControl: UIWindow The control contained by the scrollbox object, to which other elements may be added.
UIDrawer
UIColorPicker
UIListBox
UIButton
UI Base Text Field. Abstract class, do not use in your plugins.
UI text field, useful for entering in text data.
Inherited Members
UI text field that exclusively works with int values.
Inherited Members
UI text field that exclusively works with floating point values.
Inherited Members
UI Base Slider. Abstract class, do not use in your plugins.
UI slider that exclusively works with float values.
Inherited Members
UI slider that exclusively works with int values.
Inherited Members
UICheckBox
UILabel
A collection of callable methods which are run during various events.
Set these methods via the mset.callbacks
global instance.
onSceneChanged: Callable[[], None] This Callback will run when the scene is changed (e.g. by moving an object).
onRegainFocus: Callable[[], None] This Callback will run when the application regains focus. This can be useful for plugins that need to refresh files or make other checks when the user switches to Toolbag.
onPeriodicUpdate: Callable[[], None] This Callback will run periodically: a few times per second. This can be useful for plugins that need to refresh external files or make frequent polling checks. Since this callback is run frequently, care should be taken to keep the average execution time low, or poor performance could result.
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.
Inherited Members
A texture project layer. Used to configure a given layer.