Defining Custom Paint Tools Using the Painter Interface



The Painter Interface provides all necessary functions for developing custom Paint Tools. The Interface .thePainterInterface drives all its callbacks through user-defined functions. You need to implement the following functions:






These functions are callbacks in response to the paint system. They will be called as the users paints across a mesh.

To initialize these functions, you need to call thePainterInterface.ScriptFunctions method:

For Example

fn startStroke = print "Handle start stroke here"

fn paintStroke = print "Handle paint stroke here"

fn endStroke = print "Handle end stroke here"

fn cancelStroke = print "Handle cancel stroke here"

fn systemEnd = print "Handle system end here"

thePainterInterface.ScriptFunctions startStroke paintStroke endStroke cancelStroke systemEnd


Once you have established the connection the thePainterInterface, you will need to tell it what to paint on. This is done by calling the initializeNodes method.

For Example:

nodeList = $

thePainterInterface.initializeNodes 0 nodeList


Once you have set up the nodes, you need to tell the system when you want to start a paint session:



The Painter Interface will call your functions until you end the session. In order to finish painting, you should call



For a more advanced example of custom Paint Tools using thePainterInterface, please see the file Macro_PaintSpline.mcr. It shows a Painting tool which lets the user paint a spline on the surface of scene objects. Also see the different files shipping as external samples described under PainterInterface - External Samples

See also


PainterInterface - External Samples


How To ... Develop a Bitmap Painting Tool - 3D Painting