Top

mset module

Module variables

var callbacks

Functions

def bakeAll(

frame)

Bakes all objects in the scene.

def exportGLTF(

path='', quality=3, metalnessThreshold=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. Texture quality is set from 0 to 4, with 4 being the highest. The specular metalness conversion threshold is a value above which materials will be converted to metalness.

def exportScreenshot(

path='', width=-1, height=-1, sampling=-1, transparency=False)

Takes a screenshot with the scene's current settings and camera.
Optionally takes a path parameter, which specifies where to write the screenshot.
If no path is specified, the screenshot will be written to the scene's default output location.

def exportVideo(

path='', width=-1, height=-1, sampling=-1, transparency=False)

Captures an animation into a video file or image sequence.
The animation will be written into the file path specified, or an uncompressed AVI file if no output path is given.

def exportViewer(

path='', html=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(

message)

Routes an error message to an automated testing log. Mainly for internal use. For general printing needs, use print() instead.

def findMaterial(

name)

Finds a Material by string name.

def findObject(

searchString)

Finds an Object in the scene by string name.

def frameObject(

object)

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 getAllMaterials(

)

Returns all materials as a list.

def getAllObjects(

)

Returns all scene Objects as a list.

def getPluginPath(

)

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

def getScenePath(

)

Returns the path of the current scene file.

def getSelectedMaterial(

)

Returns the currently selected Material.

def getSelectedMaterialGroup(

)

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

def getSelectedObject(

)

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

def getSelectedObjects(

)

Returns all currently selected scene Objects as a list.

def getTimeline(

)

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

def getToolbagVersion(

)

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

def groupObjects(

list)

Groups an array of SceneObjects.

def importMaterial(

filePath, name='')

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, Substance archives, and named texture files.
Returns the imported material.

def importModel(

filePath)

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

def loadScene(

filePath)

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

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 saveScene(

filePath)

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)

Sets the current active camera for viewport and screenshot rendering.

def showOpenFileDialog(

)

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.

def showOpenFolderDialog(

)

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(

)

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.

def shutdownPlugin(

)

Halts execution and shuts down the currently running plugin.

Classes

class AOBakerMap

Bent Normal Baker Map Settings

Ancestors (in MRO)

Class variables

var addCavity

Determines if this map should also include cavity shadows, useful for unexpected bright spots in ypur AO.

var dither

Determines whether this map output will be dithered.

var enabled

Whether or not this Baker Map should render when baking.

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 suffix

The output suffix of the current Baker Map.

var twoSided

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

var uniform

Determines whether the ambient occlusion will be weighed uniformly or by difference in ray from normal.

Methods

def resetSuffix(

)

Resets the current map suffix to its default.

class BackdropObject

Backdrop Object

Ancestors (in MRO)

Class variables

var alpha

The transparency of the backdrop image.

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 path

The file path to the backdrop image.

var useAlpha

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

var visible

Controls object viewport visibility.

Methods

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getChildren(

)

Returns a list of all immediate children of the object.

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

class BakerMap

Baker Map Settings

Ancestors (in MRO)

Class 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 (in MRO)

Class variables

var aoFloorOcclusion

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

var aoFloorOcclusionStrength

Depreciated: The amount of floor occlusion.

var aoIgnoreGroups

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

var aoRayCount

Depreciated: The number of rays used for ambient occlusion baking.

var aoTwoSided

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

var collapsed

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

var curvatureStrength

Depreciated: The strength of the curvature map.

var ditherCurvature

Depreciated: Determines whether the curvature map will be dithered

var ditherHeight

Depreciated: Determines whether the height map will be dithered.

var ditherNormal

Depreciated: Determines whether the normal map outputs will be dithered.

var edgePadding

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

var edgePaddingSize

Edge padding size in pixels.

var enableAO

Depreciated: Determines whether an ambient occlusion map will be baked.

var enableAlbedo

Depreciated: Determines whether an albedo material map will be baked.

var enableCurvature

Depreciated: Determines whether a curvature map will be baked.

var enableGloss

Depreciated: Determines whether a gloss material map will be baked.

var enableHeight

Depreciated: Determines whether a height map will be baked.

var enableMatID

Depreciated: Determines whether a material ID map will be baked.

var enableNormals

Depreciated: Determines whether a tangent space normal map will be baked.

var enableObjectNormals

Depreciated: Determines whether an object space normal map will be baked.

var enablePosition

Depreciated: Determines whether a position map will be baked.

var enableSpecular

Depreciated: Determines whether a specular material map will be baked.

var enableVertexColor

Depreciated: Determines whether a vertex color map will be baked.

var fixMirroredTangents

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

var flipXNormal

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

var flipYNormal

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

var flipZNormal

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

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 locked

Controls the locking of object settings in the user interface.

var maxHeight

Depreciated: The maximum value of the height map range.

var minHeight

Depreciated: The minimum value of the height map range.

var multipleTextureSets

Enables the use of Texture Sets when baking.

var name

The name of the object.

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.

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 parent

The parent of the object.

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.

var visible

Controls object viewport visibility.

Methods

def addGroup(

name)

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

def bake(

)

Bakes with the current configuration.

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getAllMaps(

)

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

def getChildren(

)

Returns a list of all immediate children of the object.

def getMap(

name)

Gets a baker map handle.
name: The Name of the Map you want
returns: A handle to the Baker Output Map

def getTextureSetCount(

)

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

def getTextureSetEnabled(

i)

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)

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)

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)

Gets the width of a texture set.
i: The index of the texture set you want
returns: Width of texture set.

def loadPreset(

name)

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

def savePreset(

name)

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

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

def setTextureSetEnabled(

i, enabled)

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, height)

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, width)

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.

class BakerTargetObject

Baker Target Object

Ancestors (in MRO)

Class variables

var cageAlpha

The opacity of the cage.

var collapsed

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

var excludeWhenIgnoringGroups

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

var locked

Controls the locking of object settings in the user interface.

var maxOffset

The maximum offset of the cage mask.

var minOffset

The minimum offset of the cage mask.

var name

The name of the object.

var parent

The parent of the object.

var visible

Controls object viewport visibility.

Methods

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def estimateOffset(

)

Estimates the Cage Offsets.

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getChildren(

)

Returns a list of all immediate children of the object.

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

class BentNormalBakerMap

Bent Normal Baker Map Settings

Ancestors (in MRO)

Class variables

var dither

Determines whether this map output will be dithered.

var enabled

Whether or not this Baker Map should render when baking.

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 rayCount

The number of rays used for Bent Normal baking.

var suffix

The output suffix of the current Baker Map.

Methods

def resetSuffix(

)

Resets the current map suffix to its default.

class Callbacks

Callbacks

Ancestors (in MRO)

Class variables

var onSceneChanged

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

var onSceneLoaded

This Callback will be called when a new scene is loaded.

var onShutdownPlugin

This Callback will be called right before the plugin is shut down.

class CameraObject

Camera Object

Ancestors (in MRO)

Class variables

var collapsed

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

var focalLength

The focal length of the camera, in mm.

var fov

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

var locked

Controls the locking of object settings in the user interface.

var name

The name of the object.

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 parent

The parent of the object.

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.

var visible

Controls object viewport visibility.

Methods

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getChildren(

)

Returns a list of all immediate children of the object.

def getLens(

)

Returns a CameraLens object containing the camera lens settings. In order to set the camera lens, use setLens().

def getLimits(

)

Returns a CameraLimits object containing the camera limits settings. In order to set the camera limits, use setLimits().

def getPostEffect(

)

Returns a CameraPostEffect object containing the camera post effect settings. In order to set the camera post effect, use setPostEffect()

def loadPostEffect(

path)

Load a camera post effect from a file.

def savePostEffect(

path)

Save a camera post effect to a file.

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

def setLens(

lens)

Sets the camera lens from a CameraLens object. In order to retrieve the camera lens, use getLens().

def setLimits(

limits)

Sets the camera limits from a CameraLimits object. In order to retrieve the camera limits, use getLimits().

def setPostEffect(

postEffect)

Sets the camera post effect from a CameraPostEffect object. In order to retrieve the camera post effect, use getPostEffect().

class CameraObject.CameraLens

Camera Lens Settings

Ancestors (in MRO)

Class 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 dofAperture

Path of the aperture shape texture file.

var dofApertureRotation

Rotation of the aperture shape texture.

var dofEnabled

Enables the depth of field effect.

var dofFarBlur

Far blur of the depth of field.

var dofFocusDistance

Focal distance of the depth of field.

var dofFocusdofMaxBokehSizeDistance

Maximum bokeh size of the depth of field.

var dofNearBlur

Near blur scale of the depth of field.

var dofSwirlVignette

Swirl vignette amount of the depth of field.

var flareSize

Size of the lens flare effect.

var flareStrength

Strength of the lens flare effect.

var flareThreshold

Threshold of the lens flare effect.

var safeFrameEnabled

Displays the safe frame in the viewport.

var safeFrameOpacity

Opacity of the safe frame display.

class CameraObject.CameraLimits

Camera Limits Settings

Ancestors (in MRO)

Class 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.CameraPostEffect

Camera Post Effect

Ancestors (in MRO)

Class variables

var bloomBrigtness

Brightness multiplier for the bloom effect.

var bloomSize

Size scalar for the bloom effect.

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 grainSharpness

Sharpness scalar for the film grain effect.

var grainStrength

Strength multiplier for the film grain effect.

var saturation

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

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', 'Filmic')

var vignetteSoftness

Softness scalar for the vignette effect.

var vignetteStrength

Strength multiplier for the vignette effect.

class CompleteLightingBakerMap

Complete Lighting Baker Map Settings

Ancestors (in MRO)

Class variables

var dither

Determines whether this map output will be dithered.

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 Control

Control

Ancestors (in MRO)

class CurvatureBakerMap

Curvature Baker Map Settings

Ancestors (in MRO)

Class variables

var dither

Determines whether this map output will be dithered.

var enabled

Whether or not this Baker Map should render when baking.

var normalize

Determines whether this map output will be normalized.

var strength

Determines the strength of the curvature output.

var suffix

The output suffix of the current Baker Map.

Methods

def resetSuffix(

)

Resets the current map suffix to its default.

class ExternalObject

External Object

Ancestors (in MRO)

Class 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 path

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

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.

var visible

Controls object viewport visibility.

Methods

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getChildren(

)

Returns a list of all immediate children of the object.

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

class FogObject

Fog Object

Ancestors (in MRO)

Class variables

var collapsed

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

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 locked

Controls the locking of object settings in the user interface.

var name

The name of the object.

var opacity

The maximum opacity of the fog effect.

var parent

The parent of the object.

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

var visible

Controls object viewport visibility.

Methods

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getChildren(

)

Returns a list of all immediate children of the object.

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

class HeightBakerMap

Height Baker Map Settings

Ancestors (in MRO)

Class variables

var dither

Determines whether this map output will be dithered.

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 LightObject

Light Object

Ancestors (in MRO)

Class variables

var attenuation

The attenuation curve of the light, from 0.0 to 1.0.

var brightness

The brightness of the light.

var castShadows

Enables the casting of shadows by the light.

var collapsed

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

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 lightType

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

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 position

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

var radius

The outer distance inside of which light is cast.

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.

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 visible

Controls object viewport visibility.

var visibleShape

Makes the light source shape visible in final renders.

var width

The radius of the light source.

Methods

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getChildren(

)

Returns a list of all immediate children of the object.

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

class LightingBakerMap

Complete Lighting Baker Map Settings

Ancestors (in MRO)

Class variables

var dither

Determines whether this map output will be dithered.

var enableSkybox

Determines whether the skybox will be taken into account when rendering this map.

var enabled

Whether or not this Baker Map should render when baking.

var ignoreGroups

Determines whether bake groups will be ignored when rendering this map. Useful for casting shadows across bake groups.

var suffix

The output suffix of the current Baker Map.

Methods

def resetSuffix(

)

Resets the current map suffix to its default.

class Material

Material

Ancestors (in MRO)

Class variables

var albedo

The MaterialSubroutine currently assigned to the Albedo Slot

var diffusion

The MaterialSubroutine currently assigned to the Diffusion Slot

var displacement

The MaterialSubroutine currently assigned to the Displacement Slot

var emissive

The MaterialSubroutine currently assigned to the Emissive 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 secondaryReflection

The MaterialSubroutine currently assigned to the Secondary Reflection Slot

var subdivision

The MaterialSubroutine currently assigned to the Subdivision Slot

var surface

The MaterialSubroutine currently assigned to the Surface Slot

var transparency

The MaterialSubroutine currently assigned to the Transparency Slot

Methods

def assign(

object, includeChildren=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='')

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)

Exports this material to the path specified.

def getAssignedObjects(

)

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

def getCustomShader(

)

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

def getGroup(

)

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)

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

def setCustomShader(

shaderFile)

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

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

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

def setSubroutine(

subroutine, shader)

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', 'secondaryReflection', 'occlusion', 'emissive', 'transparency', 'extra', 'merge'.

class MaterialSubroutine

Material Subroutine

Ancestors (in MRO)

Methods

def getField(

name)

Returns the value of a field.

def getFieldNames(

)

Returns a list of all field names of the subroutine.

def setField(

name, value)

Sets the value of a field.

class Mesh

Mesh

Ancestors (in MRO)

  • Mesh
  • builtins.object

Class 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 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 (in MRO)

Class variables

var castShadows

Enables casting of shadows from the mesh.

var collapsed

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

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 locked

Controls the locking of object settings in the user interface.

var mesh

The mesh containing vertex data.

var name

The name of the object.

var parent

The parent of the object.

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.

var tangentSpace

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

var visible

Controls object viewport visibility.

Methods

def addSubmesh(

name, material=None, startIndex=0, indexCount=-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.

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getChildren(

)

Returns a list of all immediate children of the object.

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

class MetalnessBakerMap

Metalness Baker Map Settings

Ancestors (in MRO)

Class variables

var enabled

Whether or not this Baker Map should render when baking.

var metalnessThreshold

Any specular value above this threshold will be considered metal.

var suffix

The output suffix of the current Baker Map.

Methods

def resetSuffix(

)

Resets the current map suffix to its default.

class NormalBakerMap

Normal Baker Map Settings

Ancestors (in MRO)

Class variables

var dither

Determines whether this map output will be dithered.

var enabled

Whether or not this Baker Map should render when baking.

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 suffix

The output suffix of the current Baker Map.

Methods

def resetSuffix(

)

Resets the current map suffix to its default.

class PyTurntableObject

Turntable Object

Ancestors (in MRO)

Class variables

var collapsed

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

var enabled

Enables the active motion of the turntable object.

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

var spinRate

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

var visible

Controls object viewport visibility.

Methods

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getChildren(

)

Returns a list of all immediate children of the object.

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

class RenderObject

Render Object

Ancestors (in MRO)

Class 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 showScaleReference

Enables the display of the scale reference Teddy.

var stereoEyeSeparation

The distance between eyes, in world units.

var stereoMode

The stereo rendering mode. Can be "None", "Red/Cyan", "Cross-eyed", or "Dual / 3D Monitor".

var stereoSwapEyes

Swap eye output locations.

var viewportAAMode

The anti-aliasing mode of the viewport. Can be "None" or "4x Temporal"

var viewportHighDPI

Whether the Viewport renders in High DPI mode.

var viewportResolutionMode

The resolution mode of the viewport. Can be 0.5, 1.0, or 2.0 times the output resolution.

var visible

Controls object viewport visibility.

Methods

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getChildren(

)

Returns a list of all immediate children of the object.

def getRenderOptions(

)

Returns a copy of the current scene render options. See RenderOptions.

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

def setRenderOptions(

options)

Sets the current scene render options. 'options' must be an instance of RenderOptions.

class RenderOptions

Scene Render Options

Ancestors (in MRO)

Class variables

var AOSize

Controls the size of the ambient occlusion effect, as a fraction of screen space.

var AOStrength

Controls the strength of the ambient occlusion effect.

var GIBrightness

Brightness multiplier for global illumination.

var GIOcclusionDetail

Global illumination occlusion samples. Valid values are 1, 2, and 4.

var GIRevoxelize

Re-voxelizes the scene every frame. This can be disabled for better performance in static scenes.

var GISceneFit

Voxel scene fit scalar for global illumination.

var GITessellate

Enables full detail of tessellated materials for the GI voxelization pass. This slower but more accurate.

var GIUseDiffuse

Enables diffuse global illumination.

var GIUseSecondary

Enables secondary global illumination light bounces.

var GIUseSpecular

Enables specular global illumination.

var GIVisualize

Enables a debug display of scene voxels.

var GIVoxelResolution

Global illumination voxel resolution. Valid values are 'Low', 'Medium', and 'High'.

var drawWireframe

Enables the rendering of mesh wireframes.

var refractiveIndex

Refractive index for the scene's medium (generally air).

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

var useAO

Enables screen-space ambient occlusion.

var useGI

Enables global illumination.

var useInternalRefraction

Use a two-sided rendering process for refractive objects, in an attempt to simulate multiple refractions within the object.

var useLocalReflections

Use local, screen-space reflections.

var useShadowCascades

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

var wireframeColor

Wireframe color as an RGBA array.

class SceneObject

Scene Object

Ancestors (in MRO)

Class 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 visible

Controls object viewport visibility.

Methods

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getChildren(

)

Returns a list of all immediate children of the object.

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

class ShadowCatcherObject

Shadow Catcher Object

Ancestors (in MRO)

Class variables

var collapsed

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

var edgeFade

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

var fadeTexturePath

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

var locked

Controls the locking of object settings in the user interface.

var name

The name of the object.

var opacity

The opacity of the shadow catcher.

var parent

The parent of the object.

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.

var simpleShadows

When set, uses simplified uncolored shadows.

var textureChannel

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

var visible

Controls object viewport visibility.

Methods

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getChildren(

)

Returns a list of all immediate children of the object.

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

class SkyBoxObject

Skybox Scene Object

Ancestors (in MRO)

Class variables

var brightness

The brightness of the skybox.

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 rotation

The current rotation angle of the skybox.

var visible

Controls object viewport visibility.

Methods

def clearLightChildren(

)

Clears all light children of this skybox.

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getChildren(

)

Returns a list of all immediate children of the object.

def importImage(

path)

Imports an image to use for this skybox.

def loadSky(

path)

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

def saveSky(

path)

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

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

def setRandomSkyBox(

)

Sets a random skybox.

class SubMeshObject

Sub Mesh Object

Ancestors (in MRO)

Class variables

var collapsed

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

var indexCount

The index count of the submesh.

var locked

Controls the locking of object settings in the user interface.

var material

The material assigned to the submesh.

var name

The name of the object.

var parent

The parent of the object.

var startIndex

The first index of the submesh.

var visible

Controls object viewport visibility.

Methods

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getChildren(

)

Returns a list of all immediate children of the object.

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

class Texture

Texture

Ancestors (in MRO)

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

class ThicknessBakerMap

Thickness Baker Map Settings

Ancestors (in MRO)

Class variables

var dither

Determines whether this map output will be dithered.

var enabled

Whether or not this Baker Map should render when baking.

var rayCount

The number of rays used for thickness baking.

var suffix

The output suffix of the current Baker Map.

Methods

def resetSuffix(

)

Resets the current map suffix to its default.

class Timeline

Animation Timeline

Ancestors (in MRO)

Class 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(

)

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

def getTime(

)

Returns the current animation time, in seconds.

def pause(

)

Stops animation playback.

def play(

)

Activates animation playback.

def resample(

frameRate)

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)

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

class TransformObject

Transform Object

Ancestors (in MRO)

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

var visible

Controls object viewport visibility.

Methods

def destroy(

)

Destroys the object and removes it from the scene.

def duplicate(

name='')

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

def findInChildren(

searchStr)

Finds and returns an object with a name matching 'searchStr', parented under this object. The search recursively checks all child objects.

def getChildren(

)

Returns a list of all immediate children of the object.

def setKeyframe(

lerp)

Sets a keyframe on this object with the assigned interpolation function ("linear", "spline", or "splineBreak"). This setting defaults to editor's default.

class UIButton

UIButton

Ancestors (in MRO)

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

Lets you set an image as the button icon.

def setIconPadding(

left=0, right=0, top=0, bottom=0)

Lets you set an image as the button icon.

class UICheckBox

UICheckBox

Ancestors (in MRO)

Class 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 (in MRO)

Class variables

var color

The color of the color picker.

var title

The text title of the color picker.

class UIDrawer

UIDrawer

Ancestors (in MRO)

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

Whether or not the drawer is dimmer.

class UILabel

UILabel

Ancestors (in MRO)

Class variables

var fixedWidth

The desired fixed width of the label.

var text

The text of the label.

class UIListBox

UIListBox

Ancestors (in MRO)

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

Adds an item with the label specified to the ListBox.

def clearItems(

)

Removes all items from this ListBox.

def selectItemByName(

name)

Selects the item that matches the name specified.

def selectNone(

)

Select no item on the list.

class UIScrollBox

UIScrollBox

Ancestors (in MRO)

Class variables

var containedControl

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

class UISliderFloat

UISliderFloat

Ancestors (in MRO)

Class 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 onChange

A callable, called when the tracked value changes.

var value

The value of the slider.

var width

The width of the control.

class UISliderInt

UISliderInt

Ancestors (in MRO)

Class 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 onChange

A callable, called when the tracked value changes.

var value

The value of the slider.

var width

The width of the control.

class UITextField

UITextField

Ancestors (in MRO)

Class variables

var onCancel

A callable, called when text editing is canceled.

var onChange

A callable, called when the text is changed.

var value

The contents of the text field.

var width

The width of the control.

class UITextFieldFloat

UITextFieldFloat

Ancestors (in MRO)

Class variables

var onCancel

A callable, called when text editing is canceled.

var onChange

A callable, called when the text is changed.

var value

The numerical value of the text field.

var width

The width of the control.

class UITextFieldInt

UITextFieldInt

Ancestors (in MRO)

Class variables

var onCancel

A callable, called when text editing is canceled.

var onChange

A callable, called when the text is changed.

var value

The numerical value of the text field.

var width

The width of the control.

class UIWindow

UIWindow

Ancestors (in MRO)

Class variables

var height

The height of the Window

var title

The title of the Window

var visible

True if the Window is visible

var width

The width of the Window

Methods

def addElement(

child)

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)

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(

)

Returns a list of all contained controls.

class UVIslandBakerMap

UVIsland Baker Map Settings

Ancestors (in MRO)

Class variables

var enableSVGUVIsland

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

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 WireframeBakerMap

Wireframe Baker Map Settings

Ancestors (in MRO)

Class variables

var enabled

Whether or not this Baker Map should render when baking.

var lineThickness

The thickness of the UV wireframe lines.

var suffix

The output suffix of the current Baker Map.

var vertexRadius

The radius of each vertex of the UV wireframe.

var wireframeColor

Wireframe color as an RGB array.

Methods

def resetSuffix(

)

Resets the current map suffix to its default.