Public Member Functions

UtilityObj Class Reference

This reference page is linked to from the following overview topics: Utility Plug-ins, Lesson 1: Sample utility plug-in, Lesson 3: the reference system, Lesson 7: Writing .Net Plug-ins, Overview: Class Hierarchy, Plug-in Base Classes, Parameter Editing on the Command Panel, Creating and Destroying Plug-in Instances, Writing Utility Plug-ins.


Search for all occurrences

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

#include <utilapi.h>

Inheritance diagram for UtilityObj:
Inheritance graph
[legend]

List of all members.

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)

Constructor & Destructor Documentation

virtual ~UtilityObj ( ) [inline, virtual]
Remarks:
Destructor
{ }

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:
ip An interface pointer you may use to call methods of the Interface class.
iu An 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:
ip An interface pointer you may use to call methods of the Interface class.
iu An interface pointer you may use to close the current utility in the command panel.
virtual void SelectionSetChanged ( Interface ip,
IUtil iu 
) [inline, virtual]
Remarks:
This method is called when the selection set changes. A plug-in may implement this method to respond to this condition.
Parameters:
ip An interface pointer you may use to call methods of the Interface class.
iu An interface pointer you may use to close the current utility in the command panel.
{ UNUSED_PARAM(ip); UNUSED_PARAM(iu);}
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 ) [inline, virtual]
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:
param The command line argument is passed here.
Default Implementation:
{}
{}

UtilityObj UtilityObj UtilityObj UtilityObj UtilityObj UtilityObj UtilityObj UtilityObj UtilityObj UtilityObj
UtilityObj UtilityObj UtilityObj UtilityObj UtilityObj UtilityObj UtilityObj UtilityObj UtilityObj UtilityObj