Module mset

Marmoset Toolbag's Python bindings.

Global variables

var callbacks

Global callbacks that you can assign for this plugin.

Functions

def bakeAll()

Bakes all objects in the scene.

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 exportGLTF(path: str = '', quality: 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. 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 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 getAllMaterials() ‑> List[Material]

Returns all materials as a list.

def getAllObjects() ‑> List[SceneObject]

Returns all scene Objects as a list.

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

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)

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

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

Callbacks

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

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 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 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 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 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 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, filename: str }

def removeAsset(name: str)

Remove an asset from your current library distribution.

class LightObject

Light Object

Ancestors

Instance variables

var brightness

The brightness of the light.

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 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 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", "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

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

The maximum number of bounces a ray can perform.

var rayTraceCaustics

Whether caustics light paths are allowed 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. Can be 'low', 'medium', or 'high'.

var rayTraceDiffuseIntensity

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

var rayTraceRadianceClamp

The maximum 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 useRasterOcclusion

Whether screen space ambient occlusion is enabled in raster rendering.

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 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", "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 fadeTexturePath

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

var opacity

The opacity of the shadow catcher.

var skyShadow

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

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 blur

The amount of blurring for the background.

var brightness

The brightness of the skybox.

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)

Renders a preview of the texture, at the given resolution. 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.

Methods

def addContentChild(contentType: str) ‑> TextureProjectLayer

Get a parameter in this layer's mask.

def addMaskChild(maskType: str) ‑> TextureProjectLayer

Set a given parameter for this layer's mask.

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

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

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 grungeScale

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

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 contrast

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.

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 smoothing

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 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 path of the texture project exports.

var outputWidth

The width in pixels of exported texture project textures.

var paddingSize

UV padding size in pixels.

var previewUndersample

The preview resolution undersampling scale, meant to improve performance at the cost of quality with the formula resolution / previewUndersample.

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 useUVPadding

Whether to use UV padding when generating textures.

var viewportQuality

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

var viewportUndersample

The viewport resolution scale. meant to improve performance at the cost of quality with the formula resolution / previewUndersample.

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, rgb: str, a: str)

Add a output map for this texture project.

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

var format

The type of output map, RGB+A or R+G+B+A.

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 extension type for this output map.

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.

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

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