MAXScript Tools and Interaction with 3ds Max > Creating MAXScript Tools > Scripted Paint Tools >

# Defining Custom Paint Tools Using the Painter Interface

PainterInterface

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:

StartStroke

PaintStroke

EndStroke

CancelStroke

SystemEnd

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:
    thePainterInterface.startPaintSession()
The Painter Interface will call your functions until you end the session. In order to finish painting, you should call
    thePainterInterface.endPaintSession()

#### See Also

- PainterInterface

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