Module mset

Toolbag Build 4062

Marmoset Toolbag's Python bindings.

Global variables

var callbacks

A global instance of Callbacks, containing callable methods run during certain events.

Functions

def bakeAll()

Bakes all objects in the scene.

def clearTestLog()

Marmoset internal use for testing.

def compareImages(imageLhs: Image, imageRhs: Image, metric: str)

Compare the images using a specified metric.

def compressFile(filePath: str, archiveOutputPath: str)

Compresses a file on disk into a gzipped tarball archive (tgz).

def compressFolder(folderPath: str, archiveOutputPath: str)

Compresses a folder, including all subdirectories, into a gzipped tarball archive (tgz).

def err(msg: str)

Prints text to the application log, as an error. No return will be appended.

def 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).

def 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).

def 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.

def 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.

def 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).

def 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.

def fail(msg: str)

Generates a failure message to an automated testing log. Mainly for internal use.

def findMaterial(name: str) ‑> Material

Finds a Material by string name.

def findObject(searchString: str)

Finds an Object in the scene by string name.

def frameObject(object: SceneObject)

Centers and frames the given object in the current camera.

def frameScene()

Centers and frames the entire scene in the current camera.

def 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.

def generateDifferenceImage(imageLhs: Image, imageRhs: Image, fuzziness: float)

Generate a difference image highlighting the different pixel.

def getAllMaterials() ‑> List[Material]

Returns all materials as a list.

def getAllObjects() ‑> List[SceneObject]

Returns all scene Objects as a list.

def getGraphicsAdapterName() ‑> str

Returns the name of the graphics device in use.

def getLibrary() ‑> Library

Returns your current installation's library. Used to configure your library with custom assets.

def getPluginPath() ‑> str

Returns the current plugin path (eg. "C:/Program Files/Marmoset Toolbag 4/data/plugins/Example.py").

def getPreferences() ‑> Preferences

Returns your preferences. Used to configure yourToolbag instalation.

def getSceneBounds() ‑> List[List[float]]

Gets the bounds of the entire scene. Formatted as [min_xyz, max_xyz]

def getScenePath() ‑> str

Returns the path of the current scene file.

def getSceneUnitScale() ‑> float

Returns the current unit size of the scene, in meters. For example, a scene working in centimeters will return 0.01.

def getSelectedMaterial() ‑> Material

Returns the currently selected Material.

def getSelectedMaterialGroup() ‑> List[Material]

Returns the currently selected Material group as an array of materials.

def getSelectedObject() ‑> SceneObject

Returns the currently selected Object. If multiple objects are selected this function will return the first selection. See also 'getSelectedObjects'.

def getSelectedObjects() ‑> List[SceneObject]

Returns all currently selected scene Objects as a list.

def getStoreItem(key: str) ‑> Any

Get data in a shared persistent store that is accessable across plugins.

def getTimeline() ‑> Timeline

Returns the current scene's timeline, for animation control.

def getToolbagVersion() ‑> int

Returns the current toolbag version, as an integer (e.g. 4062).

def getTraceBackendType() ‑> str

Returns the type of the trace backend in use.

def groupObjects(list: List[SceneObject])

Groups an array of SceneObjects.

def 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.

def importModel(filePath: str) ‑> SceneObject

Imports the specified model into the existing scene, using the scene's current import settings. Returns the imported object.

def loadScene(filePath: str, downloadMissingLibraryAssets: bool = False)

Loads a Marmoset Toolbag scene file. Unsaved changes to any currently open scenes are lost.

def log(msg: str)

Prints text to the application log, similar to print(). No return will be appended.

def newScene()

Creates a new empty scene. Any unsaved changes in the current scene will be lost.

def quit()

Quits the application. Any unsaved changes will be lost.

def readAndExportStamp(inputPath: str, outputPath: str)

Marmoset internal use for stamp brush creation

def 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 mset.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.

def 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().

def 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.

def 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.

def setCamera(camera: CameraObject)

Sets the current active camera for viewport and screenshot rendering.

def setSelectedObjects(objs: List[SceneObject]) ‑> bool

Select the provided scene objects. Returns true if successful. See also 'getSelectedObjects'.

def setStoreItem(key: str, val: Any)

Store data in a shared persistent store that is accessable across plugins.

def 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.

def 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.

def 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.

def 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.

def 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.

def shutdownPlugin()

Halts execution and shuts down the currently running plugin.

Classes

class AOBakerMap

Bent Normal Baker Map Settings

Ancestors

Instance variables

var cosineWeight

Weights from -1 to 1, increasing values result in more 'cavity' shadows.

var dither

Determines whether this map output will be dithered.

var floor

The amount of floor occlusion.

var floorOcclusion

Determines whether an artificial floor plane will be used for ambient occlusion baking.

var ignoreGroups

Determines whether bake groups will be ignored when baking ambient occlusion.

var rayCount

The number of rays used for AO baking.

var searchDistance

The maximum distance rays can go. 0 defaults to infinity.

var twoSided

Determines whether the ambient occlusion baking will also use back faces.

Inherited members

class BackdropObject

Backdrop Object

Ancestors

Instance variables

var alpha

The transparency of the backdrop image.

var path

The file path to the backdrop image.

var useAlpha

Specifies whether or not to use the image's alpha channel.

Inherited members

class BakerMap

Baker Map Settings

Subclasses

Instance variables

var enabled

Whether or not this Baker Map should render when baking.

var suffix

The output suffix of the current Baker Map.

Methods

def resetSuffix()

Resets the current map suffix to its default.

class BakerObject

Baker Object

Ancestors

Instance variables

var edgePadding

Edge padding amount. Must be one of the following values: 'None', 'Moderate', 'Extreme'.

var edgePaddingSize

Edge padding size in pixels.

var fixMirroredTangents

Fixes mirrored tangents, use this setting if you're seeing artifacts in your normal map bakes from your tangent space.

var ignoreBackfaces

Determines whether back sides of faces will be ignored when baking.

var ignoreTransforms

Determines whether transforms on meshes will be used when baking.

var multipleTextureSets

Enables the use of Texture Sets when baking.

var outputBits

Bit depth of the output format; must be one of the following values: 8, 16, 32.

var outputHeight

The height in pixels of the baked textures.

var outputPath

The file path where the baked textures will be stored.

var outputSamples

Sample count of the bake output; must be one of the following values: 1, 4, 16, 64.

var outputSinglePsd

Determines whether the baked maps will be stored inside a single PSD file, or multiple files.

var outputSoften

Determines how much the baked result will be softened; must be between 0.0 and 1.0.

var outputWidth

The width in pixels of the baked textures.

var smoothCage

Determines whether the cage mesh will use smooth vertex normals, ignoring any hard edges.

var useHiddenMeshes

Determines whether hidden meshes will be used when baking.

Methods

def addGroup(name: str)

Adds a BakeGroup to the BakerObject. name: The Name of the BakeGroup returns: The BakeGroup

def applyPreviewMaterial()

Applys a preview material on all baker low poly mesh objects.

def bake()

Bakes with the current configuration.

def getAllMaps() ‑> List[BakerMap]

Gets a list of all baker maps. returns: A list of all baker map handles

def 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

def getTextureSetCount() ‑> int

Gets the number of texture sets in the current BakerObject. returns: integer number of texture sets.

def 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.

def 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.

def 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.

def 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.

def importModel(path: str)

Imports a model file via the Baker's quick loader. path: string path to model file

def linkTextureProject(textureset: str, proj: TextureProjectObject)

Links a texture project to this baker. The textureset parameter may be an empty string if the bake project doesn't use texture sets.

def loadPreset(name: str)

loads a given preset for the BakerObject. name: The Name of the Preset

def savePreset(name: str)

saves the current configuration of the BakerObject. name: The Name of the Preset

def 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.

def 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.

def 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.

Inherited members

class BakerTargetObject

Baker Target Object

Ancestors

Instance variables

var cageAlpha

The opacity of the cage.

var excludeWhenIgnoringGroups

Whether this target will be used when ignoring groups in cone based ray passes (AO, Bent Normals).

var maxOffset

The maximum offset of the cage mask.

var minOffset

The minimum offset of the cage mask.

Methods

def estimateOffset()

Estimates the Cage Offsets.

Inherited members

class BentNormalBakerMap

Bent Normal Baker Map Settings

Ancestors

Instance variables

var dither

Determines whether this map output will be dithered.

var flipX

Determines whether the normal map's X channel will be flipped.

var flipY

Determines whether the normal map's Y channel will be flipped.

var flipZ

Determines whether the normal map's Z channel will be flipped.

var ignoreGroups

Determines whether bake groups will be ignored when baking bent normals.

var rayCount

The number of rays used for Bent Normal baking.

var searchDistance

The maximum distance rays can go. 0 defaults to infinity.

Inherited members

class Callbacks

A collection of callable methods which are run during various events. Set these methods via the mset.callbacks global instance.

Instance variables

var onPeriodicUpdate

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.

var onRegainFocus

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.

var onSceneChanged

This Callback will run when the scene is changed (e.g. by moving an object).

var onSceneLoaded

This Callback will run when a new scene is loaded.

var onShutdownPlugin

This Callback will run immediately before the plugin is shut down.

class CameraLens

Camera Lens Settings

Instance variables

var distortionBarrel

Strength of the barrel distortion effect.

var distortionCABlue

Strength of the chromatic aberration in the blue component.

var distortionCAGreen

Strength of the chromatic aberration in the green component.

var distortionCARed

Strength of the chromatic aberration in the red component.

var distortionChromaticAberration

Strength of the chromatic aberration effect.

var dofAnamorphicRatio

Anamorphic lens ratio for horizontal distortion of depth of field.

var dofAperture

Path of the aperture shape texture file.

var dofApertureRotation

Rotation of the aperture shape texture.

var dofEnabled

Enables the depth of field effect. This is a legacy variable, consider using 'dofMode' instead.

var dofFocusDistance

Focal distance of the depth of field.

var dofMode

Specifies the depth of field mode: 0 = off, 1 = post effect, 2 = ray traced.

var dofStop

F-stop value for controlling depth of field. Smaller values are blurrier.

var lensFlareCoating

Adds coating to the entire lens system, causing lens flare more apparent.

var lensFlareSize

Sets the size of the individual flares or "ghosts".

var lensFlareStrength

Sets the intensity of the lens flare effect.

var motionBlurEnable

Toggles motion blur effect for final render animations and stills.

var motionBlurEnableLoopingAnimation

Toggles last frame to wrap back to the first frame for future frame accumulation.

var motionBlurSamples

Control the quality of the motion blur/how smooth the blur is.

var motionBlurShutterSpeed

Determine the intensity or length of the blur. Usually the shutter speed on a camera is represented in fractions of a second, ie: 1/60, 1/120, 1/250, etc.

var safeFrameEnabled

Displays the safe frame in the viewport.

var safeFrameOpacity

Opacity of the safe frame display.

class CameraLimits

Camera Limits Settings

Instance variables

var farLimit

The far orbit limit distance.

var farLimitEnabled

Enables the far orbit distance limit.

var nearLimit

The near orbit limit distance.

var nearLimitEnabled

Enables the near orbit distance limit.

var panLimit

Limits the panning to either the Y-axis or completly (valid values are: 'Off', 'YAxis', 'Locked').

var pitchLimitEnabled

Enables the pitch angle limit.

var pitchLimitMax

The maximum pitch angle, in degrees.

var pitchLimitMin

The minimum pitch angle, in degrees.

var useLimitsInViewport

Enables use of camera motion limits in the viewport.

var yawLimitEnabled

Enables the yaw angle limit.

var yawLimitMax

The maximum yaw limit angle, in degrees.

var yawLimitMin

The minimum yaw limit angle, in degrees.

var yawLimitOffset

The offset of the yaw limit angle, in degrees.

class CameraObject

Camera Object

Ancestors

Instance variables

var focalLength

The focal length of the camera, in mm.

var fov

The vertical field of view of the camera, in degrees.

var lens

The camera lens settings.

var limits

The camera limits settings.

var mode

The mode of this camera, can be 'perspective' or 'orthographic'.

var nearPlaneScale

A scalar for adjusting the automatic near clipping plane. Lower values will bring the clipping closer to the camera, but can result in unstable depth for the rest of the scene.

var orthoScale

The scale of this camera in orthographic mode. Measured in scene units.

var postEffect

The camera post effect settings.

Methods

def loadPostEffect(path: str)

Load a camera post effect from a file.

def savePostEffect(path: str)

Save a camera post effect to a file.

Inherited members

class CameraPostEffect

Camera Post Effect

Instance variables

var bloomBrightness

Brightness multiplier for the bloom effect.

var bloomSize

Size scalar for the bloom effect.

var clarity

Adjusts the intensity of the clarity. Range: [-1, 1]

var contrast

Contrast multiplier.

var contrastCenter

A value above which color values are brightened, and below which color values are darkened to achive the contrast effect.

var exposure

Exposure multiplier.

var filmGrainDirtDensity

Controls the amount scratches and stains visible in each frame.

var filmGrainDirtIntensity

Sets the overall opacity of the scratches and stains.

var filmGrainDirtSize

Controls the size of scratches and stains.

var filmGrainIntensity

Sets the strength of the grain effect.

var filmGrainMode

Sets the style of grain. (allowed values are: 'Off', 'Film', 'Digital')

var filmGrainPreview

Toggles randomized preview of the grain effect.

var filmGrainTilingMode

Sets the texture or coarseness of the grain effect. (allowed values are: 'Fine', 'Medium', 'Coarse')

var highlights

Adjusts the intensity of the highlights. Range: [-1, 1]

var midtones

Adjusts the intensity of the midtones. Range: [-1, 1]

var saturation

Adjusts the intensity of color saturation (default is 1.0).

var shadows

Adjusts the intensity of the shadows. Range: [-1, 1]

var sharpen

Strength of the edge sharpening effect.

var sharpenLimit

A numerical limit on the stength of the edge sharpening effect.

var toneMappingMode

Tone mapping mode (allowed values are: 'linear', 'reinhard', 'hejl', 'aces')

var vignetteSoftness

Softness scalar for the vignette effect.

var vignetteStrength

Strength multiplier for the vignette effect.

class CurvatureBakerMap

Curvature Baker Map Settings

Ancestors

Instance variables

var dither

Determines whether this map output will be dithered.

var strength

Determines the strength of the curvature output.

Inherited members

class ExternalObject

External Object

Ancestors

Instance variables

var path

Path to a model file. If this path is altered, a new model will be loaded in place of the old one.

Inherited members

class FogObject

Fog Object

Ancestors

Instance variables

var color

The color of the fog effect, as a list of 3 floats for RGB color.

var dispersion

A scalar specifying the dispersion, or light scatter, property of the fog effect.

var distance

The distance of the fog effect.

var lightIllum

A scalar specifying the degree to which lights affect the fog.

var opacity

The maximum opacity of the fog effect.

var skyIllum

A scalar specifying the degree to which sky illumination affects the fog.

var type

The falloff type of the fog effect. Must be one of the following values: 'Linear' 'Distance Squared' 'Exponential'.

Inherited members

class GradientData

Gradient Data, used with Texture Project layers to control various effects.

Methods

def addColor(color: List[float], position: float, weight: float)

Adds a color to this gradient.

def getColor(index: int) ‑> Tuple[List[float], float]

Gets a color of this gradient.

def getColorCount() ‑> int

Gets the number of colors this gradient has.

def reset()

Resets this gradient to a default configuration (black to white).

def setColor(index: int, color: List[float], weight: float)

Sets a given color of this gradient.

class HeightBakerMap

Height Baker Map Settings

Ancestors

Instance variables

var dither

Determines whether this map output will be dithered.

var innerDistance

Inner height map distance from the low poly mesh, in world units. This value maps to black in the height map.

var outerDistance

Outer height map distance from the low poly mesh, in world units. This value maps to white in the height map.

Inherited members

class Image

A CPU-side image. Used for image loading and saving, and pixel manipulations. See mset.Texture for material and rendering uses.

Methods

def 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.

def convertPixelFormat(format: int)

Converts the image to the specified format. Some formats of interest: BGRA8: 0, RGBA16: 1, RGBA_FLOAT16: 2, RGBA_FLOAT32: 3, RGB10_A2: 5, R8: 13, R16: 14, RG8: 15, RG16: 16, R_FLOAT16: 17, RG_FLOAT16: 18, R_FLOAT32: 19, RG_FLOAT32: 20, R11G11B10_FLOAT: 21

def createTexture(sRGB: bool = True)

Creates a mset.Texture object from the image contents, ready for GPU use.

def duplicate()

Creates a duplicate of this image.

def flipVertical()

Vertically flips an image. Some pixel formats, such as BC7, may not be flippable.

def generateMipmaps(sRGB: bool = False)

Generates mipmaps for the image. Can optionally account for sRGB color space.

def getPixelFormat() ‑> str

Returns the current pixel format, or -1 if the image is invalid. See convertPixelFormat() for a list of format values.

def linearTosRGB()

Converts the color space of this image from Linear to sRGB.

def sRGBToLinear()

Converts the color space of this image from sRGB to Linear.

def writeOut(path: str)

Writes the image contents to a file on disk. The file format is determined by the file extension.

class LevelData

Level Data, used with Texture Project layers to control various effects.

Methods

def getHandle(color: str) ‑> List[float]

Gets the settings for this level.

def reset()

Resets this level to a default configuration.

def setLevel(color: str, black: float, gamma: float, white: float, outputBlack: float, outputWhite: float)

Configures this level.

class Library

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.

Methods

def 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'.

def removeAsset(name: str)

Remove an asset from your current library distribution.

def resetContents()

Resets the contents of the library.

def resetUserContents()

Resets the contents of the user library.

class LightObject

Light Object

Ancestors

Instance variables

var brightness

The brightness of the light.

var castLensFlare

Determines whether or not this light casts lens flare.

var castShadows

Enables the casting of shadows by the light.

var color

The color of the light.

var gelPath

Path of image to mask light shape.

var gelTile

Tiling scalar for the gel texture.

var lengthX

The length along the X axis of the light source.

var lengthY

The length along the Y axis of the light source.

var lensFlareStrength

Sets the lens flare strength of the light.

var lightType

The type of the light (valid values are 'directional', 'spot', 'omni'

var spotAngle

The spot angle, in degrees, for use by spot lights only.

var spotSharpness

The sharpness of the spotlight shape, for use by spot lights only.

var spotVignette

The degree of spotlight vignette, for use by spot lights only.

var temperature

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).

var useTemperature

Enables the use of color temperature on this light source.

var visibleShape

Makes the light source shape visible in final renders.

var width

The radius of the light source.

Inherited members

class Material

Material

Instance variables

var albedo

The MaterialSubroutine currently assigned to the Albedo Slot

var clearCoatMicrosurface

The MaterialSubroutine currently assigned to the Clear Coat Microsurface Slot

var clearCoatReflection

The MaterialSubroutine currently assigned to the Clear Coat Reflection Slot

var clearcoatReflectivity

The MaterialSubroutine currently assigned to the Clear Coat Reflectivity Slot

var diffusion

The MaterialSubroutine currently assigned to the Diffusion Slot

var displacement

The MaterialSubroutine currently assigned to the Displacement Slot

var emission

The MaterialSubroutine currently assigned to the Emission Slot

var extra

The MaterialSubroutine currently assigned to the Extra Slot

var microsurface

The MaterialSubroutine currently assigned to the Microsurface Slot

var name

The name of the Material. Please note that Materials must have unique names in Toolbag scenes.

var occlusion

The MaterialSubroutine currently assigned to the Occlusion Slot

var reflection

The MaterialSubroutine currently assigned to the Reflection Slot

var reflectivity

The MaterialSubroutine currently assigned to the Reflectivity Slot

var surface

The MaterialSubroutine currently assigned to the Surface Slot

var texture

The MaterialSubroutine used for texture parameters

var transmission

The MaterialSubroutine currently assigned to the Transmission Slot

var transparency

The MaterialSubroutine currently assigned to the Transparency Slot

Methods

def 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.

def destroy()

Destroys the Material and removes it from the scene.

def 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.

def exportFile(path: str)

Exports this material to the path specified.

def getAssignedObjects() ‑> List[SceneObject]

Returns a list of all scene objects to which this material is assigned.

def getCustomShader() ‑> str

Returns the name of the custom shader file, or an empty string if there is none.

def 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.

def getSubroutine(subroutine: str) ‑> MaterialSubroutine

Returns the subroutine in a given slot, specified by string name in the UI. See also setSubroutine().

def renderPreview(width: int, height: int)

Renders the material, applied to a sample mesh, to a preview image. Returns an mset.Image instance.

def setCustomShader(shaderFile: str)

Assigns a custom shader to the material. The supplied file name must refer to a .frag or .vert file in data/shader/mat/custom. Passing an empty string will unset any custom shader present.

def setGroup(name: str)

Assigns the material to a new or existing group. Use '' to assign the material to no group.

def 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.

def 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', 'extra', 'texture'.

class MaterialSubroutine

Material Subroutine

Instance variables

var name

The name of the current shader attached to this subroutine.

Methods

def getField(name: str) ‑> Union[NoneType, int, float, str, Texture]

Returns the value of a field.

def getFieldNames() ‑> List[str]

Returns a list of all field names of the subroutine.

def setField(name: str, value: Union[int, float, str, Texture])

Sets the value of a field. Texture fields may be set by either passing a string path or an mset.Texture instance.

class MaterialSurfaceMap

A Material Surface Map, with customizable parameters.

Instance variables

var color

The base color of this map.

var contrast

The level of contrast for this map.

var invert

Determines if contrast/color have been flipped.

var mode

The mode of this map, can be either 'texture' or 'material'

var texture

The texture that corresponds to this map, or None if none exists.

Methods

def reset()

Resets this map with the default base color/contrst.

class Mesh

Mesh

Instance variables

var bitangents

Mesh bitangents, as a list of float groups of 3 ( e.g. [x,y,z, x,y,z] )

var colors

Mesh colors, as a list of float groups of 4 ( e.g. [r,g,b,a, r,g,b,a] )

var normals

Mesh normals, as a list of float groups of 3 ( e.g. [x,y,z, x,y,z] )

var polygons

Mesh polygon groups, as a list of int groups of 2, start and count ( e.g. [0,2, 1,2] )

var secondaryUVs

Mesh secondary texture coordinates, as a list of float groups of 2 ( e.g. [u,v, u,v] )

var tangents

Mesh tangents, as a list of float groups of 3 ( e.g. [x,y,z, x,y,z] )

var triangles

Mesh triangle indices, as a list of int groups of 3 ( e.g. [0,1,2, 1,3,2] )

var uvs

Mesh texture coordinates as a list of float groups of 2 ( e.g. [u,v, u,v] )

var vertices

Mesh vertex positions, as a list of float groups of 3 ( e.g. [x,y,z, x,y,z] )

class MeshObject

Mesh Object

Ancestors

Instance variables

var castShadows

Enables casting of shadows from the mesh.

var cullBackFaces

Enables the culling of back faces during render.

var fixMirroredTangents

Fix tangent issues that arise with mirrored UVs in certain tangent spaces.

var invisibleToCamera

If this object isn't visible to the camera. Useful for emissive surfaces you may want hidden.

var mesh

The mesh containing vertex data.

var subdivisionEnabled

If subdivisions are enabled or not.

var subdivisionGeometryReduction

The level of geometry decimation that should be done while subdividing. Helps with real time performance.

var subdivisionLevel

If this object isn't visible to the camera. Useful for emissive surfaces you may want hidden.

var subdivisionMode

The method used for subdivision. Can be 'Catmull-Clark', 'Regular', or 'PN Triangles'.

var subdivisionSharpenCorners

If corners should be sharp when subdividing. Helps keep the shape of your mesh with catmull-clark subdivisions.

var subdivisionSmoothing

The level of smoothing that should be done with PN Triangle subdivision.

var subdivisionWireframeMode

How wireframes should look with subdivisions. Can be 'Isolines' or 'Polygons'.

var tangentSpace

Mesh tangent space for normal mapping. This must be one of the following values: 'Custom' 'Marmoset', 'Mikk', 'Maya', '3D Studio Max', 'Unity'

Methods

def addSubmesh(name: str, material: Material = sys.stdin, 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.

Inherited members

class MetalnessBakerMap

Metalness Baker Map Settings

Ancestors

Instance variables

var metalnessThreshold

Any specular value above this threshold will be considered metal.

Inherited members

class NormalBakerMap

Normal Baker Map Settings

Ancestors

Instance variables

var dither

Determines whether this map output will be dithered.

var flipX

Determines whether the normal map's X channel will be flipped.

var flipY

Determines whether the normal map's Y channel will be flipped.

var flipZ

Determines whether the normal map's Z channel will be flipped.

Inherited members

class PositionBakerMap

Position Baker Map Settings

Ancestors

Instance variables

var normalization

The method by which you normalize position data.

Inherited members

class Preferences

The preferences.

Instance variables

var autoModelReload

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.

var autoSaveDuration

Determines how often autosaving occurs in minutes.

var autoSaveFolderSize

Maximum amount of space the autosave folder can use. Older autosaves will be deleted when total size of the folder exceeds this value.

var autoSaveLocation

Determines the folder that backups are saved in.

var autoSaveMaxCount

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.

var autoSaveRelativeToMaster

Creates autosave files in the same folder as your current scene. The Max Saves and Max Autosave Folder Size settings do not apply when this is option enabled.

var autoSaveUnits

Determines whether the Maximum Autosave Folder Size is set in 'GBs' or 'MBs'.

var autoSaves

Automatically save a backup of your scene to the autosave folder at the specified time interval.

var autoTextureReload

Changed textures will be automatically reloaded when Toolbag regains focus.

var bakeScheduling

Selects a usage priority for the GPU during texture baking. Higher priorities will bake more quickly but may leave other programs somewhat unresponsive. A system experiencing instability or sluggishness during baking may benefit from use of the "Responsive" setting here. Allowed values are 'High', 'Moderate' and 'Responsive'.

var browseForMissingFiles

Displays prompts to locate missing external files, such as textures and animations, during scene loads.

var browseForMissingMeshes

Displays prompts to locate missing external meshes during scene loads.

var defaultSceneUnit

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'.

var defaultTangentHandedness

Newly created bake and texture projects will default to this tangent space handedness. Allowed values are 'Right-Handed' and 'Left-Handed'.

var defaultTangentMethod

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'.

var defaultWatermark

Determines whether or not the "Rendered in Marmoset Toolbag" watermark is enabled when creating a new scene.

var displayTooltips

Disabling this would remove these helpful little boxes. Pro-moves only.

var enableVsyncOffRTAccumulation

Selective VSync disables monitor synchronization during viewport ray tracing accumulation. This improves performance in some cases, but may cause screen artifacts.

var import8mlWithMaterials

Model files will import along with any available material definitions, including textures and other parameters where available.

var importAbcWithMaterials

Model files will import along with any available material definitions, including textures and other parameters where available.

var importFbxWithMaterials

Model files will import along with any available material definitions, including textures and other parameters where available.

var importModelsAsReferences

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.

var importObjWithMaterials

Model files will import along with any available material definitions, including textures and other parameters where available.

var importPlyWithMaterials

Model files will import along with any available material definitions, including textures and other parameters where available.

var importStlWithMaterials

Model files will import along with any available material definitions, including textures and other parameters where available.

var importUsdWithMaterials

Model files will import along with any available material definitions, including textures and other parameters where available.

var libraryAutoUpdate

Automatically update assets when a new version is available.

var libraryLocalPath

Path where first party library content is stored.

var libraryUserPath

Path where user third party library content is stored.

var newScenePref

Determines whether new scenes are empty or created from the template scene. Allowed values are 'Empty' and 'Template'.

var outputDirectory

Sets the default directory where rendered images are saved when creating a new scene.

var rayTraceBackend

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).

var rememberDimensions

If enabled, the Toolbag window will load with the same position and size as it was when last closed.

var sceneStartPref

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'.

var tabletBackend

The default backend when using a digitizer, defaults to the latest available to your operating system. Allowed values are 'Windows Pointer' and 'WinTab'.

var tabletCompatibilityMode

Enables enhanced tablet compatibility. This setting can sometimes solve issues with tablet input, and disables some mouse features.

var undoVerificationCheck

Runs an extra integrity check on the scene when an action is undone or redone. Also displays diagnostic data in the performance window.

var unsavedChangesPrompts

If enabled, you will be prompted to save any unsaved work when closing a scene.

var updateCheck

Determines whether or not you will be prompted to install new updates. If enabled, Toolbag will check for new versions every time it opens.

var updateCheckAllowBeta

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.

class Projector

A Projector object that controls layer projection.

Instance variables

var clamp

If clamping is enabled for UVs or not.

var edgeFade

The amount of edge fading. Used in triplanar projection to blend edges.

var normalWeight

The amount of normal fading. Used in triplanar projection to blend normals.

var position

A list of 3 floats (x, y, z) describing the position of this projector.

var projectionMethod

The projection method of this projector (uv, triplanar, positional, brush, or planar).

var rotation

A list of 3 floats (x, y, z) describing the rotation of this projector.

var scale

A list of 3 floats (x, y, z) describing the scale of this projector.

var tiling

The tiling configuration of this projector.

var transform

A list of 16 floats describing the transform matrix of this projector.

var uvRotation

Rotation of UVs in the W axis.

class PyTurntableObject

Turntable Object

Ancestors

Instance variables

var enabled

Enables the active motion of the turntable object.

var spinRate

The rate at which the turntable object rotates, in degrees per second.

Inherited members

class RenderCameraOptions

Options when configuring a camera to render with Toolbag.

Instance variables

var camera

The reference to this camera object.

var enabled

If this camera is enabled when exporting images/videos.

class RenderObject

Render Object in scene. Manages render configuration can render images/videos.

Ancestors

Instance variables

var cameras

Cameras configured to render with Toolbag.

var images

Output configuration for image outputs.

var options

Render settings for Full Composite configurations of Toolbag.

var renderPasses

Cameras configured to render with Toolbag.

var videos

Output configuration for video outputs.

Methods

def renderImages()

Render all enabled images in this render object.

def renderVideos()

Render all enabled videos in this render object.

Inherited members

class RenderOptions

The final scene render configuration.

Instance variables

var albedoEnergyConservation

Albedo is energy converving. Applies to the albedo and specular render passes.

var depthDither

Whether dithering is enabled when rendering depth passes.

var depthNormalization

The normal view to render when using a Depth render pass. Valid values are 'Bounding Sphere', 'Bounding Box', and 'Disabled'.

var drawWireframe

Enables the rendering of mesh wireframes.

var normalFlipX

Whether to flip normal outputs along the X axis.

var normalFlipY

Whether to flip normal outputs along the Y axis.

var normalFlipZ

Whether to flip normal outputs along the Z axis.

var normalSpace

The normal space to render when using a Normal render pass. Valid values are 'tangent', 'object', and 'view'.

var occludeAmbient

Whether screen space ambient occlusion should occlude ambient light in raster rendering.

var occludeDiffuse

Whether screen space ambient occlusion should occlude diffuse light in raster rendering.

var occludeSpecular

Whether screen space ambient occlusion should occlude specular light in raster rendering.

var occlusionColor

The color of the ambient occlusion.

var occlusionMode

Occlusion mode. Valid values are 'Disabled', 'Screen', 'Raytraced'.

var occlusionSize

The radius size for occlusion. Can be any number > 0.0.

var occlusionStrength

Whether screen space ambient occlusion should occlude ambient light in raster rendering.

var positionDither

Whether dithering is enabled when rendering position passes.

var positionNormalization

The normal view to render when using a Position render pass. Valid values are 'Bounding Sphere', 'Bounding Box', and 'Disabled'.

var rayTraceAdvancedSampling

Whether advanced sampling is enabled. Reduces noise in scenes with many lights. Has moderate impact on render time and viewport performance.

var rayTraceBounces

The maximum number of bounces a ray can perform.

var rayTraceCaustics

Caustics quality when ray tracing.

var rayTraceDenoiseFade

If enabled, the denoiser fades in after a set number of frames.

var rayTraceDenoiseMode

The current denoising mode. Can be 'off', 'cpu', or 'gpu'.

var rayTraceDenoiseQuality

The current level of denoising quality. Can be 'low', 'medium', or 'high'.

var rayTraceDenoiseRealTime

Allows for denoising to occur in real time.

var rayTraceDenoiseStartFrame

The starting frame for denoising to occur.

var rayTraceDenoiseStrength

The current level of denoising quality. Is a value between 0.0 and 1.0.

var rayTraceDiffuseIntensity

The base intensity of diffuse interactions. Can be scaled for a more stylistic look.

var rayTraceDirectRadianceClamp

The maximum direct brightness allowed when ray tracing. Useful to reduce fireflies.

var rayTraceIndirectRadianceClamp

The maximum indirect brightness allowed when ray tracing. Useful to reduce fireflies.

var rayTraceReflectionIntensity

The base intensity of reflection interactions. Can be scaled for a more stylistic look.

var rayTraceSampleAccumulation

The number of samples total allowed to be traced in the viewport each frame.

var rayTraceSampleCount

The number of samples allowed to be traced in the viewport each frame.

var rayTraceTransmissionBounces

The maximum number of transmission bounces a ray can perform.

var reflectDiffuse

Whether screen space reflections should be enabled.

var reflectionDiffuseDistance

The distance diffuse reflections should be allowed to propigate.

var reflectionDiffuseIntensity

The level of brightness the diffuse reflections have.

var reflectionIntensity

The level of brightness the reflections have.

var shadowBias

A bias value for how distance the furthest shadow cascade is from the camera.

var shadowCascadeDistance

A bias value for how distance the furthest shadow cascade is from the camera.

var shadowQuality

Shadow quality. Valid values are 'Low', 'High', and 'Mega'.

var useRayTracing

Whether real time ray tracing is enabled.

var useReflections

Whether screen space reflections should be enabled.

var useShadowCascades

Use cascaded shadow maps for directional lights. This can provide better resolution distribution over larger scenes.

var watermarkColored

Determines if the Marmoset watermark is set to colored mode.

var watermarkDark

Determines if the Marmoset watermark is set to dark mode.

var watermarkEnabled

Whether the Marmoset watermark is enabled.

var watermarkPosition

The position of the watermark. [0,0] coresponds to top left, and [1,1] corresponds to bottom right.

var watermarkSize

Size of the watermark relative to the render's minimum side.

var wireframeColor

Wireframe color as an RGBA array.

var wireframeCull

Cull backfaces when rendering wireframes.

class RenderOutputOptions

Render Output options, the configuration of image or video export.

Instance variables

var compressionQuality

The level of compression for compressed video file formats like avi. Can be between 0 and 100. Does not apply to image exports.

var format

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'.

var height

The height of this output.

var outputPath

This output directory.

var overwrite

Whether this output should overwrite the file by the same name.

var rayTraceDenoiseMode

The current denoising mode for this output. Can be 'off', 'cpu', or 'gpu'.

var rayTraceDenoiseQuality

The current level of denoising quality for this output. Can be 'low', 'medium', or 'high'.

var rayTraceDenoiseStrength

The level of contribution the denoiser should have on the final output. Can be any float between 0.0 and 1.0.

var samples

The number of samples used for this output.

var transparency

Whether this output should be transparent or not.

var width

The width of this output.

class RenderPassOptions

Options when configuring a render pass to render with Toolbag.

Instance variables

var enabled

If this render pass is enabled when exporting images/videos.

var renderPass

The render pass to be executed when rendering images/videos.

class SceneObject

Scene Object

Subclasses

Instance variables

var collapsed

Controls the display of the object's children in the outline view.

var locked

Controls the locking of object settings in the user interface.

var name

The name of the object.

var parent

The parent of the object.

var uid

The unique identifier of this scene object.

var visible

Controls object viewport visibility.

Methods

def destroy()

Destroys the object and removes it from the scene.

def duplicate(name: str = '') ‑> SceneObject

Duplicates the object, optionally assigning it a new name. Returns the new object.

def 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.

def getBounds() ‑> List[List[float]]

Gets the bounds of this object, or None if it doesn't have any. Formatted as [min_xyz, max_xyz]

def getChildren() ‑> List[SceneObject]

Returns a list of all immediate children of the object.

def 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.

class ShadowCatcherObject

Shadow Catcher Object

Ancestors

Instance variables

var edgeFade

Enables a fading of shadow opacity towards the edges of the shadow catcher plane.

var fadeFalloff

Falloff of the edge fade effect.

var fadeRadius

Radius of the edge fade effect.

var fadeTexturePath

File path of the fade texture, which is used to control the shadow fade pattern.

var indirectShadow

Enables receiving shadow from the sky light (ray tracing only).

var invertRoughness

Inverts the output of the roughness shader. Useful for loading gloss maps in place of roughness maps.

var opacity

The opacity of the shadow catcher.

var roughness

Specifies the maximum roughness value.

var roughnessTextureChannel

Determines the channel of the texture from which to read roughness content (must be one of: 'R', 'G', 'B', 'A').

var roughnessTexturePath

The texture used to specify surface roughness. White corresponds to a rough surface while black corresponds to smooth surfaces.

var skyShadow

Enables receiving shadow from the sky light (ray tracing only).

var specularFresnel

Sets the intensity of the Fresnel effect, or how reflective surfaces are at grazing angles.

var specularIntensity

Sets the intensity of the specular reflections.

var specularTextureChannel

Determines the channel of the texture from which to read specular content (must be one of: 'R', 'G', 'B', 'A').

var specularTexturePath

The texture that will be used to set the color and intensity of the specular reflections.

var textureChannel

The active channel in the fade texture (must be one of: 'R', 'G', 'B', 'A').

Inherited members

class SkyBoxObject

Skybox Scene Object

Ancestors

Instance variables

var backgroundBrightness

The brightness of the skybox background.

var backgroundColor

The background color when rendering with the skybox mode set to 'color'.

var blur

The amount of blurring for the background.

var brightness

The brightness of the skybox.

var childLightBrightness

The brightness of child lights on this skybox object.

var mode

The background mode. Can be 'color', 'sky', 'blurred sky', or 'ambient sky'.

var rotation

The current rotation angle of the skybox.

Methods

def clearLightChildren()

Clears all light children of this skybox.

def importImage(path: str)

Imports an image to use for this skybox.

def loadSky(path: str)

Loads a .tbsky file in place of the current sky.

def renderPreview(width: int, height: int) ‑> Image

Renders the sky background, in latitude-longitude format, to a preview image. Returns an mset.Image instance.

def saveSky(path: str)

Saves the current sky to the specified file path as a .tbsky archive.

Inherited members

class Spline

Spline Data, used with Texture Project layers to control various effects.

Methods

def addHandle(x: float, y: float)

Add a point to this spline.

def getHandle(index: int) ‑> List[float]

Get the positional data of a given spline index.

def getHandleCount() ‑> int

Get the number of points on this spline.

def reset()

Resets this spline to a default configuration.

def setHandle(index: int, x: float, y: float)

Edit a point on this spline.

class SubMeshObject

Sub Mesh Object

Ancestors

Instance variables

var indexCount

The index count of the submesh.

var material

The material assigned to the submesh.

var startIndex

The first index of the submesh.

Inherited members

class Texture

GPU Texture

Instance variables

var anisotropicFiltering

Sets the degree of anisotropic filtering applied to this texture.

var path

The file path of the texture. Note: You cannot set the path of a mset.Texture, only get it.

var sRGB

Determines whether the texture is sampled in sRGB color space.

var useFiltering

Determines whether the texture is filtered bilinearly (smooth) or by nearest neighbor (pixelated).

var useMipmaps

Determines whether mipmaps are used on the texture.

var wrapping

Sets the type of texture wrapping applied to this texture.

Methods

def 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 mset.Image instance.

class TextureProjectLayer

A Texture Project Layer (Fill, Stroke, etc.).

Subclasses

Instance variables

var activeProjectMaps

The active project maps for this layer.

var contentChildren

This layers content children.

var maps

The per map settings of this layer.

var maskChildren

This layers mask children.

var maskColor

The mask color of this layer. Works similar to opacity, but for the mask tree.

var name

The name of this layer.

var opacity

The transparency of this layer.

var parent

The parent of this layer.

var uid

The unique identifier of this layer.

var visible

The visibility of this layer.

Methods

def addContentChild(contentType: str) ‑> TextureProjectLayer

Add a content child to the current layer.

def addMaskChild(maskType: str) ‑> TextureProjectLayer

Add a mask child to the current layer.

def duplicate() ‑> TextureProjectLayer

Duplcates this layer in this painter project. Returns duplicated layer.

def getBlendMode(projectMap: str)

Gets the blend mode of this layer for a given project map.

def isDescendantOfMask()

Checks if this layer is a descendant of a mask layer for this painter project.

def moveDown()

Moves this layer down it's parent list in the painter project.

def moveUp()

Moves this layer up it's parent list in the painter project.

def remove()

Removes this layer from this painter project.

def setBlendMode(projectMap: str, mode: str)

Sets the blend mode of this layer for a given project map.

class mset.TextureProjectLayerBlur (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var px

A property of a layer.

Inherited members

class mset.TextureProjectLayerCellular (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var intensity

A property of a layer.

var invert

A property of a layer.

var jitter

A property of a layer.

var phase

A property of a layer.

var randomSeed

A property of a layer.

var scale

A property of a layer.

var smoothing

A property of a layer.

var warpAmount

A property of a layer.

var warpDetail

A property of a layer.

Inherited members

class mset.TextureProjectLayerCheckered (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var A

A property of a layer.

var B

A property of a layer.

var intensity

A property of a layer.

var invert

A property of a layer.

var tileCount

A property of a layer.

var warpAmount

A property of a layer.

var warpDetail

A property of a layer.

Inherited members

class mset.TextureProjectLayerClouds (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var granularity

A property of a layer.

var intensity

A property of a layer.

var invert

A property of a layer.

var randomSeed

A property of a layer.

var scale

A property of a layer.

var warpAmount

A property of a layer.

var warpDetail

A property of a layer.

Inherited members

class mset.TextureProjectLayerColorSelection (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var source

A property of a layer.

Inherited members

class mset.TextureProjectLayerCurvature (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var contrast

A property of a layer.

var contrastCenter

A property of a layer.

var intensity

A property of a layer.

var invert

A property of a layer.

Inherited members

class mset.TextureProjectLayerCurves (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var spline

A property of a layer.

Inherited members

class mset.TextureProjectLayerDirection (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var contrast

A property of a layer.

var contrastCenter

A property of a layer.

var intensity

A property of a layer.

var invert

A property of a layer.

Inherited members

class mset.TextureProjectLayerDirt (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var brightness

A property of a layer.

var contrast

A property of a layer.

var creviceContrast

A property of a layer.

var creviceIntensity

A property of a layer.

var creviceThickness

A property of a layer.

var directionContrast

A property of a layer.

var directionIntensity

A property of a layer.

var grungeContrast

A property of a layer.

var grungeIntensity

A property of a layer.

var grungeRotation

A property of a layer.

var grungeScale

A property of a layer.

var invert

A property of a layer.

var occlusionContrast

A property of a layer.

var occlusionIntensity

A property of a layer.

var sharpness

A property of a layer.

Inherited members

class mset.TextureProjectLayerFill (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var material

Property of a layer.

var projection

A property of a layer.

Inherited members

class mset.TextureProjectLayerGradient (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var intensity

A property of a layer.

var invert

A property of a layer.

var scale

A property of a layer.

Inherited members

class mset.TextureProjectLayerGradientMap (...)

A texture project layer. Used to configure a given layer.

Ancestors

Inherited members

class mset.TextureProjectLayerHeight (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var contrast

A property of a layer.

var contrastCenter

A property of a layer.

var intensity

A property of a layer.

var invert

A property of a layer.

var sharpness

A property of a layer.

Inherited members

class mset.TextureProjectLayerHueSaturation (...)

A texture project layer. Used to configure a given layer.

Ancestors

Inherited members

class mset.TextureProjectLayerInvert (...)

A texture project layer. Used to configure a given layer.

Ancestors

Inherited members

class mset.TextureProjectLayerLevels (...)

A texture project layer. Used to configure a given layer.

Ancestors

Inherited members

class TextureProjectLayerMaps

Per map settings for layers/brushes.

Instance variables

var albedo

The Albedo project map of this surface.

var ambientOcclusion

The Ambient Occlusion project map of this surface.

var anisoDir

The Anisotropic Direction project map of this surface.

var bump

The Bump project map of this surface.

var cavity

The Cavity project map of this surface.

var displacement

The Gloss project map of this surface.

var emissive

The Emissive project map of this surface.

var fuzz

The Fuzz project map of this surface.

var gloss

The Gloss project map of this surface.

var mask

The Mask project map of this surface.

var metalness

The Metalness project map of this surface.

var normal

The Normal project map of this surface.

var roughness

The Roughness project map of this surface.

var scatter

The Scatter project map of this surface.

var sheen

The Sheen project map of this surface.

var sheenRoughness

The Sheen (Roughness) project map of this surface.

var specular

The Specular project map of this surface.

var transmissionMask

The Transmission Mask project map of this surface.

var transparency

The Transparency project map of this surface.

class mset.TextureProjectLayerOcclusion (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var contrast

A property of a layer.

var contrastCenter

A property of a layer.

var intensity

A property of a layer.

var invert

A property of a layer.

var sharpness

A property of a layer.

Inherited members

class mset.TextureProjectLayerPaint (...)

A texture project layer. Used to configure a given layer.

Ancestors

Inherited members

class mset.TextureProjectLayerPerlin (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var intensity

A property of a layer.

var invert

A property of a layer.

var macroContrast

A property of a layer.

var macroWarpAmount

A property of a layer.

var macroWarpDetail

A property of a layer.

var microContrast

A property of a layer.

var microWarpAmount

A property of a layer.

var microWarpDetail

A property of a layer.

var noisePasses

A property of a layer.

var sampling

A property of a layer.

var scale

A property of a layer.

var seed

A property of a layer.

var unitCount

A property of a layer.

Inherited members

class mset.TextureProjectLayerScratch (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var grungeContrast

A property of a layer.

var grungeIntensity

A property of a layer.

var grungeRotation

A property of a layer.

var invert

A property of a layer.

var scratchRotation

A property of a layer.

Inherited members

class mset.TextureProjectLayerSharpen (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var amount

A property of a layer.

var radius

A property of a layer.

Inherited members

class mset.TextureProjectLayerThickness (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var contrast

A property of a layer.

var contrastCenter

A property of a layer.

var intensity

A property of a layer.

var invert

A property of a layer.

var sharpness

A property of a layer.

Inherited members

class mset.TextureProjectLayerTiles (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var bevelDepth

A property of a layer.

var bevelRoundness

A property of a layer.

var bevelWidth

A property of a layer.

var cornerRoundness

A property of a layer.

var groutDepth

A property of a layer.

var groutWidth

A property of a layer.

var groutX

A property of a layer.

var groutY

A property of a layer.

var intensity

A property of a layer.

var invert

A property of a layer.

var maxX

A property of a layer.

var maxY

A property of a layer.

var maxZ

A property of a layer.

var randomDepth

A property of a layer.

var randomRotation

A property of a layer.

var randomSeed

A property of a layer.

var shadowDepth

A property of a layer.

var shadowWidth

A property of a layer.

var tileCount

A property of a layer.

var tileDepth

A property of a layer.

var tileHeight

A property of a layer.

var tileOffset

A property of a layer.

var tileWidth

A property of a layer.

Inherited members

class mset.TextureProjectLayerTurbulence (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var amplitude

A property of a layer.

var frequency

A property of a layer.

var intensity

A property of a layer.

var invert

A property of a layer.

var macroContrast

A property of a layer.

var macroWarpAmount

A property of a layer.

var macroWarpDetail

A property of a layer.

var microContrast

A property of a layer.

var microWarpAmount

A property of a layer.

var microWarpDetail

A property of a layer.

var noisePasses

A property of a layer.

var projection

A property of a layer.

var scale

A property of a layer.

var seed

A property of a layer.

Inherited members

class mset.TextureProjectLayerVoronoi (...)

A texture project layer. Used to configure a given layer.

Ancestors

Instance variables

var intensity

A property of a layer.

var invert

A property of a layer.

var jitter

A property of a layer.

var phase

A property of a layer.

var projection

A property of a layer.

var randomSeed

A property of a layer.

var scale

A property of a layer.

var smoothing

A property of a layer.

var warpAmount

A property of a layer.

var warpDetail

A property of a layer.

Inherited members

class TextureProjectObject

Scene Object for Texture Projects.

Ancestors

Instance variables

var bumpDetailWeight

The amount that bump maps contribute to normal details.

var metalnessThresholdCenter

The center region where materials are defined as non-metal vs metal.

var metalnessThresholdRange

The range of values that are interpolated between non-metal and metal.

var outputHeight

The height in pixels of exported texture project textures.

var outputPath

The directory of the texture project exports. For the file name itself, see outputPathBaseName.

var outputPathBaseName

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'.

var outputWidth

The width in pixels of exported texture project textures.

var paddingSize

UV padding size in pixels.

var previewUndersample

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.

var projectHeight

The height in pixels of the texture project working resolution.

var projectWidth

The width in pixels of the texture project working resolution.

var reflectionWorkflow

The current reflection workflow. Can be either 'metalness' or 'specular'

var useBumpAsDetailNormals

Use bump channel as detail normals.

var useHeightAsParallax

Use height map in paralax subroutine with materials.

var useThicknessAsScatter

Use tickness as scatter subroutine with materials.

var viewportQuality

The quality of the viewport, can be either 'Full' or 'Fast'.

var viewportUndersample

Resolution undersampling scale (viewport res = full res / undersampling). Meant to improve viewport performance at the cost of quality. Does not affect final output.

Methods

def addDefaultProjectMaps()

Convenience function, adds the default set of project maps (PBR Metalness + Normals, Occlusion, Bump) to this texture project.

def addLayer(layerType: str) ‑> TextureProjectLayer

Add a layer to the top of this texture project.

def addLinkedMaterial(mat: Material)

Add a linked material to this texture project.

def 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 mset.TextureProjectOutputMap.

def addProjectMap(name: str)

Add a project map to this texture project.

def exportAllOutputMaps()

Convenience function that exports all output maps for this painter project according to your export settings.

def exportOutputMap(index: int)

Exports a single output map given a zero-based index.

def 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.

def generateExportAssetFromIndex(index: int) ‑> Image

Generates an output map asset image given an zero-based index.

def getActiveLayer() ‑> TextureProjectLayer

Gets the currently active layer selected in this texture project.

def getAllLayerTypes() ‑> List[str]

Get all types of layers that can be created in a texture project.

def getAllLayers() ‑> List[TextureProjectLayer]

Get a list of all layers in this texture project.

def getAllProjectMaps() ‑> List[str]

Gets all project maps from this texture project to get/set any settings it might have.

def getInputMap(name: str) ‑> Texture

Sets an input map to this texture project to be used as base information during texture generation.

def getOutputMap(index: int) ‑> TextureProjectOutputMap

Get an output map coresponding to this index or name for this texture project.

def getOutputMapCount() ‑> int

Get the number of project maps in this texture project.

def getProjectMapFormat(name: str) ‑> str

Get the format of a given texture project map.

def getSelectedLayers() ‑> List[TextureProjectLayer]

Get a list of all selected layers in this texture project.

def recomposite()

Rerender this texture project. Useful if you're having trouble seeing changes in your texture renders.

def removeOutputMap(index: Union[int, TextureProjectOutputMap])

Remove an output map for this texture project.

def removeProjectMap(name: str)

Add a project map to this texture project.

def setInputMap(name: str, tex: Union[Texture, str])

Sets an input map to this texture project to be used as base information during texture generation.

def 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)'

Inherited members

class TextureProjectOutputMap

A Texture Project Output Map

Instance variables

var a

The project map type for the A output channel.

var b

The project map type for the B output channel.

var bitrate

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

var format

The extension type for this output map. Can be one of the following: 'PNG', 'TGA', 'JPG', 'PSD'

var g

The project map type for the G output channel.

var r

The project map type for the R output channel.

var rgb

The project map type for the RGB output channels.

var sRGB

Whether this map is exported with sRGB encoding.

var suffix

The suffix appended to the output name of this map.

var type

The type of output map. Can be one of the following: 'RGB', 'RGB+A', 'RGBA', 'R+G+B', 'R+G+B+A', 'Grayscale'.

class ThicknessBakerMap

Thickness Baker Map Settings

Ancestors

Instance variables

var dither

Determines whether this map output will be dithered.

var rayCount

The number of rays used for thickness baking.

Inherited members

class Timeline

Animation Timeline

Instance variables

var currentFrame

Current animation frame. This value must be within the valid range of 0 to totalFrames.

var playbackSpeed

The current playback speed. This value controls the apparent speed of playback in the viewport, but does not affect exported animation length.

var selectionEnd

The last frame of the selected time range. Must be less than totalFrames and greater than zero.

var selectionStart

The first frame of the selected time range. Must be less than totalFrames and greater than zero.

var totalFrames

Total frame count for the animation. This value must be greater than zero.

Methods

def getFrameRate() ‑> int

Returns the scene's animation frame rate, in frames per second.

def getTime() ‑> float

Returns the current animation time, in seconds.

def pause()

Stops animation playback.

def play()

Activates animation playback.

def 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.

def setTime(time: float)

Sets the current animation time, in seconds. This time may be rounded to the nearest frame.

class TransformObject

Transform Object

Ancestors

Subclasses

Instance variables

var pivot

The pivot of the object, as a list of 3 floats.

var position

The position of the object, as a list of 3 floats.

var rotation

The rotation of the object, as a list of 3 floats.

var scale

The scale of the object, as a list of 3 floats.

Methods

def centerPivot()

Centers the pivot point of this object to its bounding box.

Inherited members

class UIBaseSlider

UI Base Slider. Abstract class, do not use in your plugins.

Ancestors

Subclasses

Instance variables

var onChange

A callable, called when the tracked value changes.

var width

The width of the control.

class UIBaseTextField

UI Base Text Field. Abstract class, do not use in your plugins.

Ancestors

Subclasses

Instance variables

var onCancel

A callable, called when text editing is canceled.

var onChange

A callable, called when the text is changed.

var width

The width of the control.

class UIButton

UIButton

Ancestors

Instance variables

var frameless

If the button has a frame.

var lit

If the button has a highlighted frame.

var onClick

A callable, called when the button is clicked.

var small

If the button is small or not.

var text

The text label of the button.

Methods

def setIcon(icon: str)

Lets you set an image as the button icon.

def setIconPadding(left: float = 0, right: float = 0, top: float = 0, bottom: float = 0)

Lets you set an image as the button icon.

class UICheckBox

UICheckBox

Ancestors

Instance variables

var label

The text label of the CheckBox.

var onChange

A callable, called when the CheckBox value is changed.

var value

The boolean value of the CheckBox.

class UIColorPicker

UIColorPicker

Ancestors

Instance variables

var color

The color of the color picker.

var title

The text title of the color picker.

class UIControl

User Interface Control

Subclasses

class UIDrawer

UIDrawer

Ancestors

Instance variables

var containedControl

The control contained by the drawer object, to which other elements may be added.

var onOpenClose

A callable, called when opening/closing the drawer.

var open

The current open/closed state of the drawer.

var title

The text title of the drawer.

Methods

def setMinor(minor: bool)

Whether or not the drawer is dimmer.

class UILabel

UILabel

Ancestors

Instance variables

var fixedWidth

The desired fixed width of the label.

var text

The text of the label.

Methods

def setMonospaced(monospaced: bool)

Changes this label to a monospaced font.

class UIListBox

UIListBox

Ancestors

Instance variables

var onMenuOpen

A callable, called when opening the ListBox.

var onSelect

A callable, called when selecting an item in the ListBox.

var selectedItem

The currently selected item in the ListBox.

var title

The text title of the ListBox.

Methods

def addItem(item: str)

Adds an item with the label specified to the ListBox.

def clearItems()

Removes all items from this ListBox.

def selectItemByName(name: str)

Selects the item that matches the name specified.

def selectNone()

Select no item on the list.

class UIScrollBox

UIScrollBox

Ancestors

Instance variables

var containedControl

The control contained by the scrollbox object, to which other elements may be added.

class UISliderFloat

UI slider that exclusively works with float values.

Ancestors

Instance variables

var logScale

The logarithmic exponent scale of the slider.

var logScaleCenter

The center of the logarithmic scale of the slider.

var max

The maximum of the slider range.

var min

The minimum of the slider range.

var value

The value of the slider.

Inherited members

class UISliderInt

UI slider that exclusively works with int values.

Ancestors

Instance variables

var logScale

The logarithmic exponent of the slider.

var logScaleCenter

The center of the logarithmic scale of the slider.

var max

The maximum value of the slider range.

var min

The minimum value of the slider range.

var value

The value of the slider.

Inherited members

class UITextField

UI text field, useful for entering in text data.

Ancestors

Instance variables

var value

The contents of the text field.

Inherited members

class UITextFieldFloat

UI text field that exclusively works with floating point values.

Ancestors

Instance variables

var value

The numerical value of the text field.

Inherited members

class UITextFieldInt

UI text field that exclusively works with int values.

Ancestors

Instance variables

var value

The numerical value of the text field.

Inherited members

class UIWindow

UIWindow

Ancestors

Instance variables

var height

The height of the Window in screen pixels.

var title

The title of the Window

var visible

True if the Window is visible.

var width

The width of the Window in screen pixels.

Methods

def addElement(child: UIControl)

Adds a child control to the Window.

def addReturn()

Adds a line return to the window, placing all following elements on the next line.

def addSpace(width: float)

Adds a space of fixed width to the window, placing all following elements after it.

def addStretchSpace()

Adds a stretchable space to the Window, placing all following elements after it at the end of the current line.

def clearElements()

Removes all elements from the window.

def close()

Closes the current window.

def getElements() ‑> List[UIControl]

Returns a list of all contained controls.

class UVIslandBakerMap

UVIsland Baker Map Settings

Ancestors

Instance variables

var enableSVGUVIsland

Enables the exporting of an SVG version of the UV Island map.

Inherited members

class WireframeBakerMap

Wireframe Baker Map Settings

Ancestors

Instance variables

var lineThickness

The thickness of the UV wireframe lines.

var vertexRadius

The radius of each vertex of the UV wireframe.

var wireframeColor

Wireframe color as an RGB array.

Inherited members