Docs Visual

MaskDraw

Draw a mask with the mouse straight onto the image: a panel you paint in, with the mask and the masked image as outputs, a lock and a reset.

◧ Visual ◆ Patreon:Pro

This tool unlocks with Patreon. It installs through the same picker as everything else and unlocks with the Patreon Pro tier or higher, connected from inside TouchDesigner. Everything else in the toolkit stays free and MIT, and the membership is what keeps that work moving.

Join on Patreon → How unlocking works →

What it is

MaskDraw is a panel. Open it, and the input image is your canvas: paint with the left button, erase with the right, and the strokes accumulate into a mask. The mask comes out on its own and applied to the input (the input inside the painted area), so it can key a composite, drive a Level, or mark a projection surface. The panel follows the input's aspect. Middle-click resets the mask; Ctrl and middle-click toggles the button bar. Lock keeps a finished mask from being touched by a stray click or reset.

By default the mask lives in the running session and nothing is written into the file. Turn on Save Mask With Project and the mask is baked into the component on every project save (or right away with Bake Mask Now), and restored when the project is reopened. The baked texture is the size of the panel, so the file grows by a few megabytes.

It is a member of the FNS operator family: pick it from the FNS tab of the OP Create dialog and it lands as one node.

Inputs and outputs

  • in1 (TOP): the image to draw over.
  • out_mask (TOP): the drawn mask.
  • out_masked (TOP): the input inside the painted area.

Parameters

Custom

ControlType / defaultWhat it does
ActiveActive on / offoff Enables drawing. Off hides the brush and ignores the mouse; the painted mask is kept.
RadiusRadius number0.1 The brush radius, relative to the size of the mask.
Show InputShowinput on / offoff Shows the input image in the display panel behind the mask. Off shows the input only inside the painted area.
Show MaskShowmask on / offoff Draws the painted mask (white) over the image in the display panel.
Show BrushDebug on / offoff Shows the brush outline (red) under the pointer in the display panel.
Display UIDisplay on / offon Shows the button bar in the display panel. Ctrl + middle-click in the panel toggles it.
ResetReset on / offoff While on, clears the painted mask. A middle-click in the panel does the same. Ignored while Lock is on.
LockLock on / offoff Freezes the painted mask: new strokes, erasing and Reset are ignored until it is turned off. The mask lives in a feedback loop, so it is not saved with the file.
Save Mask With ProjectSavemask on / offoff On: the current mask is baked into the component on every project save (and by Bake Mask Now), so it is restored when the project is reopened. Off (default): the mask lives only in the session and nothing is written into the file.
Bake Mask NowBakemask button Capture the current mask into the component now, without waiting for a project save. Only with Save Mask With Project on.

Edit this page on GitHub →