Public Member Functions | Public Attributes | Protected Member Functions

MSSimpleModXtnd Class Reference

Search for all occurrences

#include <mxsPlugin.h>

Inheritance diagram for MSSimpleModXtnd:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  MSSimpleModXtnd (MSPluginClass *pc, BOOL loading)
  ~MSSimpleModXtnd ()
void  DeleteThis ()
ReferenceTarget get_delegate ()
void  GetClassName (MSTR &s)
  Retrieves the name of the plugin class.
Class_ID  ClassID ()
  Retrieves a constant that uniquely identifies the plugin class.
SClass_ID  SuperClassID ()
  Retrieves a constant representing the type of the plugin.
void  FreeCaches ()
int  NumSubs ()
Animatable SubAnim (int i)
MSTR  SubAnimName (int i)
int  NumParamBlocks ()
IParamBlock2 GetParamBlock (int i)
IParamBlock2 GetParamBlockByID (BlockID id)
void *  GetInterface (ULONG id)
  Inherited from Animatable.
int  NumRefs ()
  Returns the total number of references this ReferenceMaker can hold.
RefTargetHandle  GetReference (int i)
  Returns the 'i-th' reference.
RefTargetHandle  Clone (RemapDir &remap)
  This method is used by 3ds Max to clone an object.
MCHAR *  GetObjectName ()
void  BeginEditParams (IObjParam *ip, ULONG flags, Animatable *prev)
void  EndEditParams (IObjParam *ip, ULONG flags, Animatable *next)
int  HitTest (TimeValue t, INode *inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt, ModContext *mc)
  This method is used in modifier gizmo hit testing.
int  Display (TimeValue t, INode *inode, ViewExp *vpt, int flags, ModContext *mc)
  When this method is called the plug-in should respond by performing a quick render of the modifier gizmo in viewport using the current TM.
void  GetWorldBoundBox (TimeValue t, INode *inode, ViewExp *vpt, Box3 &box, ModContext *mc)
  This method computes the world space bounding box of the modifier gizmo (or any object that when in sub-object mode has a gizmo).
void  GetLocalBoundBox (TimeValue t, INode *inode, ViewExp *vpt, Box3 &box)
  This is the object space bounding box, the box in the object's local coordinates.
void  Snap (TimeValue t, INode *inode, SnapInfo *snap, IPoint2 *p, ViewExp *vpt)
  Checks the point passed for a snap and updates the SnapInfo structure.
CreateMouseCallBack GetCreateMouseCallBack ()
  This method allows the system to retrieve a callback object used in creating an object in the 3D viewports.
BOOL  HasUVW ()
  It is called to find out if the object is has UVW coordinates.
void  SetGenUVW (BOOL sw)
  This method is called to change the state of its Generate UVW boolean.
void  GetSubObjectCenters (SubObjAxisCallback *cb, TimeValue t, INode *node, ModContext *mc)
  When the user is in a sub-object selection level, the system needs to get the reference coordinate system definition from the current modifier being edited so that it can display the axis.
void  GetSubObjectTMs (SubObjAxisCallback *cb, TimeValue t, INode *node, ModContext *mc)
  When the user is in a sub-object selection level, the system needs to get the reference coordinate system definition from the current modifier being edited so that it can display the axis.
BOOL  ChangeTopology ()
  This method asks the question of an object or modifier "Do you change topology"? An object or modifier returns TRUE if it is capable of changing topology when its parameters are being edited; otherwise FALSE.
ChannelMask  ChannelsUsed ()
  These are channels that the modifier needs in order to perform its modification.
ChannelMask  ChannelsChanged ()
  These are the channels that the modifier actually modifies.
void  NotifyInputChanged (Interval changeInt, PartID partID, RefMessage message, ModContext *mc)
  This method is called when an item in the modifier stack before this modifier sends a REFMSG_CHANGE message via NotifyDependents().
void  ModifyObject (TimeValue t, ModContext &mc, ObjectState *os, INode *node)
  This is the method that actually modifies the input object.
BOOL  DependOnTopology (ModContext &mc)
  Modifiers that place a dependency on topology should return TRUE for this method.
Class_ID  InputType ()
  This is the type of object that the modifier knows how to modify.
IOResult  SaveLocalData (ISave *isave, LocalModData *ld)
  When a 3ds Max file is being saved, this method is called so that the modifier can save the localData structure that is hung off each ModContext.
IOResult  LoadLocalData (ILoad *iload, LocalModData **pld)
  When a 3ds Max file is being loaded, this method is called so that the modifier can load the LocalModData structure that is hung off each ModContext.
Deformer GetDeformer (TimeValue t, ModContext &mc, Matrix3 &mat, Matrix3 &invmat)
void  InvalidateUI ()
Interval  GetValidity (TimeValue t)
BOOL  GetModLimits (TimeValue t, float &zmin, float &zmax, int &axis)

Public Attributes

SimpleMod delegate

Protected Member Functions

virtual void  SetReference (int i, RefTargetHandle rtarg)
  Stores a ReferenceTarget as its 'i-th' reference`.

Constructor & Destructor Documentation

MSSimpleModXtnd ( MSPluginClass *  pc,
BOOL  loading 
)
~MSSimpleModXtnd ( ) [inline]

Member Function Documentation

void DeleteThis ( ) [inline]
ReferenceTarget* get_delegate ( ) [inline, virtual]

Reimplemented from MSPluginSimpleMod.

{ return delegate; } 
void GetClassName ( MSTR s ) [inline, virtual]

Retrieves the name of the plugin class.

This name is usually used internally for debugging purposes. For Material plug-ins this method is used to put up the material "type" name in the Material Editor.

Parameters:
s Reference to a string filled in with the name of the plugin class

Reimplemented from MSPluginSimpleMod.

{ s = MSTR(pc->class_name->to_string()); }  
Class_ID ClassID ( ) [inline, virtual]

Retrieves a constant that uniquely identifies the plugin class.

This method must return the unique ID for the plugin class. If two ClassIDs conflict, the system will only load the first conflicting one it finds. A program (gencid.exe) is provided to generate unique class id values.

Returns:
A class id that uniquely identifies a plugin class
See also:
Class ClassID, List of Class IDs.

Reimplemented from MSPluginSimpleMod.

{ return pc->class_id; }
SClass_ID SuperClassID ( ) [inline, virtual]

Retrieves a constant representing the type of the plugin.

Returns:
A super class id that uniquely identifies the type (category) of the plugin. Note that several plugin classes can be of the same type, thus return the same super class id. Plugins are uniquely identified by their class ids. List of Super Class IDs.
See also:
SClass_ID

Reimplemented from MSPluginSimpleMod.

{ return pc->sclass_id; }
void FreeCaches ( ) [inline, virtual]
Remarks:
This is called to delete any item that can be rebuilt. For example, the procedural sphere object has a mesh that it caches. It could call Mesh::FreeAll() on the mesh from this method. This will free the vertex/face/uv arrays. If the sphere is ever evaluated again it can just rebuild the mesh. If an object (like a sphere) has modifiers applied to it, and those modifiers are not animated, then the result of the pipeline is cached in the node. So there is no reason for the sphere to also have a cache of its representation. Therefore when this method is called, the sphere can free the data of the mesh.
Default Implementation:
{}

Reimplemented from MSPluginSimpleMod.

int NumSubs ( ) [inline, virtual]
Remarks:
The system uses a virtual array mechanism to access the sub-anims of a plug-in. This method returns the total number of sub-anims maintained by the plug-in. If a plug-in is using a parameter block to manage its parameters it should just return 1 for all the parameters directed by the parameter block.
Returns:
The number of sub-anims used by the plug-in.
Default Implementation:
{ return 0; }

Reimplemented from MSPluginSimpleMod.

{ return pblocks.Count() + 1; }  
Animatable* SubAnim ( int  i ) [inline, virtual]
Remarks:
This method returns a pointer to the 'i-th' sub-anim. If a plug-in is using a parameter block to manage all its parameters it should just return a pointer to the parameter block itself from this method. This method may return NULL so developers need to check the return value before calling other sub anim methods (such as SubAnimName()).
Parameters:
i This is the index of the sub-anim to return.
Default Implementation:
{ return NULL };

Reimplemented from MSPluginSimpleMod.

{ if (i == 0) return delegate; else return pblocks[i-1]; }
MSTR SubAnimName ( int  i ) [inline, virtual]
Remarks:
This method returns the name of the 'i-th' sub-anim to appear in track view. The system has no idea what name to assign to the sub-anim (it only knows it by the virtual array index), so this method is called to retrieve the name to display. Developer need to make sure the 'i-th' SubAnim() is non-NULL or this method will fail.
Parameters:
i The index of the parameter name to return
Returns:
The name of the 'i-th' parameter.

Reimplemented from MSPluginSimpleMod.

{ if (i == 0) return delegate->GetObjectName(); else return pblocks[i-1]->GetLocalName(); }
int NumParamBlocks ( ) [inline, virtual]
Remarks:
This method is available in release 3.0 and later only.

This method returns the number of ParamBlock2s in this instance.
Default Implementation:
{ return 0; }

Reimplemented from MSPluginSimpleMod.

{ return pblocks.Count(); }
IParamBlock2* GetParamBlock ( int  i ) [inline, virtual]
Remarks:
This method return 'i-th' ParamBlock2 in this instance (or NULL if not available).
Parameters:
i The zero based index of the ParamBlock2 to return.
Default Implementation:
{ return NULL; }

Reimplemented from MSPluginSimpleMod.

{ return pblocks[i]; }
IParamBlock2* GetParamBlockByID ( BlockID  id ) [inline]
void* GetInterface ( ULONG  id ) [inline, virtual]

Inherited from Animatable.

Returns a pointer to the interface.

Parameters:
id - The id of the interface.
Returns:
A Pointer to the Interface

Reimplemented from MSPluginSimpleMod.

{ if (id == I_MAXSCRIPTPLUGIN) return (MSPlugin*)this; else return MSPluginSimpleMod::GetInterface(id); }
int NumRefs ( ) [virtual]

Returns the total number of references this ReferenceMaker can hold.

The plugin implements this method to indicate the total number of of references it can make. This includes all references whether they are NULL (inactive) or non-NULL (active) at the time when this method is called. A plugin can hold a variable number of references, thus the return value of this method is not to be cached and reused by client code.

Returns:
The total number of references this plugin can hold. The default implementation is return 0.

Reimplemented from MSPluginSimpleMod.

RefTargetHandle GetReference ( int  i ) [virtual]

Returns the 'i-th' reference.

The plugin implements this method to return its 'i-th' reference. The plug-in simply keeps track of its references using an integer index for each one. This method is normally called by the system.

Parameters:
i - The index of the reference to retrieve. Valid values are from 0 to NumRefs()-1.
Returns:
The reference handle of the 'i-th' reference. Note that different calls to this method with the same 'i' value can result in different reference handles being retrieved, as the plugin changes the scene objects it references as its 'i-th' reference.

Reimplemented from MSPluginSimpleMod.

virtual void SetReference ( int  i,
RefTargetHandle  rtarg 
) [protected, virtual]

Stores a ReferenceTarget as its 'i-th' reference`.

The plugin implements this method to store the reference handle passed to it as its 'i-th' reference. In its implementation of this method, the plugin should simply assign the reference handle passed in as a parameter to the member variable that holds the 'i-th' reference. Other reference handling methods such as ReferenceMaker::DeleteReference(), or ReferenceMaker::ReplaceReference() should not be called from within this method. The plugin itself or other plugins should not call this method directly. The system will call this method when a new reference is created or an existing one is replaced by calling ReferenceMaker::ReplaceReference().

Parameters:
i - The index of the reference to store. Valid values are from 0 to NumRefs()-1.
rtarg - The reference handle to store.

Reimplemented from MSPluginSimpleMod.

RefTargetHandle Clone ( RemapDir remap ) [virtual]

This method is used by 3ds Max to clone an object.

See also:
CloneRefHierarchy(), class RemapDir This method is called by 3ds Max to have the plugin clone itself. The plug-in's implementation of this method should copy both the data structure and all the data residing in the data structure of this reference target. The plugin should clone all its references as well. Also, the plug-in's implementation of this method must call BaseClone(). In order for classes derived from this class to clone cleanly, the Clone method should just create the new instance, and then call an implementation of BaseClone that clones the references and copies any other necessary data. For example:
            class MyDerivedPlugin
                : public MyBasePlugin
            {
                const int MY_REFERENCE = 1;

                ReferenceTarget* Clone(RemapDir& remap)
                {
                    ReferenceTarget* result = new MyDerivedPlugin();
                    BaseClone(this, result, remap);
                    return result;
                }

                void BaseClone(ReferenceTarget* from, ReferenceTarget* to, RemapDir& remap)
                {
                    if (!to || !from || from == to)
                        return;    
                    MyBasePlugin::BaseClone(from, to, remap);
                    to->ReplaceReference(MY_REFERENCE, remap->CloneRef(from->GetReference(MY_REFERENCE)));
                }
            };

This method should not be directly called by plug-ins. Instead, either RemapDir::CloneRef() or CloneRefHierachy() should be used to perform cloning. These methods ensure that the mapping from the original object to the clone is added to the RemapDir used for cloning, which may be used during backpatch operations

Note:
See the remarks in method BaseClone() below.
Parameters:
remap - A RemapDir instance used for remapping references during a Clone.
Returns:
A pointer to the cloned item.

Reimplemented from MSPluginSimpleMod.

MCHAR* GetObjectName ( ) [inline, virtual]
Returns:
the name that will appear in the history browser (modifier stack).

Reimplemented from MSPluginSimpleMod.

{ return pc->class_name->to_string(); }
void BeginEditParams ( IObjParam ip,
ULONG  flags,
Animatable prev 
) [virtual]
Remarks:
This method is called by the system when the user may edit the item's (object, modifier, controller, etc.) parameters.
Parameters:
ip Interface pointer. The developer can use it to call methods such as AddRollupPage(). Note that this pointer is only valid between BeginEditParams() and EndEditParams(). It should not be used outside this interval.
flags Describe which branch of the command panel or dialog the item is being edited in. The following are possible values:

BEGIN_EDIT_CREATE
Indicates an item is being edited in the create branch.

BEGIN_EDIT_MOTION
Indicates a controller is being edited in the motion branch.

BEGIN_EDIT_HIERARCHY
Indicates a controller is being edited in the Pivot subtask of the hierarchy branch.

BEGIN_EDIT_IK
Indicates a controller is being edited in the IK subtask of the hierarchy branch.

BEGIN_EDIT_LINKINFO
Indicates a controller is being edited in the Link Info subtask of the hierarchy branch.

prev Pointer to an Animatable object. This parameter may be used in the motion and hierarchy branches of the command panel. This pointer allows a plug-in to look at the ClassID of the previous item that was being edited, and if it is the same as this item, to not replace the entire UI in the command panel, but simply update the values displayed in the UI fields. This prevents the UI from 'flickering' when the current item begins its edit. For example, if you are in the motion branch and are looking at an item's PRS controller values, and then select another item that is displayed with a PRS controller, the UI will not change - only the values displayed in the fields will change. If however you selected a target camera that has a lookat controller (not a PRS controller) the UI will change because a different set of parameters need to be displayed. Note that for items that are edited in the modifier branch this field can be ignored.

Reimplemented from MSPluginSimpleMod.

void EndEditParams ( IObjParam ip,
ULONG  flags,
Animatable next 
) [virtual]
Remarks:
This method is called when the user is finished editing an objects parameters. The system passes a flag into the EndEditParams() method to indicate if the rollup page should be removed. If this flag is TRUE, the plug-in must un-register the rollup page, and delete it from the panel.
Parameters:
ip An interface pointer. The developer may use the interface pointer to call methods such as DeleteRollupPage().

flags The following flag may be set:

END_EDIT_REMOVEUI
If TRUE, the item's user interface should be removed.

next Animatable pointer. Can be used in the motion and hierarchy branches of the command panel. It allows a plug-in to look at the ClassID of the next item that was being edited, and if it is the same as this item, to not replace the entire UI in the command panel. Note that for items that are edited in the modifier branch this field can be ignored.

Reimplemented from MSPluginSimpleMod.

int HitTest ( TimeValue  t,
INode inode,
int  type,
int  crossing,
int  flags,
IPoint2 p,
ViewExp vpt,
ModContext mc 
) [inline, virtual]

This method is used in modifier gizmo hit testing.

It is called to determine if the specified screen point intersects the gizmo. The method returns nonzero if the item was hit; otherwise 0.

Parameters:
t The time to perform the hit test.
inode A pointer to the node to test.
type The type of hit testing to perform. See Scene and Node Hit Test Types. for details.
crossing The state of the crossing setting. If TRUE crossing selection is on.
flags The hit test flags. See Scene and Node Hit Testing Flags for details.
p The screen point to test.
vpt An interface pointer that may be used to call methods associated with the viewports.
mc A pointer to the modifiers ModContext.
Returns:
Nonzero if the item was hit; otherwise 0.

Reimplemented from SimpleMod.

                        { return delegate->HitTest(t, inode, type, crossing, flags, p, vpt, mc); }
int Display ( TimeValue  t,
INode inode,
ViewExp vpt,
int  flags,
ModContext mc 
) [inline, virtual]

When this method is called the plug-in should respond by performing a quick render of the modifier gizmo in viewport using the current TM.

Note for Modifiers: For this method to be called properly, one must send two reference messages using NotifyDependents. In BeginEditParams send: NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_ON);

In EndEditParams send: NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_OFF);

Parameters:
t The time to display the item.
inode The node to render.
vpt An interface pointer that may be used to call methods associated with the viewports.
flags See Display Flags.
mc A pointer to the modifiers ModContext.
Returns:
Nonzero if the item was displayed; otherwise 0.

Reimplemented from SimpleMod.

                        { return delegate->Display(t, inode, vpt, flags, mc); }     
void GetWorldBoundBox ( TimeValue  t,
INode inode,
ViewExp vpt,
Box3 box,
ModContext mc 
) [inline, virtual]

This method computes the world space bounding box of the modifier gizmo (or any object that when in sub-object mode has a gizmo).

Parameters:
t The time to compute the bounding box.
inode The node to calculate the bounding box for.
vpt An interface pointer that may be used to call methods associated with the viewports.
box The returned bounding box.
mc A pointer to the modifiers ModContext.

Reimplemented from SimpleMod.

{ delegate->GetWorldBoundBox(t, inode, vpt, box, mc); }
void GetLocalBoundBox ( TimeValue  t,
INode inode,
ViewExp vp,
Box3 box 
) [inline, virtual]

This is the object space bounding box, the box in the object's local coordinates.

The system expects that requesting the object space bounding box will be fast.

Parameters:
t The time to retrieve the bounding box.
inode The node to calculate the bounding box for.
vp An interface pointer that may be used to call methods associated with the viewports.
box Contains the returned bounding box.

Reimplemented from BaseObject.

{ delegate->GetLocalBoundBox(t, inode, vpt,  box ); }
void Snap ( TimeValue  t,
INode inode,
SnapInfo snap,
IPoint2 p,
ViewExp vpt 
) [inline, virtual]

Checks the point passed for a snap and updates the SnapInfo structure.

Note:
Developers wanting to find snap points on an Editable Mesh object should see the method XmeshSnap::Snap() in /MAXSDK/SAMPLES/SNAPS/XMESH/XMESH.CPP.
Parameters:
t The time to check.
inode The node to check.
snap The snap info structure to update.
p The screen point to check.
vpt An interface pointer that may be used to call methods associated with the viewports.

Reimplemented from BaseObject.

{ delegate->Snap(t, inode, snap, p, vpt); }
CreateMouseCallBack* GetCreateMouseCallBack ( ) [inline, virtual]

This method allows the system to retrieve a callback object used in creating an object in the 3D viewports.

This method returns a pointer to an instance of a class derived from CreateMouseCallBack. This class has a method proc() which is where the programmer defines the user/mouse interaction during the object creation phase.

Returns:
A pointer to an instance of a class derived from CreateMouseCallBack.

Reimplemented from SimpleMod.

BOOL HasUVW ( ) [inline, virtual]

It is called to find out if the object is has UVW coordinates.

This method returns TRUE if the object has UVW coordinates; otherwise FALSE. In 3ds Max 2.0 and later there is code in the renderer that will automatically turn on the UVW coordinates of the base object if UV's are missing (and needed). The base object has to implement two simple methods to make this work: HasUVW() and SetGenUVW(). Developers are encouraged to put these methods in their objects: it makes using the program easier for the user. If they are not implemented, it doesn't cause any real harm: it will just operate as before and put up the missing UVW's message. Here is how the procedural sphere implements these methods:

    BOOL SphereObject::GetGenUVW()
    {
        BOOL genUVs;
        Interval v;
        pblock->GetValue(PB_GENUVS, 0, genUVs, v);
        return genUVs;
    }
    
    void SphereObject::SetGenUVW(BOOL sw)
    {
        if (sw==GetGenUVW()) return;
        pblock->SetValue(PB_GENUVS,0, sw);
    }

Important Note: The pblock->SetValue() will cause a call to NotifyDependents(FOREVER, PART_TEXMAP, REFMSG_CHANGE), which will invalidate the UVW cache. It is essential that this call be made, so if the 'generate UVW' boolean is not handled by a parameter block, then NotifyDependents() needs to be called explicitly. Also Note: For "modifiable objects" that pass up the pipeline getting modified, such as TriObject, EditTriObject, etc., which cannot generate their own UVWs, but can carry them in their data structures, only this HasUVW() method needs to be implemented. For example, here is the implementation for TriObject: BOOL TriObject::HasUVW() { return mesh.tvFace?1:0; }

Reimplemented from BaseObject.

{ return delegate->HasUVW(); }
void SetGenUVW ( BOOL  sw ) [inline, virtual]

This method is called to change the state of its Generate UVW boolean.

If the state changes, the object must send a REFMSG_CHANGE up the pipeline by calling NotifyDependents(). This applies to map channel 1.

Parameters:
sw The new state for the generate UVW flag.

Reimplemented from BaseObject.

{ delegate->SetGenUVW(sw); }
void GetSubObjectCenters ( SubObjAxisCallback cb,
TimeValue  t,
INode node,
ModContext mc 
) [inline, virtual]

When the user is in a sub-object selection level, the system needs to get the reference coordinate system definition from the current modifier being edited so that it can display the axis.

This method specifies the position of the center. The plug-in enumerates its centers and calls the callback cb once for each.

Parameters:
cb The callback object whose methods may be called. See Class SubObjAxisCallback.
t The time to enumerate the centers.
node A pointer to the node.
mc A pointer to the ModContext.

Reimplemented from SimpleMod.

{ delegate->GetSubObjectCenters(cb, t, node, mc); }
void GetSubObjectTMs ( SubObjAxisCallback cb,
TimeValue  t,
INode node,
ModContext mc 
) [inline, virtual]

When the user is in a sub-object selection level, the system needs to get the reference coordinate system definition from the current modifier being edited so that it can display the axis.

This method returns the axis system of the reference coordinate system. The plug-in enumerates its TMs and calls the callback cb once for each. See Sub-Object Coordinate Systems.

Parameters:
cb The callback object whose methods may be called.
t The time to enumerate the TMs.
node A pointer to the node.
mc A pointer to the ModContext.

Reimplemented from SimpleMod.

{ delegate->GetSubObjectTMs(cb, t, node, mc); }
BOOL ChangeTopology ( ) [inline, virtual]

This method asks the question of an object or modifier "Do you change topology"? An object or modifier returns TRUE if it is capable of changing topology when its parameters are being edited; otherwise FALSE.

When an item is selected for editing, and there is a modifier in the pipeline that depends on topology, the system calls this method to see if it may potentially change the topology. If this method returns TRUE the system will put up a warning message indicating that a modifier exists in the stack that depends on topology.

Reimplemented from SimpleMod.

{ return delegate->ChangeTopology(); }
ChannelMask ChannelsUsed ( ) [inline, virtual]

These are channels that the modifier needs in order to perform its modification.

This should at least include the channels specified in ChannelsChanged() but may include more. Note that ChannelsUsed() is called many times but the channels returned should not change on the fly.

Returns:
The channels required. See objectChannels.
Sample Code:

Reimplemented from SimpleMod.

{ return delegate->ChannelsUsed(); }
ChannelMask ChannelsChanged ( ) [inline, virtual]

These are the channels that the modifier actually modifies.

Note that ChannelsChanged() is called many times but the channels returned should not change on the fly.

Returns:
The channels that are changed. See objectChannels

Reimplemented from SimpleMod.

{ return delegate->ChannelsChanged(); }
void NotifyInputChanged ( Interval  changeInt,
PartID  partID,
RefMessage  message,
ModContext mc 
) [inline, virtual]

This method is called when an item in the modifier stack before this modifier sends a REFMSG_CHANGE message via NotifyDependents().

Consider the following example: Assume the modifier stack contains a Sphere Object, then a Bend, then a Edit Mesh. The Edit Mesh modifier does not have a reference to the Bend or the Sphere because it does not officially depend on these items. However it does depend on them in a certain sense, because it modifies the data that these items produce. So, if they change it may affect the modifier. A modifier may build a cache based on its input object. The modifier needs a way to know when to discard this cache because the input object has changed. Whenever one of the items before this modifier in the stack sends out a REFMSG_CHANGE message via NotifyDependents() to indicate it has changed this method is called. The modifier may respond in a way appropriate to it, for example by discarding its cache of the input object. It is not legal, to issue a NotifyDependent()'s in the NotifyInputChanged() method of a modifier, without checking for reentrancy. Imagine, you have an instanced modifier applied to the same object in the stack. Sending a refmsg from the NotifyInputChanged method will casue an endles loop. Simply putting a guard in, that checks for reentrancy should get rid of the problem.

Parameters:
changeInt This is the interval from the message. It is reserved for future use - now it will always be FOREVER.
partID This is the partID from the message.
message This is the message sent.
mc The ModContext for the pipeline that changed. If a modifier is applied to multiple objects, then there are ModApps in each pipeline that it is applied to. These ModApps are pointing to the same modifier. Consider the following example: Say you apply a Bend modifier to a Sphere, a Cylinder and a Box object. There are three ModApps but only one Bend modifier. Then you go to the Sphere and adjust its Radius. This will cause NotifyInputChanged() to be called on the Bend because the Bend's input changed. However only one of its inputs changed - only the Sphere changed and not the Cylinder or the Box. Therefore NotifyInputChanged() will be called once, and the ModContext passed in will be for the Sphere's changed pipeline. It is possible that all three objects could change at the same time. If an instanced float controller was assigned to the radius, width, and height - one parameter for each object - then the controller was adjusted in the function curve editor, all three items would change. In this case NotifyInputChanged() would be called three times on the Bend. Once for each pipeline, once with each ModContext.

Reimplemented from Modifier.

{ delegate->NotifyInputChanged(changeInt, partID, message, mc); }
void ModifyObject ( TimeValue  t,
ModContext mc,
ObjectState os,
INode node 
) [inline, virtual]

This is the method that actually modifies the input object.

This method is responsible for altering the object and then updating the validity interval of the object to reflect the validity of the modifier.

Parameters:
t The time at which the modification is being done.
mc A reference to the ModContext.
os The object state flowing through the pipeline. This contains a pointer to the object to modify.
node The node the modifier is applied to. This parameter is always NULL for Object Space Modifiers and non-NULL for World Space Modifiers (Space Warps). This is because a given WSM is only applied to a single node at a time whereas an OSM may be applied to several nodes. This may be used for example by particle system space warps to get the transformation matrix of the node at various times.
See also:
The topic on Modifiers in the Programmers Guide.

Reimplemented from SimpleMod.

{ delegate->ModifyObject(t, mc, os, node); }
BOOL DependOnTopology ( ModContext mc ) [inline, virtual]

Modifiers that place a dependency on topology should return TRUE for this method.

An example would be a modifier that stores a selection set base on vertex indices. This modifier depends on the indices being intact for it to operate correctly.

Parameters:
mc Reference to the ModContext.
Returns:
TRUE if the modifier depends on topology; otherwise FALSE.

Reimplemented from Modifier.

{ return delegate->DependOnTopology(mc); }
Class_ID InputType ( ) [inline, virtual]

This is the type of object that the modifier knows how to modify.

Simple modifiers that just modify points of an object can operate on generic 'Deformable' objects. Deformable objects are any type of object that has points. A modifier could also work on a particular type of object such as a TriObject or PatchObject.

Returns:
The Class_ID of the item. You can request any Class_ID for your input type. For example, Class_ID(OMNI_LIGHT_CLASS_ID, 0). See List of Class_IDs.

Reimplemented from SimpleMod.

{ return delegate->InputType(); }
IOResult SaveLocalData ( ISave isave,
LocalModData ld 
) [inline, virtual]

When a 3ds Max file is being saved, this method is called so that the modifier can save the localData structure that is hung off each ModContext.

If the modifier doesn't store any data in the ModContext it can ignore this method.

Parameters:
isave You may use this pointer to call methods of ISave to write data.
ld Pointer to the LocalModData for the modifier.
Returns:
One of the following values: IO_OK, IO_ERROR.

Reimplemented from Modifier.

{ return delegate->SaveLocalData(isave, ld); }  
IOResult LoadLocalData ( ILoad iload,
LocalModData **  pld 
) [inline, virtual]

When a 3ds Max file is being loaded, this method is called so that the modifier can load the LocalModData structure that is hung off each ModContext.

If the modifier doesn't store any data in the ModContext it can ignore this method.

Parameters:
iload You may use this pointer to call methods of ILoad to read data.
pld A pointer to a pointer in the ModContext. The modifier must set this pointer to point at a new LocalModData derived class.
Returns:
One of the following values: IO_OK, IO_ERROR.

Reimplemented from Modifier.

{ return delegate->LoadLocalData(iload, pld); } 
Deformer& GetDeformer ( TimeValue  t,
ModContext mc,
Matrix3 mat,
Matrix3 invmat 
) [inline, virtual]
Remarks:
This method is used to retrieve the callback object that will handle the deformation.
Parameters:
TimeValue t

Specifies the time the modification is being performed.

ModContext &mc

A reference to the ModContext.

Matrix3& mat

A reference to a matrix that describes the space the modification is supposed to happen in. This is computed from the ModContext matrix and the controllers controlling the gizmo and center of the modifier. The plug-in developers job is simply to transform each point to be deformed by this matrix before it performs its own deformation to the point. After the modifier applies its own deformation to the point, the developer transforms the point by the inverse of this matrix (passed below).

Matrix3& invmat

This is the inverse of the matrix above. See the comment above for how this is used.
Returns:
A C++ reference to the deformer callback object.

Reimplemented from MSPluginSimpleMod.

{ return delegate->GetDeformer(t, mc, mat, invmat); }
void InvalidateUI ( ) [inline, virtual]
Remarks:
This is called if the user interface parameters needs to be updated because the user moved to a new time. The UI controls must display values for the current time.
Example:
If the plug-in uses a parameter map for handling its UI, it may call a method of the parameter map to handle this: pmapParam->Invalidate();

If the plug-in does not use parameter maps, it should call the SetValue() method on each of its controls that display a value, for example the spinner controls. This will cause to the control to update the value displayed. The code below shows how this may be done for a spinner control. Note that ip and pblock are assumed to be initialized interface and parameter block pointers

float newval;

Interval valid=FOREVER;

TimeValue t=ip->GetTime();

// Get the value from the parameter block at the current time.

pblock->GetValue( PB_ANGLE, t, newval, valid );

// Set the value. Note that the notify argument is passed as FALSE.

// This ensures no messages are sent when the value changes.

angleSpin->SetValue( newval, FALSE );

Reimplemented from MSPluginSimpleMod.

Interval GetValidity ( TimeValue  t ) [virtual]
Remarks:
The SimpleMod class calls this method to retrieve the validity interval of the modifier. The modifier provides this interval by starting an interval at FOREVER and intersecting it with each of its parameters validity intervals.
Parameters:
TimeValue t

The time to compute the validity interval.
Default Implementation:
{return FOREVER;}
Returns:
The validity interval of the modifier.

See also:
The Advanced Topics section on Intervals.

Reimplemented from MSPluginSimpleMod.

BOOL GetModLimits ( TimeValue  t,
float &  zmin,
float &  zmax,
int &  axis 
) [inline, virtual]
Remarks:
If the effect can be limited (like the way bend/taper/twist/etc. can be limited) then it should specify the min and max limits and the axis that it is limited along. SimpleMod will then display the limits as part of the Gizmo. If it does not support limits then it should return FALSE or simply not implement this method.
Parameters:
TimeValue t

The time to get the limits.

float &zmin

The min limit.

float &zmax

The max limit.

int &axis

The axis that it is limited along: x=0, y=1, z=2.
Returns:
TRUE if limits are supported; otherwise FALSE.
Default Implementation:
{return FALSE;}

Reimplemented from MSPluginSimpleMod.

{ return delegate->GetModLimits(t, zmin,  zmax,  axis); }

Member Data Documentation


MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd
MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd MSSimpleModXtnd