3ds Max C++ API Reference
IPainterCanvasInterface_V5 Class Referenceabstract

#include <IPainterInterface.h>

+ Inheritance diagram for IPainterCanvasInterface_V5:

Public Member Functions

virtual BOOL StartStroke ()=0
 This is called when the user start a pen stroke. More...
 
virtual BOOL PaintStroke (BOOL hit, IPoint2 mousePos, Point3 worldPoint, Point3 worldNormal, Point3 localPoint, Point3 localNormal, Point3 bary, int index, BOOL shift, BOOL ctrl, BOOL alt, float radius, float str, float pressure, INode *node, BOOL mirrorOn, Point3 worldMirrorPoint, Point3 worldMirrorNormal, Point3 localMirrorPoint, Point3 localMirrorNormal)=0
 This is called as the user strokes across the mesh or screen with the mouse down. More...
 
virtual BOOL EndStroke ()=0
 This is called as the user ends a strokes when the users has it set to always update. More...
 
virtual BOOL EndStroke (int ct, BOOL *hit, IPoint2 *mousePos, Point3 *worldPoint, Point3 *worldNormal, Point3 *localPoint, Point3 *localNormal, Point3 *bary, int *index, BOOL *shift, BOOL *ctrl, BOOL *alt, float *radius, float *str, float *pressure, INode **node, BOOL mirrorOn, Point3 *worldMirrorPoint, Point3 *worldMirrorNormal, Point3 *localMirrorPoint, Point3 *localMirrorNormal)=0
 This is called as the user ends a strokes when the users has it set to update on mouse up only. More...
 
virtual BOOL CancelStroke ()=0
 This is called as the user cancels a stroke by right clicking. More...
 
virtual BOOL SystemEndPaintSession ()=0
 This is called when the painter want to end a paint session for some reason. More...
 
virtual void PainterDisplay (TimeValue t, ViewExp *vpt, int flags)=0
 this is called when the painter updates the view ports this will let you do custom drawing if you need to More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

See also
Class IPainterInteface_V5
Description:
This is the Max5 version of a PainterCanvas. Any plugin that wants to be able to be painted on must sub class from this class or a later version of it. Basically this calls contains all the methods that deal with a paint stroke.

Member Function Documentation

◆ StartStroke()

virtual BOOL StartStroke ( )
pure virtual

This is called when the user start a pen stroke.

◆ PaintStroke()

virtual BOOL PaintStroke ( BOOL  hit,
IPoint2  mousePos,
Point3  worldPoint,
Point3  worldNormal,
Point3  localPoint,
Point3  localNormal,
Point3  bary,
int  index,
BOOL  shift,
BOOL  ctrl,
BOOL  alt,
float  radius,
float  str,
float  pressure,
INode node,
BOOL  mirrorOn,
Point3  worldMirrorPoint,
Point3  worldMirrorNormal,
Point3  localMirrorPoint,
Point3  localMirrorNormal 
)
pure virtual

This is called as the user strokes across the mesh or screen with the mouse down.

This only gets called if the interactive mode is off (the user has turned off Update on Mouse Up)

Parameters
hit- if this is a hit or not, since the user can paint off a mesh
mousePos- this is mouse coords of the current hit in view space
worldPoint- this is the hit point on the painted mesh in world space
worldNormal- this is the normal of the hit point on the painted mesh in world space
localPoint- this is the hit point on the painted mesh in local space of the mesh that was hit
localNormal- this is the normal of the hit point on the painted mesh in local space of the mesh that was hit
bary- this the barcentric coords of the hit point based on the face that was hit this may or may not be valid depending on the state of the stack. For instance if a paint modifier was below a MeshSmooth, the barycentric coords would be based on the MeshSmooth'ed mesh and not the mesh at the point of the paint modifier
index- the index of the face that was hit. See the warning in Point3 bary above.
shift,ctrl,alt- the state of the shift, alt, and ctrl keys when the point was hit
radius- of the radius of the brush when the point was hit, this is after all modifiers have been applied like pressure or predefined radius etc
str- of the strength of the brush when the point was hit, this is after all modifiers have been applied like pressure or predefined radius etc
pressure- if a pressure sensitive tablet is used this value will be the pressure of the stroke ranging from 0 to 1
node- this node that got hit
mirrorOn- whther the user had mirror on for the stroke, you can ignore the next for params if false
worldMirrorPoint- the mirrored world stroke pos
worldMirrorNormal- the mirrored world stroke normal
localMirrorPoint- the mirros local stroke pos
localMirrorNormal- the mirros local stroke normal

◆ EndStroke() [1/2]

virtual BOOL EndStroke ( )
pure virtual

This is called as the user ends a strokes when the users has it set to always update.

◆ EndStroke() [2/2]

virtual BOOL EndStroke ( int  ct,
BOOL *  hit,
IPoint2 mousePos,
Point3 worldPoint,
Point3 worldNormal,
Point3 localPoint,
Point3 localNormal,
Point3 bary,
int index,
BOOL *  shift,
BOOL *  ctrl,
BOOL *  alt,
float *  radius,
float *  str,
float *  pressure,
INode **  node,
BOOL  mirrorOn,
Point3 worldMirrorPoint,
Point3 worldMirrorNormal,
Point3 localMirrorPoint,
Point3 localMirrorNormal 
)
pure virtual

This is called as the user ends a strokes when the users has it set to update on mouse up only.

the canvas gets a list of all points, normals etc instead of one at a time

Parameters
ct- the number of elements in the following arrays
hit,mousePos,worldPoint,worldNormal,localPoint,localNormal,bary,index,shift,ctrl,alt,radius,str,pressure,node,mirrorOn,worldMirrorPoint,worldMirrorNormal,localMirrorPoint,localMirrorNormal
  • see PaintStroke() these are identical except they are arrays of values

◆ CancelStroke()

virtual BOOL CancelStroke ( )
pure virtual

This is called as the user cancels a stroke by right clicking.

◆ SystemEndPaintSession()

virtual BOOL SystemEndPaintSession ( )
pure virtual

This is called when the painter want to end a paint session for some reason.

◆ PainterDisplay()

virtual void PainterDisplay ( TimeValue  t,
ViewExp vpt,
int  flags 
)
pure virtual

this is called when the painter updates the view ports this will let you do custom drawing if you need to