Skip to content
AlphaToolBox3D is in early alpha: features are incomplete and things can break. Use it at your own risk and keep copies of your files. Report a problem
ToolBox3D

Docs · Python API

tb.ops.texture

100 operations. Without targets=, an operation works on the current selection, like its button in the editor.

Create Texture

tb.ops.texture.create(
    *,
    name: str = "Texture",
    width: int = 1024,
    height: int = 1024,
    color: Color4 = ...,
    data: str = ...,
) -> Result

Create a texture in the scene's library: a blank image of one color (width × height, sRGB color with alpha), or from encoded PNG / JPEG / WebP data (base64, a data: URL works). A name already in use gets a numeric suffix. One undo step.

  • Operation texture.create
  • In Model, Texture Paint
ArgumentTypeDefaultDescription
namestr"Texture"Name.
widthint10241..8192 (blank textures).
heightint10241..8192 (blank textures).
colorColor4—sRGB color and alpha, 0..1 (default white).
datastr—Encoded image data (base64 or a data: URL) instead of a color.

Export Texture

tb.ops.texture.export(
    *,
    texture: str,
    delivery: Literal["inline", "chunks"] = "inline",
) -> Result

Read a texture's image: stored bytes unchanged, RGBA8 as PNG, or float pixels as lossless HALF/FLOAT OpenEXR, base64-encoded with a file name. Read-only; bounded host replies may omit large files.

  • Operation texture.export
  • In Previewer, Model, Control Rig, Animation, Texture Paint
ArgumentTypeDefaultDescription
texturestrrequiredTexture id or name.
deliveryLiteral["inline", "chunks"]"inline"Use chunks for large files and bounded MCP replies; release the request after delivery. (inline / chunks).

Release Texture Export

tb.ops.texture.export.cancel(*, request: str) -> Result
  • Operation texture.export.cancel
  • In Previewer, Model, Control Rig, Animation, Texture Paint
ArgumentTypeDefaultDescription
requeststrrequiredRequest.

Read Texture Export Bytes

tb.ops.texture.export.read(
    *,
    request: str,
    offset: int = 0,
    length: int = 49152,
) -> Result

Read at most 48 KiB as base64 with offset/length/total/eof. Release the same request with texture.export.cancel after delivery.

  • Operation texture.export.read
  • In Previewer, Model, Control Rig, Animation, Texture Paint
ArgumentTypeDefaultDescription
requeststrrequiredRequest.
offsetint0Offset (0…2147483648).
lengthint49152Length (1…49152).

Get Texture Export Status

tb.ops.texture.export.status(*, request: str) -> Result
  • Operation texture.export.status
  • In Previewer, Model, Control Rig, Animation, Texture Paint
ArgumentTypeDefaultDescription
requeststrrequiredRequest.

Import Texture

tb.ops.texture.import_(*, staged: str) -> Result

Add an image (PNG, JPEG) to the scene's texture library; materials can then use it. The image bytes are stored verbatim. A name already in use gets a numeric suffix.

  • Operation texture.import
  • In Model, Texture Paint
ArgumentTypeDefaultDescription
stagedstrrequiredToken from tb_api::stage_texture.

Paint Advisories

tb.ops.texture.paint.advisories() -> Result

What changed since each texture set was painted: its UVs, the faces using it, the material inputs under the paint, or another texture set sharing its layers.

  • Operation texture.paint.advisories
  • In Texture Paint

Import Alpha Tip

tb.ops.texture.paint.alpha.add(*, name: str = "Alpha", data: str) -> Result

Add an image as a brush tip (transparent images use their alpha, opaque ones their darkness). Returns its index; texture.paint.brush.set {tipMode: 'stamp', tipIndex} uses it.

  • Operation texture.paint.alpha.add
  • In Texture Paint
ArgumentTypeDefaultDescription
namestr"Alpha"Name.
datastrrequiredEncoded PNG / JPEG / WebP (base64 or a data: URL).

List Alpha Tips

tb.ops.texture.paint.alpha.list() -> Result

The brush tip library: the built-in tips, then the imported ones. A tip's index is the brush tipIndex that stamps with it.

  • Operation texture.paint.alpha.list
  • In Texture Paint

Remove Alpha Tip

tb.ops.texture.paint.alpha.remove(*, index: int) -> Result

Remove an imported tip (built-in tips stay). A brush stamping with it goes back to the round tip; later tips move down one index.

  • Operation texture.paint.alpha.remove
  • In Texture Paint
ArgumentTypeDefaultDescription
indexintrequiredIndex.

Accept Bake

tb.ops.texture.paint.bake.accept(
    *,
    material: MaterialRef,
    executor: Literal["auto", "gpu", "cpu"] = ...,
) -> Result

Keep the open bake: its GPU result when ready, else baked now on the CPU. One undo step.

  • Operation texture.paint.bake.accept
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.
executorLiteral["auto", "gpu", "cpu"]—auto (default): the GPU result of an open bake when it is ready, else the CPU; gpu: refuse without a GPU result; cpu: always bake on the CPU. (auto / gpu / cpu).

Cancel Bake

tb.ops.texture.paint.bake.cancel(*, material: MaterialRef) -> Result

Close the open bake of a texture set without keeping it (its GPU job stops).

  • Operation texture.paint.bake.cancel
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.

Import Mesh Map

tb.ops.texture.paint.bake.import_(
    *,
    material: MaterialRef,
    map: Literal["idMap", "ambientOcclusion", "curvature", "thickness", "normal", "position"] = "idMap",
    texture: str = ...,
    data: str = ...,
) -> Result

Use an image as a mesh map instead of baking it: an ID map painted or baked in another app, an AO map… Color Selection and the generators read it; re-bakes leave it alone. Importing the same map again replaces it. One undo step.

  • Operation texture.paint.bake.import
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.
mapLiteral["idMap", "ambientOcclusion", "curvature", "thickness", "normal", "position"]"idMap"The mesh map the image stands in for (default: the ID map). (idMap / ambientOcclusion / curvature / thickness / normal / position).
texturestr—A texture of the scene to use (its id or name).
datastr—Encoded PNG / JPEG / WebP image data (base64 or a data: URL) instead of a texture.

List Mesh-Map Bakes

tb.ops.texture.paint.bake.list() -> Result

The mesh-map bakes with their settings (keys, defaults, ranges) and the smart-mask generators built on them.

  • Operation texture.paint.bake.list
  • In Texture Paint

Open Bake

tb.ops.texture.paint.bake.open(
    *,
    material: MaterialRef,
    bake: str = ...,
    generator: str = ...,
    record: str = ...,
    layer: str = ...,
    output: Literal["mask", "texture", "channel"] = ...,
    into: str = ...,
    settings: Any = ...,
    channel: Literal["r", "g", "b", "luminance"] = ...,
    size: int = ...,
    popup: bool = True,
    auto_accept: bool = False,
) -> Result

Open a bake for a texture set: in Texture Paint it runs on the GPU in the background with progress (the bake dialog shows it); accept keeps it, cancel drops it.

  • Operation texture.paint.bake.open
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material).
bakestr—Bake id, e.g. 'ambientOcclusion' (texture.paint.bake.list). Default: the generator's bake, else curvature.
generatorstr—A smart-mask generator (edgeWear, cavityDirt, ambientDirt, thinParts, topDust, groundGrime, heightGradient): its bake, settings and mask levels.
recordstr—Re-bake this existing recipe (texture.paint.bake.records) instead of adding a new one.
layerstr—Smart masks: the layer that gets the mask.
outputLiteral["mask", "texture", "channel"]—Where the bake goes. Default: a smart mask for maskable bakes, else a texture. 'channel': a new paint layer holding the bake (gray) on the user channel 'into'. (mask / texture / channel).
intostr—Output 'channel': the user channel key (user0 … user7, or userColor0 … userColor7 for the RGB) the bake is painted into.
settingsAny—Bake settings by key (texture.paint.bake.list → params). Missing keys use the defaults; unknown keys and out-of-range values are refused.
channelLiteral["r", "g", "b", "luminance"]—RGBA bakes (position, normal): the component the smart mask reads. (r / g / b / luminance).
sizeint—Texture output size (default: the stack resolution; masks always use it).
popupboolTrueShow the bake dialog (false keeps it headless).
auto_acceptboolFalseIn Texture Paint, keep the bake as soon as its GPU result is ready (no accept call).

Re-bake

tb.ops.texture.paint.bake.rebake(
    *,
    material: MaterialRef,
    all: bool = False,
    records: Any = ...,
    executor: Literal["auto", "gpu", "cpu"] = ...,
) -> Result

Re-bake the stale recipes (or all, or the named ones) after a UV or mesh change. One undo step.

  • Operation texture.paint.bake.rebake
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.
allboolFalseRe-bake every recipe, not only the stale ones.
recordsAny—Re-bake exactly these recipe ids.
executorLiteral["auto", "gpu", "cpu"]—auto (default): the GPU result of an open bake when it is ready, else the CPU; gpu: refuse without a GPU result; cpu: always bake on the CPU. (auto / gpu / cpu).

List Bake Recipes

tb.ops.texture.paint.bake.records(*, material: MaterialRef) -> Result

A texture set's bake recipes (smart masks and mesh-map textures) and whether each is stale (its UV layout or surface changed).

  • Operation texture.paint.bake.records
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.

Bake

tb.ops.texture.paint.bake.run(
    *,
    material: MaterialRef,
    bake: str = ...,
    generator: str = ...,
    record: str = ...,
    layer: str = ...,
    output: Literal["mask", "texture", "channel"] = ...,
    into: str = ...,
    settings: Any = ...,
    channel: Literal["r", "g", "b", "luminance"] = ...,
    size: int = ...,
    executor: Literal["auto", "gpu", "cpu"] = ...,
) -> Result

Bake a smart mask (on 'layer') or a mesh-map texture and keep it, in one call. One undo step.

  • Operation texture.paint.bake.run
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material).
bakestr—Bake id, e.g. 'ambientOcclusion' (texture.paint.bake.list). Default: the generator's bake, else curvature.
generatorstr—A smart-mask generator (edgeWear, cavityDirt, ambientDirt, thinParts, topDust, groundGrime, heightGradient): its bake, settings and mask levels.
recordstr—Re-bake this existing recipe (texture.paint.bake.records) instead of adding a new one.
layerstr—Smart masks: the layer that gets the mask.
outputLiteral["mask", "texture", "channel"]—Where the bake goes. Default: a smart mask for maskable bakes, else a texture. 'channel': a new paint layer holding the bake (gray) on the user channel 'into'. (mask / texture / channel).
intostr—Output 'channel': the user channel key (user0 … user7, or userColor0 … userColor7 for the RGB) the bake is painted into.
settingsAny—Bake settings by key (texture.paint.bake.list → params). Missing keys use the defaults; unknown keys and out-of-range values are refused.
channelLiteral["r", "g", "b", "luminance"]—RGBA bakes (position, normal): the component the smart mask reads. (r / g / b / luminance).
sizeint—Texture output size (default: the stack resolution; masks always use it).
executorLiteral["auto", "gpu", "cpu"]—auto (default): the GPU result of an open bake when it is ready, else the CPU; gpu: refuse without a GPU result; cpu: always bake on the CPU. (auto / gpu / cpu).

Set Bake Settings

tb.ops.texture.paint.bake.set(
    *,
    material: MaterialRef,
    settings: Any = ...,
    channel: Literal["r", "g", "b", "luminance"] = ...,
) -> Result

Change the open bake's settings and / or mask channel; it restarts.

  • Operation texture.paint.bake.set
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.
settingsAny—Settings to change (others keep their values).
channelLiteral["r", "g", "b", "luminance"]—RGBA bakes (position, normal): the component the smart mask reads. (r / g / b / luminance).

Bake State

tb.ops.texture.paint.bake.state(*, material: MaterialRef) -> Result

The open bake of a texture set: bake, settings, progress (0…1), where it runs, whether its result is ready, errors.

  • Operation texture.paint.bake.state
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.

Refresh Paint Base

tb.ops.texture.paint.base.refresh(*, material: MaterialRef) -> Result

Rebuild the Base the layers paint over from the material's current color, roughness, metallic, emission and texture maps. One undo step.

  • Operation texture.paint.base.refresh
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.

Get Brush

tb.ops.texture.paint.brush.get() -> Result

Read the Texture Paint brush settings (size, strength, flow, hardness, spacing, angle, dynamics, jitter, smoothing, stabiliser, symmetry …).

  • Operation texture.paint.brush.get
  • In Texture Paint

Set Brush

tb.ops.texture.paint.brush.set(*, brush: Any) -> Result

Change the brush with a partial patch of its settings, e.g. {"size": 32, "hardness": 0.8}. Values are validated; nothing changes on an error.

  • Operation texture.paint.brush.set
  • In Texture Paint
ArgumentTypeDefaultDescription
brushAnyrequiredPartial brush settings (texture.paint.brush.get shows every field).

Paint With Material

tb.ops.texture.paint.brush.use_material(*, source: MaterialRef) -> Result

The swatch of a material's PBR values — base color (sRGB), opacity, roughness, metallic, emission — for the brush to paint every channel at once (Texture Paint applies it to the primary swatch and enables its channels).

  • Operation texture.paint.brush.use_material
  • In Texture Paint
ArgumentTypeDefaultDescription
sourceMaterialRefrequiredThe material to paint with.

Add User Channel

tb.ops.texture.paint.channel.add(
    *,
    material: MaterialRef,
    name: str = ...,
    color: bool = False,
) -> Result

Add a user channel to a texture set (at most eight): gray, or color with 'color'. It is painted, filled and exported like the built-in channels (export tokens user0 …, userColor0.r / .g / .b …) but never drives the material.

  • Operation texture.paint.channel.add
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
namestr—Display name (at most 48 characters, unique in the set).
colorboolFalseA color (RGB) channel instead of a gray one.

Add Material Channel

tb.ops.texture.paint.channel.add_material(
    *,
    material: MaterialRef,
    kind: Literal["clearcoat", "clearcoatRoughness", "sheen", "sheenRoughness", "anisotropy", "transmission", "thickness", "subsurface"],
) -> Result

Add a channel that drives a material input: Clear Coat, Sheen, Anisotropy, Transmission, Thickness, Subsurface and their kin. It paints, fills and exports like any channel (it takes one of the eight user slots), shows live in the viewport while painting, and publishing writes it into the material's slot.

  • Operation texture.paint.channel.add_material
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
kindLiteral["clearcoat", "clearcoatRoughness", "sheen", "sheenRoughness", "anisotropy", "transmission", "thickness", "subsurface"]requiredKind (clearcoat / clearcoatRoughness / sheen / sheenRoughness / anisotropy / transmission / thickness / subsurface).

Remove User Channel

tb.ops.texture.paint.channel.remove(
    *,
    material: MaterialRef,
    channel: Literal["user0", "user1", "user2", "user3", "user4", "user5", "user6", "user7", "userColor0", "userColor1", "userColor2", "userColor3", "userColor4", "userColor5", "userColor6", "userColor7"],
) -> Result

Remove a user channel and everything painted or filled on it.

  • Operation texture.paint.channel.remove
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
channelLiteral["user0", "user1", "user2", "user3", "user4", "user5", "user6", "user7", "userColor0", "userColor1", "userColor2", "userColor3", "userColor4", "userColor5", "userColor6", "userColor7"]requiredThe user channel's key (user0 … user7, userColor0 … userColor7); it never changes when the channel is renamed.

Rename User Channel

tb.ops.texture.paint.channel.rename(
    *,
    material: MaterialRef,
    channel: Literal["user0", "user1", "user2", "user3", "user4", "user5", "user6", "user7", "userColor0", "userColor1", "userColor2", "userColor3", "userColor4", "userColor5", "userColor6", "userColor7"],
    name: str,
) -> Result

Rename a user channel. Only the display name changes: its key (user0 …) and export presets stay as they are.

  • Operation texture.paint.channel.rename
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
channelLiteral["user0", "user1", "user2", "user3", "user4", "user5", "user6", "user7", "userColor0", "userColor1", "userColor2", "userColor3", "userColor4", "userColor5", "userColor6", "userColor7"]requiredThe user channel's key (user0 … user7, userColor0 … userColor7); it never changes when the channel is renamed.
namestrrequiredDisplay name (at most 48 characters, unique in the set).

Set Clone Source

tb.ops.texture.paint.clone.set(
    *,
    source: Any | None = ...,
    aligned: bool = ...,
    mode: Literal["offset", "cloneUv"] = ...,
    sample_layer: str = ...,
) -> Result

The Clone tool's source: an offset from the source point (UV; null clears it; Aligned keeps the offset between strokes) or the mesh's clone UV map (the same surface point laid out there).

  • Operation texture.paint.clone.set
  • In Texture Paint
ArgumentTypeDefaultDescription
sourceAny | None—[u, v] or null.
alignedbool—Aligned.
modeLiteral["offset", "cloneUv"]—offset: copy from the source point at the stroke's distance; cloneUv: copy the same surface point from the mesh's clone UV map (UV map role Clone). (offset / cloneUv).
sample_layerstr—'active' copies the layer being painted (default); a layer id copies that layer's channels.

Place Decal

tb.ops.texture.paint.decal.place(
    *,
    material: MaterialRef,
    layer: str = ...,
    texture: str = ...,
    point: Any,
    normal: Any,
    up: Any = ...,
    width: float,
    aspect: float = ...,
    angle: float = 0.0,
    depth: float = ...,
    max_angle: float = 80.0,
    opacity: float = 1.0,
    image_color: bool = True,
    tile: bool = False,
    swatch: Any = ...,
    channels: Any = ...,
) -> Result

Project an image onto the surface into a paint layer (one undo step): anchored at a surface point, facing along its normal, with the image upright towards 'up'.

  • Operation texture.paint.decal.place
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.
layerstr—Paint layer (default: the top paint layer).
texturestr—The decal image (a document texture id). Without one the decal is a square of the swatch.
pointAnyrequiredAnchor on the surface, paint space [x, y, z].
normalAnyrequiredProjection direction out of the surface [x, y, z].
upAny—Image up [x, y, z] (default +Y).
widthfloatrequiredDecal width in paint units. (0.000001…1000000).
aspectfloat—Height / width (default: the image's). (0.001…1000).
anglefloat0.0Rotation about the normal, degrees.
depthfloat—Half thickness of the projection slab (default: half the width).
max_anglefloat80.0Faces turned further from the normal are not painted. (0…180).
opacityfloat1.0Opacity (0…1).
image_colorboolTruePaint the image's colors (off: the swatch color through the image alpha).
tileboolFalseTile.
swatchAny—Values of the other channels (and the color when imageColor is off).
channelsAny—Channels written (default: base color).

Add Layer Filter

tb.ops.texture.paint.effect.add(
    *,
    material: MaterialRef,
    layer: str,
    filter: Literal["blur", "sharpen", "warp", "mosaic", "directionalBlur", "slopeBlur", "directionalWarp", "bevel", "leaks", "edgeDamage", "bakedLighting", "highPass", "glow", "edgeDetect", "dilate", "erode", "median", "unsharpMask", "outline", "dropShadow", "innerShadow", "thresholdScan", "bandSelect", "heightToNormal", "hueSaturation", "brightnessContrast", "levels", "curves", "invert", "threshold", "posterize", "clamp", "grayscale", "colorBalance", "gradientMap", "replaceColor", "normalInvert", "exposure", "channelMixer", "valueShift", "sCurveContrast", "rangeCompress", "materialEffect"],
    params: Any = ...,
) -> Result

Add a filter to a layer: blur, sharpen, hue/saturation, brightness/contrast, levels, curves or invert. It changes how the layer looks without touching its paint. One undo step.

  • Operation texture.paint.effect.add
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer.
filterLiteral["blur", "sharpen", "warp", "mosaic", "directionalBlur", "slopeBlur", "directionalWarp", "bevel", "leaks", "edgeDamage", "bakedLighting", "highPass", "glow", "edgeDetect", "dilate", "erode", "median", "unsharpMask", "outline", "dropShadow", "innerShadow", "thresholdScan", "bandSelect", "heightToNormal", "hueSaturation", "brightnessContrast", "levels", "curves", "invert", "threshold", "posterize", "clamp", "grayscale", "colorBalance", "gradientMap", "replaceColor", "normalInvert", "exposure", "channelMixer", "valueShift", "sCurveContrast", "rangeCompress", "materialEffect"]requiredFilter.
paramsAny—Blur: radius 1 to 128 px; Sharpen: radius 1 to 128 px, amount 0 to 4; Warp: strength 1 to 64 px, scale 4 to 256 px, seed 0 to 65535; Mosaic: cell 2 to 256 px; Directional Blur: angle 0 to 360°, distance 1 to 32 px; Slope Blur: distance 1 to 32 px; Directional Warp: angle 0 to 360°, distance 1 to 64 px; Bevel: width 1 to 16 px, amount 0 to 1, roundness 0 to 1; Leaks: length 1 to 64 px, lengthRandom 0 to 1, streaks 1 to 64; Edge Damage: width 1 to 32 px, amount 0 to 1, scale 1 to 64, seed 0 to 65535; Baked Lighting: angle 0 to 360°, elevation 5 to 90°, depth 0 to 32; High Pass: radius 1 to 128 px; Glow: radius 1 to 128 px, amount 0 to 4, threshold 0 to 1; Edge Detect: strength 0 to 16; Dilate: radius 1 to 128 px; Erode: radius 1 to 128 px; Median: radius 1 to 16 px; Unsharp Mask: radius 1 to 128 px, amount 0 to 4, threshold 0 to 1; Outline: width 1 to 128 px, position (0 Outside, 1 Center, 2 Inside); Drop Shadow: angle 0 to 360°, distance 0 to 64 px, softness 0 to 128 px, opacity 0 to 1, color (RGB color); Inner Shadow: angle 0 to 360°, distance 0 to 64 px, softness 0 to 128 px, opacity 0 to 1, color (RGB color); Threshold Scan: position 0 to 1, contrast 0 to 1; Band Select: position 0 to 1, range 0 to 1, contrast 0 to 1; Height to Normal: intensity 0 to 10; Hue / Saturation: hue -180 to 180°, saturation 0 to 4, value 0 to 4; Brightness / Contrast: brightness -1 to 1, contrast -1 to 1; Levels: inBlack 0 to 1 per RGB channel, inWhite 0 to 1 per RGB channel, gamma 0.01 to 10 per RGB channel, outBlack 0 to 1 per RGB channel, outWhite 0 to 1 per RGB channel; Curves: master (curve points x0, y0, x1, y1, ...), red (curve points x0, y0, x1, y1, ...), green (curve points x0, y0, x1, y1, ...), blue (curve points x0, y0, x1, y1, ...); Invert Channels: amount 0 to 1 per RGB channel; Threshold: level 0 to 1; Posterize: levels 2 to 64; Clamp Channels: min 0 to 1, max 0 to 1; Grayscale: weights 0 to 2 per RGB channel; Color Balance: shadows (RGB color), midtones (RGB color), highlights (RGB color); Gradient Map: low (RGB color), high (RGB color), stops (gradient stops position, r, g, b, ... at least two); Replace Color: from (RGB color), to (RGB color), tolerance 0 to 1, softness 0 to 1; Exposure: exposure -10 to 10 EV; Channel Mixer: red -2 to 2 per RGB channel, green -2 to 2 per RGB channel, blue -2 to 2 per RGB channel; Value Shift: shift -1 to 1; S-Curve Contrast: amount -1 to 1; Range Compress: range 0 to 1, position 0 to 1; Material Effect: effect (0 Dust, 1 Dirt, 2 Edge Wear, 3 Rust, 4 Snow, 5 Moss, 6 Color Variation, 7 Water Stains, 8 Burn, 9 Paint Peeling), amount 0 to 1, contrast 0 to 1, breakup 0 to 1, scale 1 to 256, seed 0 to 65535, strength 0 to 1.

Remove Layer Filter

tb.ops.texture.paint.effect.remove(
    *,
    material: MaterialRef,
    layer: str,
    effect: str,
) -> Result

Remove a filter from a layer. One undo step.

  • Operation texture.paint.effect.remove
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer.
effectstrrequiredEffect.

Set Layer Filter

tb.ops.texture.paint.effect.set(
    *,
    material: MaterialRef,
    layer: str,
    effect: str,
    params: Any = ...,
    enabled: bool = ...,
) -> Result

Change a layer filter's parameters (merged into the existing ones) or switch it on or off. Slider drags merge into one undo step.

  • Operation texture.paint.effect.set
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer.
effectstrrequiredEffect.
paramsAny—Params.
enabledbool—Enabled.

Export Textures

tb.ops.texture.paint.export(
    *,
    preset: str = ...,
    custom: Any = ...,
    materials: Any = ...,
    scale: float = 1.0,
    format: Literal["png8", "png16", "jpeg", "tga", "tiff8", "tiff16", "tiff32", "bmp", "webp", "exr", "hdr"] = "png8",
    padding: Any = ...,
    normal_convention: Literal["opengl", "directx"] = ...,
    height_range: Any = ...,
    pattern: str = ...,
    zip: bool = False,
    download: bool = False,
    job_id: str = ...,
) -> Result

Pack and encode the painted maps of one or more texture sets with a preset (glTF ORM, Unreal-style, Unity URP / HDRP, separate maps …). With download, Texture Paint hands the files (or one ZIP) to you.

  • Operation texture.paint.export
  • In Texture Paint
ArgumentTypeDefaultDescription
presetstr—Export preset id, e.g. 'gltfOrm' (texture.paint.export.presets).
customAny—A user export preset instead of 'preset': {id: 'user.…', label, normal, outputs: [{id, suffix, channels: [R, G, B, A tokens or null], colorSpace, optional}]}.
materialsAny—Texture sets (material ids) to export. Default: every painted material.
scalefloat1.0Size relative to each texture set: 0.25, 0.5, 1 or 2.
formatLiteral["png8", "png16", "jpeg", "tga", "tiff8", "tiff16", "tiff32", "bmp", "webp", "exr", "hdr"]"png8"Format (png8 / png16 / jpeg / tga / tiff8 / tiff16 / tiff32 / bmp / webp / exr / hdr).
paddingAny—Edge padding around UV islands: "full" (default, fills the image), "none" or {"texels": N}.
normal_conventionLiteral["opengl", "directx"]—Normal map green direction (default: as the preset writes it). (opengl / directx).
height_rangeAny—Height mapped to black and white: [min, max] (default [-1, 1]).
patternstr—File names with {material}, {suffix}, {preset} and {resolution} (default {material}_{suffix}).
zipboolFalseAlso bundle every file in one ZIP.
downloadboolFalseHand the files to the user (browser download; a folder in Pictures on Windows).
job_idstr—Your id for this export (texture.paint.export.cancel). Default: generated.

Cancel Texture Export

tb.ops.texture.paint.export.cancel(*, job_id: str) -> Result

Drop a finished export that was not delivered yet.

  • Operation texture.paint.export.cancel
  • In Texture Paint
ArgumentTypeDefaultDescription
job_idstrrequiredJob Id.

Predict Texture Export

tb.ops.texture.paint.export.predict(
    *,
    preset: str = ...,
    custom: Any = ...,
    materials: Any = ...,
    scale: float = 1.0,
    format: Literal["png8", "png16", "jpeg", "tga", "tiff8", "tiff16", "tiff32", "bmp", "webp", "exr", "hdr"] = "png8",
    padding: Any = ...,
    normal_convention: Literal["opengl", "directx"] = ...,
    height_range: Any = ...,
    pattern: str = ...,
    zip: bool = False,
) -> Result

The files an export would write — names, sizes, channel packing, skipped optional maps — without writing them.

  • Operation texture.paint.export.predict
  • In Texture Paint
ArgumentTypeDefaultDescription
presetstr—Export preset id, e.g. 'gltfOrm' (texture.paint.export.presets).
customAny—A user export preset instead of 'preset': {id: 'user.…', label, normal, outputs: [{id, suffix, channels: [R, G, B, A tokens or null], colorSpace, optional}]}.
materialsAny—Texture sets (material ids) to export. Default: every painted material.
scalefloat1.0Size relative to each texture set: 0.25, 0.5, 1 or 2.
formatLiteral["png8", "png16", "jpeg", "tga", "tiff8", "tiff16", "tiff32", "bmp", "webp", "exr", "hdr"]"png8"Format (png8 / png16 / jpeg / tga / tiff8 / tiff16 / tiff32 / bmp / webp / exr / hdr).
paddingAny—Edge padding around UV islands: "full" (default, fills the image), "none" or {"texels": N}.
normal_conventionLiteral["opengl", "directx"]—Normal map green direction (default: as the preset writes it). (opengl / directx).
height_rangeAny—Height mapped to black and white: [min, max] (default [-1, 1]).
patternstr—File names with {material}, {suffix}, {preset} and {resolution} (default {material}_{suffix}).
zipboolFalseAlso bundle every file in one ZIP.

Texture Export Presets

tb.ops.texture.paint.export.presets() -> Result

The texture export presets (built-ins, then plugin presets): outputs (file suffix, color space) and how each packs the painted channels into R, G, B and A.

  • Operation texture.paint.export.presets
  • In Texture Paint

Export Textures…

tb.ops.texture.paint.export_dialog(*, preset: str = ...) -> Result

Open the Export Textures dialog (presets, packed-channel previews, options).

  • Operation texture.paint.export_dialog
  • In Texture Paint
ArgumentTypeDefaultDescription
presetstr—Preset selected when the dialog opens.

Fill

tb.ops.texture.paint.fill(
    *,
    material: MaterialRef,
    layer: str = ...,
    mask: str = ...,
    mode: Literal["layer", "island", "face", "materialSlot"] = "layer",
    uv: Any = ...,
    path: Any = ...,
    view: Any = ...,
    swatch: Any = ...,
    channels: Any = ...,
    blend: str = ...,
) -> Result

Fill a paint layer (or one of its masks) with a swatch: the whole layer, or the UV island / face / material slot at a UV point. Unset parameters come from the tool session: the paint target, the primary swatch, the written channels and blend; the paint restriction applies. One undo step.

  • Operation texture.paint.fill
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set.
layerstr—Paint layer (default: the session's paint target, else the top paint layer).
maskstr—Fill this mask of the layer instead of its pixels (value = the swatch's base-color luminance).
modeLiteral["layer", "island", "face", "materialSlot"]"layer"Mode (layer / island / face / materialSlot).
uvAny—The picked point as UV [u, v] (island / face / material slot modes).
pathAny—Fill only inside this closed path: the control points of a smooth curve (the Path tool), in UV [u, v] (v down the texture), or in view pixels with 'view'.
viewAny—The view a 'path' in pixels was drawn in: {"viewProj": 16 numbers (paint space to clip, column-major), "size": [w, h], "eye": [x, y, z, w] (camera position with w = 1, or the direction to it with w = 0)}. Only the surface the view sees is filled.
swatchAny—Channel values over the session's primary swatch, e.g. {"baseColor": [0.8, 0.1, 0.1], "roughness": 0.3} (base color sRGB 0..1).
channelsAny—Channels written, e.g. ["baseColor", "roughness"] (default: the session's channels).
blendstr—Blend mode id (default: the session's blend).

Material Fill Layer

tb.ops.texture.paint.fill.material(
    *,
    staged: str = ...,
    material: MaterialRef,
    source: MaterialRef = ...,
    layer: str = ...,
    placement: ObjectRef = ...,
    mapping: Any = ...,
    parameters: Any = ...,
    mask: Literal["none", "black", "white"] = "none",
    name: str = ...,
    parent: str = ...,
    index: int = ...,
) -> Result

Add a fill layer that shows a material projected onto the texture set (UV, object-axis planar, tri-planar or decal mapping), or change an existing one's material / mapping. With mask 'black' it becomes a material layer: paint its mask to reveal the material in every channel. One undo step.

  • Operation texture.paint.fill.material
  • In Texture Paint
ArgumentTypeDefaultDescription
stagedstr—Prepared material raster result token.
materialMaterialRefrequiredThe texture set (material) being painted.
sourceMaterialRef—The material the fill shows (default: the layer's current source).
layerstr—Change this fill layer instead of adding one.
placementObjectRef—When several objects place the mesh: the one world and object projections use (default: the active selected one).
mappingAny—Projection: {"type": "uv", "offset", "scale", "rotation"} · {"type": "triplanar", "space": "world"|"object", "scale", "blend"} · {"type": "object", "axis": "x"|"y"|"z", "scale"} · {"type": "decal", "transforms" (1 to 8 boxes of 16, box → world; a later box lies over an earlier one), "maxAngle", "tile"}.
parametersAny—This fill's own values for the source material's parameters, by parameter id ({"<id>": value}; null goes back to the material's value). Merged onto the layer's current values; a new source material starts from none.
maskLiteral["none", "black", "white"]"none"New layers: add a paint mask (black = reveal by painting). (none / black / white).
namestr—New layers: the name (default: the material's).
parentstr—New layers: the group to add into.
indexint—New layers: position from the bottom. (0…1024).

Refresh Material Fills

tb.ops.texture.paint.fill.refresh(
    *,
    staged: str = ...,
    material: MaterialRef,
    layers: Any = ...,
    placement: ObjectRef = ...,
) -> Result

Re-project the texture set's material fills (all, or the named layers) after their source material or the mesh changed. One undo step.

  • Operation texture.paint.fill.refresh
  • In Texture Paint
ArgumentTypeDefaultDescription
stagedstr—Prepared material raster result token.
materialMaterialRefrequiredMaterial.
layersAny—Layer ids (default: every material fill).
placementObjectRef—When several objects place the mesh: the one world and object projections use (default: the active selected one).

Add Paint Layer

tb.ops.texture.paint.layer.add(
    *,
    material: MaterialRef,
    kind: Literal["paint", "fill", "group", "adjustment"] = "paint",
    name: str = ...,
    parent: str = ...,
    index: int = ...,
    op: Literal["hueSaturation", "brightnessContrast", "levels", "curves", "invert"] = "hueSaturation",
    params: Any = ...,
    values: Any = ...,
) -> Result

Add a paint, fill, group or adjustment layer to a texture set (on top of its parent unless an index is given).

  • Operation texture.paint.layer.add
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
kindLiteral["paint", "fill", "group", "adjustment"]"paint"Kind (paint / fill / group / adjustment).
namestr—Layer name (default by kind).
parentstr—Group to add into (default: the root).
indexint—Position from the bottom (default: top). (0…1024).
opLiteral["hueSaturation", "brightnessContrast", "levels", "curves", "invert"]"hueSaturation"Adjustment layers: the adjustment. (hueSaturation / brightnessContrast / levels / curves / invert).
paramsAny—Adjustment parameters, e.g. {"hue": 30}.
valuesAny—Fill layers: channel values, e.g. {"baseColor": [0.8, 0.2, 0.1], "roughness": 0.4} (base color sRGB 0..1).

Clear Paint Layer

tb.ops.texture.paint.layer.clear(*, material: MaterialRef, layer: str) -> Result

Erase every painted pixel of a paint layer (its masks stay).

  • Operation texture.paint.layer.clear
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer id.

Convert to Paint Layer

tb.ops.texture.paint.layer.convert_to_paint(
    *,
    material: MaterialRef,
    layer: str,
) -> Result

Replace a fill layer with a paint layer holding the same pixels, so it can be painted on. Name, blend, opacity, channel switches, masks and filters stay. One undo step.

  • Operation texture.paint.layer.convert_to_paint
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer id.

Copy Paint Layers

tb.ops.texture.paint.layer.copy(
    *,
    material: MaterialRef,
    layer: str = ...,
    layers: Any = ...,
) -> Result

Copy layers (groups with their contents) to the layer clipboard. They paste into any texture set.

  • Operation texture.paint.layer.copy
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstr—Layer id.
layersAny—Several layer ids.

Cut Paint Layers

tb.ops.texture.paint.layer.cut(
    *,
    material: MaterialRef,
    layer: str = ...,
    layers: Any = ...,
) -> Result

Copy layers to the layer clipboard and delete them from this texture set.

  • Operation texture.paint.layer.cut
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstr—Layer id.
layersAny—Several layer ids.

Duplicate Paint Layers

tb.ops.texture.paint.layer.duplicate(
    *,
    material: MaterialRef,
    layer: str = ...,
    layers: Any = ...,
) -> Result

Copy layers (groups with their contents), each directly above itself. Painted tiles are shared until either copy is painted.

  • Operation texture.paint.layer.duplicate
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstr—Layer id.
layersAny—Several layer ids.

Export Layer

tb.ops.texture.paint.layer.export(
    *,
    material: MaterialRef,
    layer: str,
    download: bool = True,
) -> Result

Export one layer's channels as 8-bit PNGs (straight color, coverage in alpha) in one ZIP: the layer alone with its masks, at Normal 100 %. With download, Texture Paint hands the ZIP to you.

  • Operation texture.paint.layer.export
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer id.
downloadboolTrueHand the ZIP to the user (browser download; a folder in Pictures on Windows).

Flatten Paint Layer

tb.ops.texture.paint.layer.flatten(*, material: MaterialRef, layer: str) -> Result

Turn a paint or fill layer's content, filters and mask into plain paint. Its blend mode and opacity stay.

  • Operation texture.paint.layer.flatten
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer id.

Group Paint Layers

tb.ops.texture.paint.layer.group(
    *,
    material: MaterialRef,
    layer: str = ...,
    layers: Any = ...,
    name: str = "Group",
) -> Result

Put layers into a new group at the position of the topmost of them.

  • Operation texture.paint.layer.group
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstr—Layer id.
layersAny—Several layer ids (same parent).
namestr"Group"Name.

Instance Layer

tb.ops.texture.paint.layer.instance(
    *,
    material: MaterialRef,
    layer: str,
    into: MaterialRef = ...,
) -> Result

Add a layer that shows a paint layer or a material fill live, with its own blend, opacity, masks and filters. Painting the source changes the instance too, also in another texture set ('into'); removing the source leaves the instance as paint with its last look.

  • Operation texture.paint.layer.instance
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer id.
intoMaterialRef—The texture set that gets the instance (default: the layer's own set). Both sets need the same UDIM layout.

Merge Down

tb.ops.texture.paint.layer.merge_down(*, material: MaterialRef, layer: str) -> Result

Merge a layer into the paint layer directly below it. The result keeps the lower layer's name, blend, opacity and masks; the look does not change when the lower layer is Normal at 100 %.

  • Operation texture.paint.layer.merge_down
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer id.

Merge Group

tb.ops.texture.paint.layer.merge_group(*, material: MaterialRef, layer: str) -> Result

Flatten a group into one paint layer at its place, keeping the group's name, blend, opacity and masks.

  • Operation texture.paint.layer.merge_group
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer id.

Move Paint Layers

tb.ops.texture.paint.layer.move(
    *,
    material: MaterialRef,
    layer: str = ...,
    layers: Any = ...,
    parent: str = ...,
    index: int = ...,
) -> Result

Move layers to another position or into / out of a group. Several layers move as one block in their stack order; the index then counts the destination without them.

  • Operation texture.paint.layer.move
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstr—Layer id.
layersAny—Several layer ids.
parentstr—Destination group (empty: the root).
indexint—Position from the bottom within the destination (default: top). (0…1024).

Paste Paint Layers

tb.ops.texture.paint.layer.paste(
    *,
    material: MaterialRef,
    parent: str = ...,
    index: int = ...,
) -> Result

Paste the layer clipboard into a texture set. Painted layers follow its resolution; channels it does not paint are left out.

  • Operation texture.paint.layer.paste
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
parentstr—Group to paste into (default: the top level).
indexint—Position among the parent's children, 0 = bottom (default: on top).

Delete Paint Layers

tb.ops.texture.paint.layer.remove(
    *,
    material: MaterialRef,
    layer: str = ...,
    layers: Any = ...,
) -> Result

Delete layers (with everything inside groups), their masks and publications.

  • Operation texture.paint.layer.remove
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstr—Layer id.
layersAny—Several layer ids.

Rename Paint Layer

tb.ops.texture.paint.layer.rename(
    *,
    material: MaterialRef,
    layer: str,
    name: str,
) -> Result

Rename a layer.

  • Operation texture.paint.layer.rename
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer id.
namestrrequiredName.

Set Paint Layer Properties

tb.ops.texture.paint.layer.set(
    *,
    material: MaterialRef,
    layer: str = ...,
    layers: Any = ...,
    visible: bool = ...,
    locked: bool = ...,
    opacity: float = ...,
    blend: Literal["normal", "darken", "multiply", "colorBurn", "lighten", "screen", "colorDodge", "add", "overlay", "softLight", "linearLight", "difference", "subtract", "divide", "replace", "disable", "inverseDivide", "inverseSubtract", "exclusion", "linearBurn", "hardLight", "vividLight", "pinLight", "hue", "saturation", "color", "luminosity", "passThrough"] = ...,
    normal_blend: Literal["combine", "replace"] = ...,
    height_blend: Literal["mix", "add", "subtract", "max"] = ...,
    masks_enabled: bool = ...,
    height_mask: Any = ...,
    mask_background: Literal["white", "black"] = ...,
    color_tag: int = ...,
    channels: Any = ...,
    values: Any = ...,
) -> Result

Change a layer's visibility, lock, opacity, blend modes, mask switch or per-channel state. Slider drags merge into one undo step.

  • Operation texture.paint.layer.set
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstr—Layer id.
layersAny—Several layer ids: each gets the same change.
visiblebool—Visible.
lockedbool—A locked layer refuses paint.
opacityfloat—Opacity (0…1).
blendLiteral["normal", "darken", "multiply", "colorBurn", "lighten", "screen", "colorDodge", "add", "overlay", "softLight", "linearLight", "difference", "subtract", "divide", "replace", "disable", "inverseDivide", "inverseSubtract", "exclusion", "linearBurn", "hardLight", "vividLight", "pinLight", "hue", "saturation", "color", "luminosity", "passThrough"]—How the color and scalar channels combine with the layers below.
normal_blendLiteral["combine", "replace"]—Normal Blend (combine / replace).
height_blendLiteral["mix", "add", "subtract", "max"]—Height Blend (mix / add / subtract / max).
masks_enabledbool—Masks Enabled.
height_maskAny—Mask with height: { "contrast": 0..64, "offset": -1..1 }, the mask's soft edge follows the layer's Height; null turns it off.
mask_backgroundLiteral["white", "black"]—Where the layer mask's effects start: white shows the layer, black hides it. (white / black).
color_tagint—Color tag on the layer row: 0 none, 1-8 red, orange, yellow, green, teal, blue, purple, pink. (0…8).
channelsAny—Per-channel state, e.g. {"roughness": {"enabled": false, "opacity": 1}} (null removes the override).
valuesAny—Color fill layers: the channel values, e.g. {"baseColor": [0.8, 0.2, 0.1], "roughness": 0.4} (base color sRGB 0..1).

Ungroup Paint Layers

tb.ops.texture.paint.layer.ungroup(*, material: MaterialRef, layer: str) -> Result

Move a group's layers to its parent (in place) and delete the group.

  • Operation texture.paint.layer.ungroup
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer id.

Add Layer Mask

tb.ops.texture.paint.mask.add(
    *,
    material: MaterialRef,
    layer: str,
    kind: Literal["paint", "image", "generator", "anchor", "levels", "invert", "compare"] = "paint",
    clear: Literal["white", "black"] = "white",
    texture: str = ...,
    value: float = ...,
    generator: Literal["edgeWear", "cavity", "aoDirt", "thinParts", "topDust", "gradient", "grime", "colorSelection", "clouds", "cells", "scratches", "woodGrain", "weave", "brushedStreaks", "grunge", "bricks", "StreakNoise", "SpotsNoise", "RoundSpots", "Speckles", "CrystalPlates", "CrystalShards", "DirtNoise", "DustSpecks", "FurNoise", "SmoothValueNoise", "StainsNoise", "GrimeNoise", "StreakyGrunge", "LiquidNoise", "DampPatches", "PlasmaNoise", "ValueNoise", "DirectionalNoise", "FibersNoise", "MessyFibers", "LeatherNoise", "CellularTissue", "SoftSpots", "CrackleNoise", "SandDunes", "WoodRings", "MarbleNoise", "StonesNoise", "RipplesNoise", "ConcreteNoise", "BarkNoise", "SimplexNoise", "CracksNoise", "MirroredGradient", "Hexagons", "Polygon", "ShapePattern", "Star", "Stripes", "GridLines", "DotGrid", "DiamondTiles", "Herringbone", "Basketweave", "Chevron", "FishScales", "TriangleTiles", "Spiral", "Rings", "AxialGradient", "CrossShape", "RoundedRectangle", "RingShape", "FanPavement", "OctagonTiles", "Planks", "TreadPlate", "TilePattern", "Splatter", "ScratchesScatter", "PaintStrokes", "RustMask", "MossMask", "ShapeScatter", "PatternScatter", "TileScatter", "FloodFill", "ScratchField", "LeaksMask", "EdgeDamage"] = ...,
    params: Any = ...,
    anchor: str = ...,
    channel: str = ...,
    component: Literal["luminance", "r", "g", "b"] = ...,
) -> Result

Add an effect to a layer's mask: paint (the first one sets the mask's background: white reveals, black hides), image, generator or anchor point, or Levels / Invert / Compare on the mask so far.

  • Operation texture.paint.mask.add
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer id.
kindLiteral["paint", "image", "generator", "anchor", "levels", "invert", "compare"]"paint"Kind (paint / image / generator / anchor / levels / invert / compare).
clearLiteral["white", "black"]"white"Value of the unpainted mask. (white / black).
texturestr—Image masks: the texture id.
valuefloat—Compare: white where the mask so far is above this value. (0…1).
generatorLiteral["edgeWear", "cavity", "aoDirt", "thinParts", "topDust", "gradient", "grime", "colorSelection", "clouds", "cells", "scratches", "woodGrain", "weave", "brushedStreaks", "grunge", "bricks", "StreakNoise", "SpotsNoise", "RoundSpots", "Speckles", "CrystalPlates", "CrystalShards", "DirtNoise", "DustSpecks", "FurNoise", "SmoothValueNoise", "StainsNoise", "GrimeNoise", "StreakyGrunge", "LiquidNoise", "DampPatches", "PlasmaNoise", "ValueNoise", "DirectionalNoise", "FibersNoise", "MessyFibers", "LeatherNoise", "CellularTissue", "SoftSpots", "CrackleNoise", "SandDunes", "WoodRings", "MarbleNoise", "StonesNoise", "RipplesNoise", "ConcreteNoise", "BarkNoise", "SimplexNoise", "CracksNoise", "MirroredGradient", "Hexagons", "Polygon", "ShapePattern", "Star", "Stripes", "GridLines", "DotGrid", "DiamondTiles", "Herringbone", "Basketweave", "Chevron", "FishScales", "TriangleTiles", "Spiral", "Rings", "AxialGradient", "CrossShape", "RoundedRectangle", "RingShape", "FanPavement", "OctagonTiles", "Planks", "TreadPlate", "TilePattern", "Splatter", "ScratchesScatter", "PaintStrokes", "RustMask", "MossMask", "ShapeScatter", "PatternScatter", "TileScatter", "FloodFill", "ScratchField", "LeaksMask", "EdgeDamage"]—Generator masks: which generator (a mesh-map generator or pattern, or a Material Editor noise, pattern or weathering mask by its node type).
paramsAny—Generator masks: {amount, contrast, breakup (0..1), scale (1..256), axis (0|1|2), seed, color (Color Selection: 0xRRGGBB or [r, g, b] 0..1)}; for a node-type generator its own parameters by key, seed, choice (an option index, or the option id under its choice key such as shape), and for an image source (LeaksMask, EdgeDamage, the scatters, FloodFill, ScratchField) input: what it reads, an option index or label (Raised Edges, Cavities, Occlusion; Everywhere or Splatter for the built-in one).
anchorstr—Anchor masks: the layer whose result the mask reads (below the masked layer).
channelstr—Anchor masks: the channel read (default height).
componentLiteral["luminance", "r", "g", "b"]—Anchor masks: the component of a color or normal channel (default luminance). (luminance / r / g / b).

Apply Mask

tb.ops.texture.paint.mask.apply(
    *,
    material: MaterialRef,
    layer: str,
    mask: str,
) -> Result

Bake a mask into its paint layer's pixels (pixels × mask), then remove the mask. One undo step.

  • Operation texture.paint.mask.apply
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer id.
maskstrrequiredMask id (on the layer).

Add Geometry Mask

tb.ops.texture.paint.mask.geometry(
    *,
    material: MaterialRef,
    layer: str,
    scope: Literal["island", "face", "materialSlot"],
    ids: Any,
) -> Result

Show a layer only on whole parts of the mesh: adds a mask that is white on the parts (UV islands, faces or material slots) and black elsewhere.

  • Operation texture.paint.mask.geometry
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.
layerstrrequiredLayer id.
scopeLiteral["island", "face", "materialSlot"]requiredScope (island / face / materialSlot).
idsAnyrequiredPart ids of the scope, e.g. [0, 3].

Delete Layer Mask

tb.ops.texture.paint.mask.remove(
    *,
    material: MaterialRef,
    layer: str,
    mask: str,
) -> Result

Delete a mask and anything published from it.

  • Operation texture.paint.mask.remove
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer id.
maskstrrequiredMask.

Set Layer Mask

tb.ops.texture.paint.mask.set(
    *,
    material: MaterialRef,
    layer: str,
    mask: str,
    enabled: bool = ...,
    opacity: float = ...,
    blend: Literal["multiply", "add", "subtract", "replace", "max", "min"] = ...,
    invert: bool = ...,
    black: float = ...,
    white: float = ...,
    gamma: float = ...,
    generator: Literal["edgeWear", "cavity", "aoDirt", "thinParts", "topDust", "gradient", "grime", "colorSelection", "clouds", "cells", "scratches", "woodGrain", "weave", "brushedStreaks", "grunge", "bricks", "StreakNoise", "SpotsNoise", "RoundSpots", "Speckles", "CrystalPlates", "CrystalShards", "DirtNoise", "DustSpecks", "FurNoise", "SmoothValueNoise", "StainsNoise", "GrimeNoise", "StreakyGrunge", "LiquidNoise", "DampPatches", "PlasmaNoise", "ValueNoise", "DirectionalNoise", "FibersNoise", "MessyFibers", "LeatherNoise", "CellularTissue", "SoftSpots", "CrackleNoise", "SandDunes", "WoodRings", "MarbleNoise", "StonesNoise", "RipplesNoise", "ConcreteNoise", "BarkNoise", "SimplexNoise", "CracksNoise", "MirroredGradient", "Hexagons", "Polygon", "ShapePattern", "Star", "Stripes", "GridLines", "DotGrid", "DiamondTiles", "Herringbone", "Basketweave", "Chevron", "FishScales", "TriangleTiles", "Spiral", "Rings", "AxialGradient", "CrossShape", "RoundedRectangle", "RingShape", "FanPavement", "OctagonTiles", "Planks", "TreadPlate", "TilePattern", "Splatter", "ScratchesScatter", "PaintStrokes", "RustMask", "MossMask", "ShapeScatter", "PatternScatter", "TileScatter", "FloodFill", "ScratchField", "LeaksMask", "EdgeDamage"] = ...,
    params: Any = ...,
    anchor: str = ...,
    channel: str = ...,
    component: Literal["luminance", "r", "g", "b"] = ...,
    anchor_generator: Literal["none", "edgeWear", "cavity"] = ...,
) -> Result

Change a mask's switch, opacity, blend, inversion, levels, or its generator and parameters. Slider drags merge into one undo step.

  • Operation texture.paint.mask.set
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredLayer id.
maskstrrequiredMask.
enabledbool—Enabled.
opacityfloat—Opacity (0…1).
blendLiteral["multiply", "add", "subtract", "replace", "max", "min"]—Blend (multiply / add / subtract / replace / max / min).
invertbool—Invert.
blackfloat—Black (0…1).
whitefloat—White (0…1).
gammafloat—Gamma (0.01…10).
generatorLiteral["edgeWear", "cavity", "aoDirt", "thinParts", "topDust", "gradient", "grime", "colorSelection", "clouds", "cells", "scratches", "woodGrain", "weave", "brushedStreaks", "grunge", "bricks", "StreakNoise", "SpotsNoise", "RoundSpots", "Speckles", "CrystalPlates", "CrystalShards", "DirtNoise", "DustSpecks", "FurNoise", "SmoothValueNoise", "StainsNoise", "GrimeNoise", "StreakyGrunge", "LiquidNoise", "DampPatches", "PlasmaNoise", "ValueNoise", "DirectionalNoise", "FibersNoise", "MessyFibers", "LeatherNoise", "CellularTissue", "SoftSpots", "CrackleNoise", "SandDunes", "WoodRings", "MarbleNoise", "StonesNoise", "RipplesNoise", "ConcreteNoise", "BarkNoise", "SimplexNoise", "CracksNoise", "MirroredGradient", "Hexagons", "Polygon", "ShapePattern", "Star", "Stripes", "GridLines", "DotGrid", "DiamondTiles", "Herringbone", "Basketweave", "Chevron", "FishScales", "TriangleTiles", "Spiral", "Rings", "AxialGradient", "CrossShape", "RoundedRectangle", "RingShape", "FanPavement", "OctagonTiles", "Planks", "TreadPlate", "TilePattern", "Splatter", "ScratchesScatter", "PaintStrokes", "RustMask", "MossMask", "ShapeScatter", "PatternScatter", "TileScatter", "FloodFill", "ScratchField", "LeaksMask", "EdgeDamage"]—Generator masks: switch the generator.
paramsAny—Generator masks: parameters to change.
anchorstr—Anchor masks: read another layer (below the masked layer).
channelstr—Anchor masks: the channel read.
componentLiteral["luminance", "r", "g", "b"]—Anchor masks: the component of a color or normal channel. (luminance / r / g / b).
anchor_generatorLiteral["none", "edgeWear", "cavity"]—Anchor masks: run a generator on the anchor's curvature instead of reading its value; 'params' then sets amount, contrast, breakup, scale and seed. (none / edgeWear / cavity).

Prepare Material Raster

tb.ops.texture.paint.material.prepare_raster(
    *,
    operation: Literal["texture.paint.fill.material", "texture.paint.fill.refresh"],
    params: Any,
) -> Result
  • Operation texture.paint.material.prepare_raster
  • In Texture Paint
ArgumentTypeDefaultDescription
operationLiteral["texture.paint.fill.material", "texture.paint.fill.refresh"]requiredOperation (texture.paint.fill.material / texture.paint.fill.refresh).
paramsAnyrequiredParams.

Material Fill Status

tb.ops.texture.paint.material.status(*, material: MaterialRef) -> Result

The texture set's material fills: layer, source material (and whether it still exists), mapping and the channels it holds.

  • Operation texture.paint.material.status
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.

Add Path Layer

tb.ops.texture.paint.path.add(
    *,
    material: MaterialRef,
    points: Any = ...,
    closed: bool = ...,
    fill: bool = ...,
    view: Any = ...,
    brush: Any = ...,
    swatch: Any = ...,
    staged: int = ...,
    name: str = ...,
    above: str = ...,
    channels: Any = ...,
    blend: str = ...,
    material_brush: str = ...,
    paint: bool = True,
) -> Result

Paint a path as its own layer: a stroke of the session's brush along a smooth curve through the control points (or the fill inside it), kept editable (texture.paint.path.set) and saved with the document. One undo step.

  • Operation texture.paint.path.add
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
pointsAny—The control points: UV [u, v] (v down the texture) for a path in the UV view, or paint-space positions [x, y, z] on the model.
closedbool—The curve returns to its first point.
fillbool—Fill the inside of the closed curve instead of painting along it (three or more points, Closed on).
viewAny—The camera a path on the model is painted through: {"viewProj": 16 numbers (paint space to clip, column-major), "size": [w, h], "eye": [x, y, z, w]}. Required for points on the model.
brushAny—Brush settings over the path's (new path: the session's), e.g. {"size": 24}.
swatchAny—Channel values over the path's (new path: the session's primary swatch).
stagedint—Token of the path painted by Texture Paint's GPU engine on the emptied layer (its staged tiles become the layer's pixels); without it the path is painted here on the CPU. (1…9007199254740991).
namestr—Layer name (default: Path 1, Path 2, …).
abovestr—Place the layer above this one (default: above the session's paint target, else on top).
channelsAny—Channels written (default: the session's).
blendstr—Blend mode id of the stroke (default: the session's).
material_brushstr—Paint every channel of this material (default: the session's material brush; an empty string paints the swatch).
paintboolTruePaint the path now; false leaves the layer empty for a staged commit (texture.paint.path.set with staged).

Edit Path

tb.ops.texture.paint.path.set(
    *,
    material: MaterialRef,
    layer: str,
    points: Any = ...,
    closed: bool = ...,
    fill: bool = ...,
    view: Any = ...,
    brush: Any = ...,
    swatch: Any = ...,
    staged: int = ...,
) -> Result

Change a path layer's control points, Closed, stroke or fill, view, brush or swatch; the layer paints its path again. One undo step.

  • Operation texture.paint.path.set
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredThe path layer.
pointsAny—The control points: UV [u, v] (v down the texture) for a path in the UV view, or paint-space positions [x, y, z] on the model.
closedbool—The curve returns to its first point.
fillbool—Fill the inside of the closed curve instead of painting along it (three or more points, Closed on).
viewAny—The camera a path on the model is painted through: {"viewProj": 16 numbers (paint space to clip, column-major), "size": [w, h], "eye": [x, y, z, w]}. Required for points on the model.
brushAny—Brush settings over the path's (new path: the session's), e.g. {"size": 24}.
swatchAny—Channel values over the path's (new path: the session's primary swatch).
stagedint—Token of the path painted by Texture Paint's GPU engine on the emptied layer (its staged tiles become the layer's pixels); without it the path is painted here on the CPU. (1…9007199254740991).

Get Picker Options

tb.ops.texture.paint.picker.options.get() -> Result

Read this session's source, sample footprint and picker application options.

  • Operation texture.paint.picker.options.get
  • In Texture Paint

Set Picker Options

tb.ops.texture.paint.picker.options.set(
    *,
    source: Literal["composite", "layer"] = ...,
    sample_size: int = ...,
    all_channels: bool = ...,
    keep_active: bool = ...,
    expected_revision: int = ...,
) -> Result

Atomically patch session picker options; no authored Undo or project data changes.

  • Operation texture.paint.picker.options.set
  • In Texture Paint
ArgumentTypeDefaultDescription
sourceLiteral["composite", "layer"]—Source (composite / layer).
sample_sizeint—Square footprint width: 1, 3 or 5 texels.
all_channelsbool—Apply all available source channels; false applies Base Color only.
keep_activebool—Keep the explicitly selected picker active after a successful pick.
expected_revisionint—Apply only while the session snapshot has this revision; stale patches fail atomically.

Keep Painting on Changed Geometry

tb.ops.texture.paint.provenance.accept(*, material: MaterialRef) -> Result

Record the texture set's current UVs and faces as the ones it is painted on, so the drift notices stop. One undo step.

  • Operation texture.paint.provenance.accept
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.

Keep Strokes on Changed Geometry

tb.ops.texture.paint.provenance.keep_strokes(
    *,
    material: MaterialRef,
    staged: int = ...,
) -> Result

Move everything painted to where the same place on the surface lies now, after the UVs or the mesh changed (a reimport, a new unwrap). Fills re-rasterise; baked maps go stale. One undo step.

  • Operation texture.paint.provenance.keep_strokes
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.
stagedint—Token of strokes a worker already moved (the Keep Strokes button); scripts leave it out and the move runs in the call. (1…9007199254740991).

Clear Quick Mask

tb.ops.texture.paint.quick_mask.clear(*, material: MaterialRef) -> Result

Delete the texture set's quick mask; strokes in the mask start from empty again.

  • Operation texture.paint.quick_mask.clear
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.

Set Quick Mask

tb.ops.texture.paint.quick_mask.set(
    *,
    material: MaterialRef,
    enabled: bool = ...,
    editing: bool = ...,
    inverted: bool = ...,
) -> Result

Switch the quick mask: 'enabled' keeps strokes and fills inside the mask, 'editing' makes strokes paint the mask (and enables it), 'inverted' uses where the mask is not painted. Omitted switches stay as they are.

  • Operation texture.paint.quick_mask.set
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.
enabledbool—Enabled.
editingbool—Editing.
invertedbool—Inverted.

Clear Paint Restriction

tb.ops.texture.paint.restriction.clear() -> Result

Lift the paint restriction.

  • Operation texture.paint.restriction.clear
  • In Texture Paint

Restrict Painting

tb.ops.texture.paint.restriction.set(
    *,
    material: MaterialRef,
    scope: Literal["island", "face", "materialSlot"],
    ids: Any,
) -> Result

Paint only here: strokes and fills of the texture set reach only these UV islands, faces or material slots (scope ids as texture.paint.restriction ids; session state, not saved).

  • Operation texture.paint.restriction.set
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.
scopeLiteral["island", "face", "materialSlot"]requiredScope (island / face / materialSlot).
idsAnyrequiredScope ids, e.g. [0, 3].

Sample Paint

tb.ops.texture.paint.sample(
    *,
    material: MaterialRef,
    uv: Any,
    source: Literal["composite", "layer", "idMap"] = ...,
    layer: str = ...,
    sample_size: int = ...,
    all_channels: bool = ...,
    set_color: bool = ...,
) -> Result

Pick the channel values under a UV: the composited stack, or one layer's own values. Source and size default to the picker options; setColor puts the pick into the primary swatch.

  • Operation texture.paint.sample
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.
uvAnyrequired[u, v] in 0..1.
sourceLiteral["composite", "layer", "idMap"]—idMap: the ID color under the UV (Color Selection's eyedropper) as idColor 0xRRGGBB. (composite / layer / idMap).
layerstr—Layer of a 'layer' pick (default: the top paint layer).
sample_sizeint—1, 3 or 5 texels per side.
all_channelsbool—setColor applies every channel (default: the picker option) or base color only.
set_colorbool—Put the pick into the primary swatch.

Apply Smart Material

tb.ops.texture.paint.smart.apply(
    *,
    material: MaterialRef,
    smart: Any,
    parent: str = ...,
    index: int = ...,
) -> Result

Insert a smart material as a group: a built-in id (texture.paint.smart.list) or a saved smart material's JSON. One undo step. missingMaps names the mesh maps its generators read that the texture set has not baked (bake them for the coats to land where they should).

  • Operation texture.paint.smart.apply
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
smartAnyrequiredA built-in id string, or a smart material object.
parentstr—Group to insert into (default: the root).
indexint—Index among the parent's children (default: on top).

Extract Smart Material

tb.ops.texture.paint.smart.extract(
    *,
    material: MaterialRef,
    layer: str,
    name: str = ...,
) -> Result

A group as smart-material JSON, to keep in the user's library and apply to other texture sets.

  • Operation texture.paint.smart.extract
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
layerstrrequiredThe group.
namestr—Name (default: the group's).

List Smart Materials

tb.ops.texture.paint.smart.list() -> Result

The built-in smart materials: layer groups of fills and live generators that adapt to the mesh maps.

  • Operation texture.paint.smart.list
  • In Texture Paint

Convert to UDIM Tiles

tb.ops.texture.paint.stack.convert_udim(*, material: MaterialRef) -> Result

Turn a one-texture set into a UDIM set covering every tile its UVs reach. What is painted stays as tile 1001, texel for texel (the size becomes the tile size); the other tiles start empty. Baked mesh maps go stale and fills re-rasterise.

  • Operation texture.paint.stack.convert_udim
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.

Set Up Painting

tb.ops.texture.paint.stack.create(
    *,
    material: MaterialRef,
    resolution: int = 2048,
    uv_map: str = ...,
    add_layer: bool = True,
    udim: Literal["off", "on", "auto"] = "off",
) -> Result

Give a material paint layers (a texture set). The material's current color, roughness, metallic, emission and texture maps become the Base the layers paint over.

  • Operation texture.paint.stack.create
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
resolutionint2048Pixel size of the paint layers (square). 2K suits most assets; 4K for hero detail. (512…8192).
uv_mapstr—The UV map the layers are painted in (default: the active UV map of the material's meshes, else "UVMap").
add_layerboolTrueAdd a first, empty paint layer.
udimLiteral["off", "on", "auto"]"off"Paint every UDIM tile the UVs reach (1001, 1002, …): the resolution is then per tile and Export Textures writes one image per tile. 'auto' uses UDIM tiles when the UVs span several and the atlas fits. (off / on / auto).

Prepare Texture Set

tb.ops.texture.paint.stack.ensure(
    *,
    material: MaterialRef,
    resolution: int = ...,
) -> Result

Give a material its texture set with one empty paint layer, if it has none: UDIM tiles when its UVs reach beyond 1001. What Texture Paint does on entering.

  • Operation texture.paint.stack.ensure
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
resolutionint—Size (per tile with UDIM tiles). (512…8192).

Get Paint Stack

tb.ops.texture.paint.stack.get(*, material: MaterialRef) -> Result

Read a texture set's paint stack: layers, masks, channels, resolution and tile ids (no pixels).

  • Operation texture.paint.stack.get
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.

Update Painted Textures

tb.ops.texture.paint.stack.publish(
    *,
    material: MaterialRef,
    force: bool = False,
) -> Result

Write the texture set's composited channels as textures (base color + opacity, ORM, normal, emission) so every editor and every export shows the painting. Runs automatically when you leave Texture Paint or save; does nothing when the textures are current unless forced.

  • Operation texture.paint.stack.publish
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) to publish.
forceboolFalsePublish even when the textures are already current.

Set Paint Resolution

tb.ops.texture.paint.stack.set_resolution(
    *,
    material: MaterialRef,
    resolution: int,
) -> Result

Change the pixel size of a texture set. Every painted layer and mask is resampled (box filter when shrinking, bilinear when growing, in linear light, premultiplied by coverage).

  • Operation texture.paint.stack.set_resolution
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
resolutionintrequiredNew size (square): 512, 1024, 2048, 4096 or 8192 (per tile in a UDIM set). (512…8192).

Set Tile Size

tb.ops.texture.paint.stack.udim_tile_size(
    *,
    material: MaterialRef,
    tile: int,
    size: int,
) -> Result

The resolution one UDIM tile paints and exports at: the set's tile size or a power-of-two step below it, 16 px at least (0 = the tile size). The tile's paint and masks are resampled to it.

  • Operation texture.paint.stack.udim_tile_size
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
tileintrequiredUDIM number, e.g. 1002.
sizeintrequiredPixels; 0 = the tile size.

Set UDIM Tiles

tb.ops.texture.paint.stack.udim_tiles(*, material: MaterialRef, tiles: int) -> Result

Change how many UDIM tiles the set paints. Kept tiles stay as they are, tiles past the new count lose their pixels (reported in dropped: per UDIM number, the texels that held paint), and 0 turns UDIM off: tile 1001 becomes the one texture. One undo step; baked mesh maps go stale and fills re-rasterise.

  • Operation texture.paint.stack.udim_tiles
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
tilesintrequired0 turns UDIM off.

Set Stencil

tb.ops.texture.paint.stencil.set(
    *,
    texture: str | None = ...,
    center: Any = ...,
    size: Any = ...,
    angle: float = ...,
    opacity: float = ...,
    tile: bool = ...,
    invert: bool = ...,
    visible: bool = ...,
    preview_opacity: float = ...,
) -> Result

The Projection tool's stencil: a document image (null removes it), placement, mask opacity, tile and invert. Visibility and previewOpacity affect only its overlay, never brush coverage.

  • Operation texture.paint.stencil.set
  • In Texture Paint
ArgumentTypeDefaultDescription
texturestr | None—Texture id or null.
centerAny—Center.
sizeAny—Size.
anglefloat—Angle.
opacityfloat—Opacity.
tilebool—Tile.
invertbool—Invert.
visiblebool—Visible.
preview_opacityfloat—Preview Opacity (0…1).

Paint Stroke

tb.ops.texture.paint.stroke(
    *,
    material: MaterialRef,
    staged: int = ...,
    points: Any = ...,
    view: Any = ...,
    layer: str = ...,
    brush: Any = ...,
    swatch: Any = ...,
    channels: Any = ...,
    blend: str = ...,
    smooth: bool = False,
    closed: bool = False,
    erase: bool = False,
    material_brush: str = ...,
    brush_raster: str = ...,
    tool: Literal["brush", "clone", "smudge"] = "brush",
) -> Result

Paint one stroke as one undo step. Texture Paint commits what its GPU engine staged ('staged'); scripts pass 'points' in UV space ([u, v] or [u, v, pressure], v down the texture) and the stroke is painted with the session's brush, channels, blend and swatch, or every channel of the session's material brush. The commit is refused when the layer changed meanwhile.

  • Operation texture.paint.stroke
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredThe texture set (material) whose paint stack is edited.
stagedint—Token of a stroke the paint engine staged (interactive painting). (1…9007199254740991).
pointsAny—The stroke's points in UV space: [[u, v], …] or [[u, v, pressure], …] (pixels of 'view' when given).
viewAny—Paint through this camera instead of in UV space: 'points' are its pixels and brush sizes are in pixels. {"viewProj": 16 numbers (paint space to clip, column-major), "size": [w, h], "eye": [x, y, z, w] (camera position with w = 1, or the direction to it with w = 0)}.
layerstr—Paint layer (default: the session's paint target, else the top paint layer).
brushAny—Brush settings over the session's brush, e.g. {"size": 24, "hardness": 0.8} (size in texture pixels).
swatchAny—Channel values over the session's primary swatch.
channelsAny—Channels written (default: the session's channels; every channel with a material brush).
blendstr—Blend mode id (default: the session's blend).
smoothboolFalseTreat 'points' as the control points of a smooth curve (the Path tool).
closedboolFalseWith 'smooth': the curve returns to its first point.
eraseboolFalseErase instead of painting.
material_brushstr—Paint every channel of this material (default: the session's material brush; an empty string paints the swatch).
brush_rasterstr—Staged UV material fill of the material brush (texture.paint.material.prepare_raster) to paint from, rasterized off the UI thread; without it the stroke evaluates the material itself.
toolLiteral["brush", "clone", "smudge"]"brush"clone: lay down the session's Clone source (texture.paint.clone.set) instead of the swatch: an offset from the source point to the stroke's first point, or the same surface point in the clone UV map. smudge: drag the layer's content along the stroke with the session's Smudge strength (texture.paint.tool.set). A brush with hue / saturation / value jitter paints each frame's jittered swatch colour. (brush / clone / smudge).

Get Paint Swatches

tb.ops.texture.paint.swatch.get() -> Result

Read this session's complete primary and secondary swatches and revision.

  • Operation texture.paint.swatch.get
  • In Texture Paint

Reset Paint Swatches

tb.ops.texture.paint.swatch.reset(*, expected_revision: int = ...) -> Result

Restore factory black primary and white secondary values for this session.

  • Operation texture.paint.swatch.reset
  • In Texture Paint
ArgumentTypeDefaultDescription
expected_revisionint—Apply only while the session snapshot has this revision; stale patches fail atomically.

Set Paint Swatches

tb.ops.texture.paint.swatch.set(
    *,
    primary: Any = ...,
    secondary: Any = ...,
    expected_revision: int = ...,
) -> Result

Atomically patch primary and/or secondary channel values, preserving unedited channels. Base Color is sRGB; Normal is signed and normalized; emission is linear HDR.

  • Operation texture.paint.swatch.set
  • In Texture Paint
ArgumentTypeDefaultDescription
primaryAny—Partial channel patch for the primary swatch.
secondaryAny—Partial channel patch for the secondary swatch.
expected_revisionint—Apply only while the session snapshot has this revision; stale patches fail atomically.

Swap Paint Swatches

tb.ops.texture.paint.swatch.swap(*, expected_revision: int = ...) -> Result

Swap complete primary and secondary channel values for this session.

  • Operation texture.paint.swatch.swap
  • In Texture Paint
ArgumentTypeDefaultDescription
expected_revisionint—Apply only while the session snapshot has this revision; stale patches fail atomically.

Set Paint Target

tb.ops.texture.paint.target.set(
    *,
    material: MaterialRef,
    layer: str,
    mask: str = ...,
) -> Result

Choose the layer, or one of its masks, that strokes and fills of a texture set paint on.

  • Operation texture.paint.target.set
  • In Texture Paint
ArgumentTypeDefaultDescription
materialMaterialRefrequiredMaterial.
layerstrrequiredLayer.
maskstr—Paint on this mask of the layer.

Get Paint Tool Session

tb.ops.texture.paint.tool.get() -> Result

Read the active tool, its options, the brush, the paint targets, the restriction, the clone source and the stencil.

  • Operation texture.paint.tool.get
  • In Texture Paint

Set Paint Tool

tb.ops.texture.paint.tool.set(
    *,
    tool: Literal["paint", "eraser", "projection", "fill", "path", "smudge", "clone", "decal", "picker"] = ...,
    channels: Any = ...,
    blend: str = ...,
    fill_scope: Literal["layer", "island", "face", "materialSlot"] = ...,
    smudge_strength: float = ...,
    material_brush: str = ...,
) -> Result

Choose the tool and change its options: the channels Paint / Eraser / Fill write, the blend, what Fill fills, Smudge strength, Blur radius and sharpen.

  • Operation texture.paint.tool.set
  • In Texture Paint
ArgumentTypeDefaultDescription
toolLiteral["paint", "eraser", "projection", "fill", "path", "smudge", "clone", "decal", "picker"]—Tool (paint / eraser / projection / fill / path / smudge / clone / decal / picker).
channelsAny—Channel keys written, e.g. ["baseColor", "roughness"].
blendstr—Blend mode id, e.g. 'normal', 'multiply'.
fill_scopeLiteral["layer", "island", "face", "materialSlot"]—Fill Scope (layer / island / face / materialSlot).
smudge_strengthfloat—0..1.
material_brushstr—Paint with this material: Paint lays down every channel of it (base color, roughness, metallic, normal, …) instead of the swatch. An empty string paints with the swatch again.

Frame UV View

tb.ops.texture.paint.view.frame() -> Result

Frame the 0-1 UV tile in the 2D UV view.

  • Operation texture.paint.view.frame
  • In Texture Paint

Get Paint View

tb.ops.texture.paint.view.get() -> Result

Read the Texture Paint view layout and the 2D UV view options.

  • Operation texture.paint.view.get
  • In Texture Paint

Set Paint View

tb.ops.texture.paint.view.set(
    *,
    layout: Literal["3d", "split", "2d"] = ...,
    channel: str = ...,
    debug: Literal["off", "uv", "idMap", "ambientOcclusion", "curvature", "thickness", "position"] = ...,
    wireframe: bool = ...,
    islands: bool = ...,
    tiled: bool = ...,
    split_ratio: float = ...,
) -> Result

Show the 3D view, the 2D UV view or both side by side, and choose what the UV view displays.

  • Operation texture.paint.view.set
  • In Texture Paint
ArgumentTypeDefaultDescription
layoutLiteral["3d", "split", "2d"]—'3d' = the 3D view only, 'split' = 3D and the 2D UV view side by side, '2d' = the UV view only. (3d / split / 2d).
channelstr—Paint channel the UV view displays (baseColor, opacity, roughness, metallic, ambientOcclusion, normal, emission, or a user channel user0 … user7 / userColor0 … userColor7 (shown as its luminance), also shown on the model).
debugLiteral["off", "uv", "idMap", "ambientOcclusion", "curvature", "thickness", "position"]—A diagnostic display instead of the channel: the UV coordinates or a baked mesh map. Choosing a channel turns it off. (off / uv / idMap / ambientOcclusion / curvature / thickness / position).
wireframebool—Show the UV wireframe in the UV view.
islandsbool—Outline UV islands (seams and open borders) in the UV view.
tiledbool—Repeat the texture 3 × 3 around the 0-1 tile to check tiling seams.
split_ratiofloat—Share of the width given to the 3D view in 'split' (0.2-0.8).