UtilityObj Class Reference

#include <utilapi.h>

Class Description

See also
Class Interface, Class IUtil.

Description:
3ds Max utility plug-ins are derived from this class. Methods are provided for editing the utilities parameters and responding to changes in the current selection set. An interface pointer is provided for calling the utility methods provided by MAX.

Note: Utility plug-ins are not a direct participant in the geometry pipeline system of 3ds Max in the same way modifiers or space warps are. For this reason, UtilityObj plug-ins are not suitable for modifying objects flowing down the pipeline. Use Modifier or WSModifier plug-ins for this purpose.

Also note: It is possible to create a utility plug-in that uses a modeless dialog box. When 3ds Max itself uses modeless dialogs, it disables input to the other open windows such as the Track View, the Materials Editor, etc. In this way, the user cannot perform some action that could disturb the operation of the modeless dialog. For example using Track View, a user could assign a different controller to a node, and a utility plug-in might be accessing keys from the node's previous controller. Since utility plug-ins cannot currently prevent the user from operating these other parts of MAX, developers need to be careful about the use of modeless dialogs.
+ Inheritance diagram for UtilityObj:

Public Member Functions

virtual ~UtilityObj ()
 
virtual void BeginEditParams (Interface *ip, IUtil *iu)=0
 
virtual void EndEditParams (Interface *ip, IUtil *iu)=0
 
virtual void SelectionSetChanged (Interface *ip, IUtil *iu)
 
virtual void DeleteThis ()=0
 
virtual void SetStartupParam (MSTR param)
 

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...
 

Constructor & Destructor Documentation

virtual ~UtilityObj ( )
inlinevirtual
Remarks
Destructor
64 { }

Member Function Documentation

virtual void BeginEditParams ( Interface ip,
IUtil iu 
)
pure virtual
Remarks
This method is called when the utility plug-in may be used in the Utility branch of the command panel. The plug-in may add rollup pages to the command panel in this method for example.
Parameters
ipAn interface pointer you may use to call methods of the Interface class.
iuAn interface pointer you may use to close the current utility in the command panel.
virtual void EndEditParams ( Interface ip,
IUtil iu 
)
pure virtual
Remarks
This method is called when the utility plug-in is done being used in the Utility branch of the command panel (for example if the user changes to the Create branch).
Parameters
ipAn interface pointer you may use to call methods of the Interface class.
iuAn interface pointer you may use to close the current utility in the command panel.
virtual void SelectionSetChanged ( Interface ip,
IUtil iu 
)
inlinevirtual
Remarks
This method is called when the selection set changes. A plug-in may implement this method to respond to this condition.
Parameters
ipAn interface pointer you may use to call methods of the Interface class.
iuAn interface pointer you may use to close the current utility in the command panel.
82 { UNUSED_PARAM(ip); UNUSED_PARAM(iu);}
#define UNUSED_PARAM(x)
Definition: BuildWarnings.h:18
virtual void DeleteThis ( )
pure virtual
Remarks
This method is called to delete the utility object allocated by ClassDesc::Create().

For example if the developer has used the new operator to allocate memory for their plug-in class they should implement this method as { delete this; } to delete the plug-in object.

In some cases it may be better to use a single static instance of the plug-in class and not allocate and deallocate memory. For example some of the sample utility plug-ins use a single static instance of their plug-in class. This is done so that if the user moves between branches in the command panel (goes into the Create branch and then returns to the Utility branch) all the utility plug-in parameters remain intact. If the memory was allocated and deallocated each time the parameter would be 'forgotten'. The samples that use a single static instance implement this method as {} (NULL). See the sample code in /MAXSDK/SAMPLES/UTILITIES/COLCLIP.CPP for an example.
virtual void SetStartupParam ( MSTR  param)
inlinevirtual
Remarks
This method is called after BeginEditParams() when the user starts the utility from the command line with the option -U and passes an argument to the utility.
Parameters
paramThe command line argument is passed here.
Default Implementation:
{}
106 {}