This reference page is linked to from the following overview topics: Porting Object Plug-ins to Nitrous, How Objects are Drawn in the Viewport, Viewport Rendering and the Pipeline, World Space Modifiers and Object Transformations, Hit Testing, Viewport Functionality, Handling Mouse Procedures, Displaying the Object in the Viewport, Displaying the Modifier Gizmo, Modifier Selection Methods, Named Sub-Object Selection Sets, Sub-Object Coordinate Systems, Custom Plug-in Creation Processes.
This is the base class for objects and modifiers.
Anything with a representation in the 3D viewports is derived from BaseObject (including modifiers and controllers whose gizmos appear in the viewports). The methods here are things such as displaying the object in the viewports, checking for intersection of the object and points the user clicks with the mouse, snapping to the object, and computing various bounding boxes for the object. Also there are methods for returning the name of the object to appear in the modifier stack, a method to deal with creating the object in the viewports (if appropriate), and named selection set related methods. There are also methods that allow other plug-ins to access the changeable parameters of the object. Finally there are several method that deal with sub-object selection, sub-object display, sub-object hit testing, and moving/rotating/scaling sub-object components of the object.
#include <object.h>
Public Member Functions |
|
virtual CoreExport bool | RequiresSupportForLegacyDisplayMode () const |
virtual CoreExport bool | UpdateDisplay (unsigned long renderItemCategories, const MaxSDK::Graphics::MaterialRequiredStreams &materialRequiredStreams, TimeValue t) |
virtual
CoreExport const MaxSDK::Graphics::RenderItemHandleArray & |
GetRenderItems () const |
virtual CoreExport void * | GetInterface (ULONG id) |
Inherited from Animatable. |
|
virtual CoreExport BaseInterface * | GetInterface (Interface_ID id) |
Inherited from Animatable. |
|
CoreExport | BaseObject () |
virtual CoreExport | ~BaseObject () |
virtual int | HitTest (TimeValue t, INode *inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt) |
This method is called to determine if the
specified screen point intersects the item. |
|
virtual void | SetExtendedDisplay (int flags) |
This method is used for storing
mode-dependent display attributes. |
|
virtual int | Display (TimeValue t, INode *inode, ViewExp *vpt, int flags) |
This is called by the system to have the
item display itself (perform a quick render in viewport, using the
current TM). |
|
virtual void | Snap (TimeValue t, INode *inode, SnapInfo *snap, IPoint2 *p, ViewExp *vpt) |
Checks the point passed for a snap and
updates the SnapInfo
structure. |
|
virtual void | GetWorldBoundBox (TimeValue t, INode *inode, ViewExp *vp, Box3 &box) |
This method returns the world space bounding
box for Objects (see below for the Sub-object gizmo or Modifiers
gizmo version). |
|
virtual void | GetLocalBoundBox (TimeValue t, INode *inode, ViewExp *vp, Box3 &box) |
This is the object space bounding box, the
box in the object's local coordinates. |
|
virtual CreateMouseCallBack * | GetCreateMouseCallBack ()=0 |
This method allows the system to retrieve a
callback object used in creating an object in the 3D viewports.
|
|
virtual MCHAR * | GetObjectName () |
virtual CoreExport BOOL | OKToChangeTopology (MSTR &modName) |
Implemented by the System. |
|
virtual 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. |
|
virtual void | ForceNotify (Interval &i) |
virtual IParamArray * | GetParamBlock () |
An object or modifier should implement this
method if it wishes to make its parameter block available for other
plug-ins to access it. |
|
virtual int | GetParamBlockIndex (int id) |
If a plug-in makes its parameter block
available (using
GetParamBlock()) then it will need to provide #defines for
indices into the parameter block. |
|
virtual void | Move (TimeValue t, Matrix3 &partm, Matrix3 &tmAxis, Point3 &val, BOOL localOrigin=FALSE) |
When this method is called the plug-in
should respond by moving its selected sub-object components.
|
|
virtual void | Rotate (TimeValue t, Matrix3 &partm, Matrix3 &tmAxis, Quat &val, BOOL localOrigin=FALSE) |
When this method is called the plug-in
should respond by rotating its selected sub-object components.
|
|
virtual void | Scale (TimeValue t, Matrix3 &partm, Matrix3 &tmAxis, Point3 &val, BOOL localOrigin=FALSE) |
When this method is called the plug-in
should respond by scaling its selected sub-object components.
|
|
virtual void | TransformStart (TimeValue t) |
This method is called before the first
Move(),
Rotate() or
Scale() call and before a hold is in effect. |
|
virtual void | TransformHoldingStart (TimeValue t) |
This method is called before the first
Move(),
Rotate() or
Scale() call and after a hold is in effect. |
|
virtual void | TransformHoldingFinish (TimeValue t) |
This method is called after the user has
completed the
Move(),
Rotate() or
Scale() operation and before the undo object has been accepted.
|
|
virtual void | TransformFinish (TimeValue t) |
This method is called after the user has
completed the
Move(),
Rotate() or
Scale() operation and the undo object has been accepted.
|
|
virtual void | TransformCancel (TimeValue t) |
This method is called when the transform
operation is canceled by a right-click and the undo has been
canceled. |
|
virtual 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.
|
|
virtual 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.
|
|
virtual BOOL | HasUVW () |
It is called to find out if the object is
has UVW coordinates. |
|
virtual BOOL | HasUVW (int mapChannel) |
It is called to find out if the object is
has UVW coordinates for the specified mapping channel. |
|
virtual void | SetGenUVW (BOOL sw) |
This method is called to change the state of
its Generate UVW boolean. |
|
virtual void | SetGenUVW (int mapChannel, BOOL sw) |
This method is called to change the state of
its Generate UVW boolean for the specified mapping channel.
|
|
virtual void | ShowEndResultChanged (BOOL showEndResult) |
This method notifies the BaseObject
that the end result display has been switched (the "Show End
Result" button has been toggled). |
|
virtual void | NotifyPreCollapse (INode *node, IDerivedObject *derObj, int index) |
This method is called before a modifier or
object is collapsed.
|
|
virtual void | NotifyPostCollapse (INode *node, Object *obj, IDerivedObject *derObj, int index) |
This method is called after a modifier or
object is collapsed.
|
|
virtual int | NumSubObjTypes () |
Objects and modifiers that support
subobjects have to overwrite this method - as well as
GetSubObjType() - and return a class derived from
ISubObjType in GetSubObjType().
|
|
virtual ISubObjType * | GetSubObjType (int i) |
Returns a pointer to the sub-object type for
the sub-object whose index is passed.
|
|
virtual CoreExport int | GetSubObjectLevel () |
This method returns an integer which
indicates the current sub-object level of the modifier or base
object.
|
|
virtual BOOL | HasViewDependentBoundingBox () |
This method return true if GetWorldBoundBox
returns different boxes for different viewports. |
|
Sub-Object Display, Hit Test, and Bounding
Box Methods
|
|
These methods are for sub-object selection. If the derived class is NOT a modifier, the modContext pointer passed to some of these methods will be NULL. |
|
virtual 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. |
|
virtual 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. |
|
virtual 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). |
|
virtual void | CloneSelSubComponents (TimeValue t) |
This method is called to make a copy of the
selected sub-object components of the item. |
|
virtual void | AcceptCloneSelSubComponents (TimeValue t) |
This method is called when the user mouses
up after shift-cloning a sub-object selection. |
|
virtual void | SelectSubComponent (HitRecord *hitRec, BOOL selected, BOOL all, BOOL invert=FALSE) |
This method is called to change the
selection state of the component identified by hitRec. |
|
virtual void | ClearSelection (int selLevel) |
This method is called to clear the selection
for the given sub-object level. |
|
virtual void | SelectAll (int selLevel) |
This method is called to select every
element of the given sub-object level. |
|
virtual void | InvertSelection (int selLevel) |
This method is called to invert the
specified sub-object level. |
|
virtual int | SubObjectIndex (HitRecord *hitRec) |
Returns the index of the sub-object element
identified by the
HitRecord hitRec. |
|
virtual void | ActivateSubobjSel (int level, XFormModes &modes) |
When the user changes the selection of the
sub-object drop down, this method is called to notify the plug-in.
|
|
virtual BOOL | SupportsNamedSubSels () |
An object that supports sub-object selection
can choose to support named sub object selection sets. |
|
virtual void | ActivateSubSelSet (MSTR &setName) |
When the user chooses a name from the drop
down list this method is called. |
|
virtual void | NewSetFromCurSel (MSTR &setName) |
If the user types a new name into the named
selection set drop down then this method is called. |
|
virtual void | RemoveSubSelSet (MSTR &setName) |
If the user selects a set from the drop down
and then chooses Remove Named Selections from the Edit menu this
method is called. |
|
virtual void | SetupNamedSelDropDown () |
To support the Edit Named Selections dialog,
plug-ins must implement this method. |
|
virtual int | NumNamedSelSets () |
To support the Edit Named Selections dialog,
plug-ins must implement this method. |
|
virtual MSTR | GetNamedSelSetName (int i) |
To support the Edit Named Selections dialog,
plug-ins must implement this method. |
|
virtual void | SetNamedSelSetName (int i, MSTR &newName) |
To support the Edit Named Selections dialog,
plug-ins must implement this method. |
|
virtual void | NewSetByOperator (MSTR &newName, Tab< int > &sets, int op) |
To support the Edit Named Selections dialog,
plug-ins must implement this method. |
|
Protected Attributes |
|
MaxSDK::Graphics::RenderItemHandleArray | mRenderItemHandles |
Friends |
|
class | ModifyTaskImp |
CoreExport BaseObject | ( | ) |
virtual CoreExport ~BaseObject | ( | ) | [virtual] |
virtual CoreExport bool RequiresSupportForLegacyDisplayMode | ( | ) | const [virtual] |
Reimplemented in ShapeObject, PatchObject, PolyObject, SimpleObject, and TriObject.
virtual CoreExport bool UpdateDisplay | ( | unsigned long | renderItemCategories, |
const MaxSDK::Graphics::MaterialRequiredStreams & | materialRequiredStreams, | ||
TimeValue | t | ||
) | [virtual] |
Reimplemented in ShapeObject, PatchObject, PolyObject, SimpleObject, and TriObject.
virtual CoreExport const MaxSDK::Graphics::RenderItemHandleArray& GetRenderItems | ( | ) | const [virtual] |
virtual CoreExport void* GetInterface | ( | ULONG | id | ) | [virtual] |
Inherited from Animatable.
Returns a pointer to the interface.
id | - The id of the interface. |
Reimplemented from ReferenceTarget.
Reimplemented in IDerivedObject, Object, LightObject, ShapeObject, WSMObject, PatchObject, PodObj, SimpleObject, SimpleParticle, SplineShape, TriObject, MSPluginSimpleObject, MSSimpleObjectXtnd, MSPluginSimpleManipulator, MSSimpleManipulatorXtnd, MSPluginModifier, MSModifierXtnd, MSPluginSimpleMod, MSSimpleModXtnd, MSPluginObject< ShapeObject >, MSPluginObject< HelperObject >, MSPluginObject< GeomObject >, MSPluginObject< GenCamera >, MSPluginObject< GenLight >, MSObjectXtnd< GenCamera, MSPluginCamera >, MSObjectXtnd< HelperObject, MSPluginHelper >, MSObjectXtnd< GeomObject, MSPluginGeomObject >, MSObjectXtnd< ShapeObject, MSPluginShape >, and MSObjectXtnd< GenLight, MSPluginLight >.
virtual CoreExport BaseInterface* GetInterface | ( | Interface_ID | id | ) | [virtual] |
Inherited from Animatable.
Returns a pointer to the Base Interface for the interface ID passed.
id | - The unique ID of the interface to get |
Reimplemented from ReferenceTarget.
Reimplemented in SimpleManipulator, Object, LightObject, ShapeObject, SimpleObject, TriObject, MSPluginObject< ShapeObject >, MSPluginObject< HelperObject >, MSPluginObject< GeomObject >, MSPluginObject< GenCamera >, MSPluginObject< GenLight >, MSObjectXtnd< GenCamera, MSPluginCamera >, MSObjectXtnd< HelperObject, MSPluginHelper >, MSObjectXtnd< GeomObject, MSPluginGeomObject >, MSObjectXtnd< ShapeObject, MSPluginShape >, and MSObjectXtnd< GenLight, MSPluginLight >.
virtual int HitTest | ( | TimeValue | t, |
INode * | inode, | ||
int | type, | ||
int | crossing, | ||
int | flags, | ||
IPoint2 * | p, | ||
ViewExp * | vpt | ||
) | [inline, virtual] |
This method is called to determine if the specified screen point intersects the item.
The method returns nonzero if the item was hit; otherwise 0.
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. |
Reimplemented in DummyObject, LinearShape, Manipulator, SimpleManipulator, PatchObject, PolyObject, SimpleObject, SimpleWSMObject, SimpleParticle, SimpleShape, SimpleSpline, SplineShape, TriObject, MSHelperXtnd, MSLightXtnd, MSCameraXtnd, MSSimpleObjectXtnd, MSSimpleManipulatorXtnd, MSPluginModifier, MSModifierXtnd, MSPluginObject< ShapeObject >, MSPluginObject< HelperObject >, MSPluginObject< GeomObject >, MSPluginObject< GenCamera >, MSPluginObject< GenLight >, MSObjectXtnd< GenCamera, MSPluginCamera >, MSObjectXtnd< HelperObject, MSPluginHelper >, MSObjectXtnd< GeomObject, MSPluginGeomObject >, MSObjectXtnd< ShapeObject, MSPluginShape >, and MSObjectXtnd< GenLight, MSPluginLight >.
{return 0;};
virtual void SetExtendedDisplay | ( | int | flags | ) | [inline, virtual] |
This method is used for storing mode-dependent display attributes.
Before an object's Display() method is called, the appropriate bits of the extended display flag variable are set and this method is called. After that, the Display() method is called. If the object must display itself differently based on the settings of the extended display bit fields, then the object must save the flags passed into the this method. Otherwise, there is no need for the object to store the flags.
flags | The flags to store. |
Reimplemented in MSModifierXtnd, MSObjectXtnd< GenCamera, MSPluginCamera >, MSObjectXtnd< HelperObject, MSPluginHelper >, MSObjectXtnd< GeomObject, MSPluginGeomObject >, MSObjectXtnd< ShapeObject, MSPluginShape >, and MSObjectXtnd< GenLight, MSPluginLight >.
{}
This is called by the system to have the item display itself (perform a quick render in viewport, using the current TM).
Note: For this method to be called the object's validity interval must be invalid at the specified time t. If the interval is valid, the system may not call this method since it thinks the display is already valid.
t | The time to display the object. |
inode | The node to display. |
vpt | An interface pointer that may be used to call methods associated with the viewports. |
flags | See Display Flags. |
Reimplemented in DummyObject, LinearShape, Manipulator, SimpleManipulator, ShapeObject, PatchObject, PolyObject, SimpleObject, SimpleWSMObject, SimpleParticle, SimpleShape, SimpleSpline, SplineShape, TriObject, MSHelperXtnd, MSLightXtnd, MSCameraXtnd, MSSimpleObjectXtnd, MSSimpleManipulatorXtnd, MSPluginModifier, MSModifierXtnd, MSPluginObject< ShapeObject >, MSPluginObject< HelperObject >, MSPluginObject< GeomObject >, MSPluginObject< GenCamera >, MSPluginObject< GenLight >, MSObjectXtnd< GenCamera, MSPluginCamera >, MSObjectXtnd< HelperObject, MSPluginHelper >, MSObjectXtnd< GeomObject, MSPluginGeomObject >, MSObjectXtnd< ShapeObject, MSPluginShape >, and MSObjectXtnd< GenLight, MSPluginLight >.
{ return 0; };
virtual 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.
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 in DummyObject, LinearShape, PatchObject, PolyObject, SimpleObject, SimpleWSMObject, SimpleShape, SimpleSpline, SplineShape, TriObject, MSHelperXtnd, MSLightXtnd, MSCameraXtnd, MSSimpleObjectXtnd, MSSimpleManipulatorXtnd, MSPluginModifier, MSModifierXtnd, MSSimpleModXtnd, MSPluginObject< ShapeObject >, MSPluginObject< HelperObject >, MSPluginObject< GeomObject >, MSPluginObject< GenCamera >, MSPluginObject< GenLight >, MSObjectXtnd< GenCamera, MSPluginCamera >, MSObjectXtnd< HelperObject, MSPluginHelper >, MSObjectXtnd< GeomObject, MSPluginGeomObject >, MSObjectXtnd< ShapeObject, MSPluginShape >, and MSObjectXtnd< GenLight, MSPluginLight >.
{}
virtual void GetWorldBoundBox | ( | TimeValue | t, |
INode * | inode, | ||
ViewExp * | vp, | ||
Box3 & | box | ||
) | [inline, virtual] |
This method returns the world space bounding box for Objects (see below for the Sub-object gizmo or Modifiers gizmo version).
The bounding box returned by this method does not need to be precise. It should however be calculated rapidly. The object can handle this by transforming the 8 points of its local bounding box into world space and take the minimums and maximums of the result. Although this isn't necessarily the tightest bounding box of the objects points in world space, it is close enough.
t | The time to compute the bounding box. |
inode | The node to calculate the bounding box for. |
vp | An interface pointer that can be used to call methods associated with the viewports. |
box | Contains the returned bounding box. |
Reimplemented in DummyObject, LinearShape, SimpleManipulator, PatchObject, PolyObject, SimpleObject, SimpleWSMObject, SimpleParticle, SimpleShape, SimpleSpline, SplineShape, TriObject, MSHelperXtnd, MSLightXtnd, MSCameraXtnd, MSSimpleObjectXtnd, MSSimpleManipulatorXtnd, MSPluginModifier, MSModifierXtnd, MSPluginObject< ShapeObject >, MSPluginObject< HelperObject >, MSPluginObject< GeomObject >, MSPluginObject< GenCamera >, MSPluginObject< GenLight >, MSObjectXtnd< GenCamera, MSPluginCamera >, MSObjectXtnd< HelperObject, MSPluginHelper >, MSObjectXtnd< GeomObject, MSPluginGeomObject >, MSObjectXtnd< ShapeObject, MSPluginShape >, and MSObjectXtnd< GenLight, MSPluginLight >.
{};
virtual 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.
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 in DummyObject, LinearShape, Manipulator, SimpleManipulator, PatchObject, PolyObject, SimpleObject, SimpleWSMObject, SimpleParticle, SimpleShape, SimpleSpline, SplineShape, TriObject, MSHelperXtnd, MSLightXtnd, MSCameraXtnd, MSSimpleObjectXtnd, MSSimpleManipulatorXtnd, MSPluginModifier, MSModifierXtnd, MSSimpleModXtnd, MSPluginObject< ShapeObject >, MSPluginObject< HelperObject >, MSPluginObject< GeomObject >, MSPluginObject< GenCamera >, MSPluginObject< GenLight >, MSObjectXtnd< GenCamera, MSPluginCamera >, MSObjectXtnd< HelperObject, MSPluginHelper >, MSObjectXtnd< GeomObject, MSPluginGeomObject >, MSObjectXtnd< ShapeObject, MSPluginShape >, and MSObjectXtnd< GenLight, MSPluginLight >.
{};
virtual CreateMouseCallBack* GetCreateMouseCallBack | ( | ) | [pure 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.
Implemented in DummyObject, SphereGizmoObject, CylGizmoObject, BoxGizmoObject, LinearShape, PatchObject, PolyObject, SimpleMod, SimpleWSMMod, SimpleOSMToWSMObject, SimpleShape, SimpleSpline, SplineShape, TriObject, MSPluginSimpleObject, MSSimpleObjectXtnd, MSPluginSimpleManipulator, MSSimpleManipulatorXtnd, MSPluginModifier, MSModifierXtnd, MSSimpleModXtnd, PFSimpleAction, MSPluginObject< ShapeObject >, MSPluginObject< HelperObject >, MSPluginObject< GeomObject >, MSPluginObject< GenCamera >, MSPluginObject< GenLight >, MSObjectXtnd< GenCamera, MSPluginCamera >, MSObjectXtnd< HelperObject, MSPluginHelper >, MSObjectXtnd< GeomObject, MSPluginGeomObject >, MSObjectXtnd< ShapeObject, MSPluginShape >, and MSObjectXtnd< GenLight, MSPluginLight >.
virtual MCHAR* GetObjectName | ( | ) | [inline, virtual] |
Reimplemented in DummyObject, SphereGizmoObject, CylGizmoObject, BoxGizmoObject, LinearShape, PatchObject, PolyObject, SimpleOSMToWSMMod, SimpleOSMToWSMMod2, SplineShape, TriObject, MSPluginSimpleObject, MSSimpleObjectXtnd, MSPluginSimpleManipulator, MSSimpleManipulatorXtnd, MSPluginModifier, MSModifierXtnd, MSPluginSimpleMod, MSSimpleModXtnd, PFSimpleAction, MSPluginObject< ShapeObject >, MSPluginObject< HelperObject >, MSPluginObject< GeomObject >, MSPluginObject< GenCamera >, MSPluginObject< GenLight >, MSObjectXtnd< GenCamera, MSPluginCamera >, MSObjectXtnd< HelperObject, MSPluginHelper >, MSObjectXtnd< GeomObject, MSPluginGeomObject >, MSObjectXtnd< ShapeObject, MSPluginShape >, and MSObjectXtnd< GenLight, MSPluginLight >.
{ return _M("Object"); }
virtual CoreExport BOOL OKToChangeTopology | ( | MSTR & | modName | ) | [virtual] |
Implemented by the System.
This method is called to see if any modifiers down in the pipeline depend on topology. It sends the message REFMSG_IS_OK_TO_CHANGE_TOPOLOGY to see if any modifiers or objects down the pipeline depend on topology.
modName | This parameter is set to the dependent modifier's name if there is an item that depends on topology. |
Reimplemented in PFSimpleAction.
virtual 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 in SimpleMod, SimpleWSMMod, MSModifierXtnd, and MSSimpleModXtnd.
{return TRUE;}
virtual void ForceNotify | ( | Interval & | i | ) | [inline, virtual] |
Reimplemented in Modifier.
{ NotifyDependents( i, (PartID)PART_ALL, REFMSG_CHANGE ); }
virtual IParamArray* GetParamBlock | ( | ) | [inline, virtual] |
An object or modifier should implement this method if it wishes to make its parameter block available for other plug-ins to access it.
The system itself doesn't actually call this method. This method is optional.
Reimplemented in SimpleMod, SimpleWSMMod, SimpleObject, SimpleWSMObject, SimpleParticle, SimpleShape, and SimpleSpline.
{return NULL;}
virtual int GetParamBlockIndex | ( | int | id | ) | [inline, virtual] |
If a plug-in makes its parameter block available (using GetParamBlock()) then it will need to provide #defines for indices into the parameter block.
These defines should not be directly used with the parameter block but instead converted by this function that the plug-in implements. This way if a parameter moves around in a future version of the plug-in the #define can be remapped. A return value of -1 indicates an invalid parameter id.
id | The parameter block id. See Parameter Block IDs. |
Reimplemented in SimpleMod, SimpleWSMMod, SimpleObject, SimpleWSMObject, SimpleParticle, SimpleShape, and SimpleSpline.
{return -1;}
virtual void Move | ( | TimeValue | t, |
Matrix3 & | partm, | ||
Matrix3 & | tmAxis, | ||
Point3 & | val, | ||
BOOL | localOrigin =
FALSE |
||
) | [inline, virtual] |
When this method is called the plug-in should respond by moving its selected sub-object components.
t | The time of the transformation. |
partm | The 'parent' transformation matrix. This matrix represents a transformation that would take points in the modifier's space and convert them into world space points. This is constructed as the node's transformation matrix times the inverse of the ModContext's transformation matrix. The node whose transformation is used is the node the user clicked on in the scene - modifiers can be instanced so there could be more than one node. |
tmAxis | The matrix that represents the axis system. This is the space in which the transformation is taking place. |
val | This value is a vector with X, Y, and Z representing the movement along each axis. |
localOrigin | When TRUE the transformation is occurring about the sub-object's local origin. |
Reimplemented in PatchObject, SimpleMod, SplineShape, and MSModifierXtnd.
{}
virtual void Rotate | ( | TimeValue | t, |
Matrix3 & | partm, | ||
Matrix3 & | tmAxis, | ||
Quat & | val, | ||
BOOL | localOrigin =
FALSE |
||
) | [inline, virtual] |
When this method is called the plug-in should respond by rotating its selected sub-object components.
t | The time of the transformation. |
partm | The 'parent' transformation matrix. This matrix represents a transformation that would take points in the modifier's space and convert them into world space points. This is constructed as the node's transformation matrix times the inverse of the ModContext's transformation matrix. The node whose transformation is used is the node the user clicked on in the scene - modifiers can be instanced so there could be more than one node. |
tmAxis | The matrix that represents the axis system. This is the space in which the transformation is taking place. |
val | The amount to rotate the selected components. |
localOrigin | When TRUE the transformation is occurring about the sub-object's local origin. Note: This information may be passed onto a transform controller (if there is one) so they may avoid generating 0 valued position keys for rotation and scales. For example if the user is rotating an item about anything other than its local origin then it will have to translate in addition to rotating to achieve the result. If a user creates an object, turns on the animate button, and rotates the object about the world origin, and then plays back the animation, the object does not do what the was done interactively. The object ends up in the same position, but it does so by both moving and rotating. Therefore both a position and a rotation key are created. If the user performs a rotation about the local origin however there is no need to create a position key since the object didn't move (it only rotated). So a transform controller can use this information to avoid generating 0 valued position keys for rotation and scales. |
Reimplemented in PatchObject, SimpleMod, SplineShape, and MSModifierXtnd.
{}
virtual void Scale | ( | TimeValue | t, |
Matrix3 & | partm, | ||
Matrix3 & | tmAxis, | ||
Point3 & | val, | ||
BOOL | localOrigin =
FALSE |
||
) | [inline, virtual] |
When this method is called the plug-in should respond by scaling its selected sub-object components.
t | The time of the transformation. |
partm | The 'parent' transformation matrix. This matrix represents a transformation that would take points in the modifier's space and convert them into world space points. This is constructed as the node's transformation matrix times the inverse of the ModContext's transformation matrix. The node whose transformation is used is the node the user clicked on in the scene - modifiers can be instanced so there could be more than one node. |
tmAxis | The matrix that represents the axis system. This is the space in which the transformation is taking place. |
val | This value is a vector with X, Y, and Z representing the scale along X, Y, and Z respectively. |
localOrigin | When TRUE the transformation is occurring about the sub-object's local origin. See the note above in the Rotate method. The following methods may be used to receive notification about the starting and ending phases of transforming the item when in sub-object selection. |
Reimplemented in PatchObject, SimpleMod, SplineShape, and MSModifierXtnd.
{}
virtual void TransformStart | ( | TimeValue | t | ) | [inline, virtual] |
This method is called before the first Move(), Rotate() or Scale() call and before a hold is in effect.
t | The current time when this method is called. |
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{}
virtual void TransformHoldingStart | ( | TimeValue | t | ) | [inline, virtual] |
This method is called before the first Move(), Rotate() or Scale() call and after a hold is in effect.
t | The current time when this method is called. |
Reimplemented in MSModifierXtnd.
{}
virtual void TransformHoldingFinish | ( | TimeValue | t | ) | [inline, virtual] |
This method is called after the user has completed the Move(), Rotate() or Scale() operation and before the undo object has been accepted.
t | The current time when this method is called. |
Reimplemented in MSModifierXtnd.
{}
virtual void TransformFinish | ( | TimeValue | t | ) | [inline, virtual] |
This method is called after the user has completed the Move(), Rotate() or Scale() operation and the undo object has been accepted.
t | The current time when this method is called. |
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{}
virtual void TransformCancel | ( | TimeValue | t | ) | [inline, virtual] |
This method is called when the transform operation is canceled by a right-click and the undo has been canceled.
t | The current time when this method is called. |
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{}
virtual 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.
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. |
Reimplemented in PatchObject, SimpleMod, SplineShape, MSModifierXtnd, and MSSimpleModXtnd.
{ return 0; }
virtual 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);
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. |
Reimplemented in PatchObject, SimpleMod, SplineShape, MSModifierXtnd, and MSSimpleModXtnd.
{ return 0; }; // quick render in viewport, using current TM.
virtual 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).
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 in PatchObject, SimpleMod, SplineShape, MSModifierXtnd, and MSSimpleModXtnd.
{}
virtual void CloneSelSubComponents | ( | TimeValue | t | ) | [inline, virtual] |
This method is called to make a copy of the selected sub-object components of the item.
If this is called on an object, the selection level of the object is used to determine which type of sub-objects are cloned. For instance in a Mesh, the selection level determines if selected verticies, edges or faces are cloned. If this is called on a Modifier then the selection level of the modifier is used. Modifiers call Interface::GetModContexts() to get a list of ModContexts, one for each object the modifier is applied to. Then the selected sub-objects are cloned for each object in the list.
t | The time at which to clone the selected sub-object components. |
Reimplemented in MSModifierXtnd.
{}
virtual void AcceptCloneSelSubComponents | ( | TimeValue | t | ) | [inline, virtual] |
This method is called when the user mouses up after shift-cloning a sub-object selection.
t | The time at which the clone of the selected components is being done. |
Reimplemented in MSModifierXtnd.
{}
virtual void SelectSubComponent | ( | HitRecord * | hitRec, |
BOOL | selected, | ||
BOOL | all, | ||
BOOL | invert =
FALSE |
||
) | [inline, virtual] |
This method is called to change the selection state of the component identified by hitRec.
hitRec | Identifies the component whose selected state should be set. See Class HitRecord . |
selected | TRUE if the item should be selected; FALSE if the item should be de-selected. |
all | TRUE if all components in the HitRecord chain should be selected; FALSE if only the top-level HitRecord should be selected. (A HitRecord contains a Next() pointer; typically you want to do whatever you're doing to all the Next()'s until Next() returns NULL). |
invert | This is set to TRUE when all is also set to TRUE and the user is holding down the Shift key while region selecting in select mode. This indicates the items hit in the region should have their selection state inverted |
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{}
virtual void ClearSelection | ( | int | selLevel | ) | [inline, virtual] |
This method is called to clear the selection for the given sub-object level.
All sub-object elements of this type should be deselected. This will be called when the user chooses Select None from the 3ds Max Edit menu.
selLevel | Specifies the selection level to clear. |
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{}
virtual void SelectAll | ( | int | selLevel | ) | [inline, virtual] |
This method is called to select every element of the given sub-object level.
This will be called when the user chooses Select All from the 3ds Max Edit menu.
selLevel | Specifies the selection level to select. |
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{}
virtual void InvertSelection | ( | int | selLevel | ) | [inline, virtual] |
This method is called to invert the specified sub-object level.
If the element is selected it should be deselected. If it's deselected it should be selected. This will be called when the user chooses Select Invert from the 3ds Max Edit menu.
selLevel | Specifies the selection level to invert. |
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{}
virtual int SubObjectIndex | ( | HitRecord * | hitRec | ) | [inline, virtual] |
Returns the index of the sub-object element identified by the HitRecord hitRec.
See Class HitRecord. The sub-object index identifies a sub-object component. The relationship between the index and the component is established by the modifier. For example an edit modifier may allow the user to select a group of faces and these groups of faces may be identified as group 0, group 1, group 2, etc. Given a hit record that identifies a face, the edit modifier's implementation of this method would return the group index that the face belonged to.
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{return 0;}
virtual void ActivateSubobjSel | ( | int | level, |
XFormModes & | modes | ||
) | [inline, virtual] |
When the user changes the selection of the sub-object drop down, this method is called to notify the plug-in.
This method should provide instances of a class derived from CommandMode to support move, rotate, non-uniform scale, uniform scale, and squash modes. These modes replace their object mode counterparts however the user still uses the move/rotate/scale tool buttons in the toolbar to activate them. If a certain level of sub-object selection does not support one or more of the modes NULL may be passed. If NULL is specified the corresponding toolbar button will be grayed out.
level | The sub-object selection level the command modes should be set to support. A level of 0 indicates object level selection. If level is greater than or equal to 1 the index refers to the types registered by the object in the order they appeared in the list when registered by Interface::RegisterSubObjectTypes(). See Class Interface. |
modes | The command modes to support |
void SimpleMod::ActivateSubobjSel(int level, XFormModes& modes) { switch ( level ) { case 1: // Modifier box modes = XFormModes(moveMode,rotMode,nuscaleMode,uscaleMode,squashMode,NULL); break; case 2: // Modifier Center modes = XFormModes(moveMode,NULL,NULL,NULL,NULL,NULL); break; } NotifyDependents(FOREVER,PART_DISPLAY,REFMSG_CHANGE); }
Reimplemented in PatchObject, SimpleMod, SplineShape, and MSModifierXtnd.
{}
virtual BOOL SupportsNamedSubSels | ( | ) | [inline, virtual] |
An object that supports sub-object selection can choose to support named sub object selection sets.
Methods in the the interface passed to objects allow them to add items to the sub-object selection set drop down. The following methods are called when the user picks items from the list.
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{return FALSE;}
virtual void ActivateSubSelSet | ( | MSTR & | setName | ) | [inline, virtual] |
When the user chooses a name from the drop down list this method is called.
The plug-in should respond by selecting the set identified by the name passed.
setName | The name of the set to select. |
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{}
virtual void NewSetFromCurSel | ( | MSTR & | setName | ) | [inline, virtual] |
If the user types a new name into the named selection set drop down then this method is called.
The plug-in should respond by creating a new set and give it the specified name.
setName | The name for the selection set. |
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{}
virtual void RemoveSubSelSet | ( | MSTR & | setName | ) | [inline, virtual] |
If the user selects a set from the drop down and then chooses Remove Named Selections from the Edit menu this method is called.
The plug-in should respond by removing the specified selection set.
setName | The selection set to remove. |
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{}
virtual void SetupNamedSelDropDown | ( | ) | [inline, virtual] |
To support the Edit Named Selections dialog, plug-ins must implement this method.
It is called to rebuild the named selection set drop down list. This is usually done by calling Interface::ClearSubObjectNamedSelSets() followed by calls to Interface:: AppendSubObjectNamedSelSet().
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{}
virtual int NumNamedSelSets | ( | ) | [inline, virtual] |
To support the Edit Named Selections dialog, plug-ins must implement this method.
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{return 0;}
virtual MSTR GetNamedSelSetName | ( | int | i | ) | [inline, virtual] |
To support the Edit Named Selections dialog, plug-ins must implement this method.
i | The index of the selection set whose name is returned. |
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{return _M("");}
virtual void SetNamedSelSetName | ( | int | i, |
MSTR & | newName | ||
) | [inline, virtual] |
To support the Edit Named Selections dialog, plug-ins must implement this method.
It sets the name of the selection set whose index is passed to the name passed. Note: Developers need to implement Undo / Redo for modifications to their named selection sets.
i | The index of the selection set whose name is to be set. |
newName | The new name for the selection set the plug-in should store. |
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{}
To support the Edit Named Selections dialog, plug-ins must implement this method.
The user may bring up the Edit Named Selections dialog via the Edit / Edit Named Selection ... command. This dialog allows the user to create new selection sets using 'boolean' operations to the sets including 'Combine', 'Subtract (A-B)', 'Subtract (B-A)' and 'Intersection'. This method is called on the plug-in to generate a new selection set via one of these operations. This method assumes the developer will append a new seleciton set with the name passed. This will result in two sets with identical names. Then the system will call RemoveSubSelSet() afterwards, so that the first one that is found (the old one, since the new one was appended) will be deleted. Note: Developers need to implement Undo / Redo for modifications to their named selection sets. See /MAXSDK/SAMPLES/MODIFIERS/MESHSEL.CPP for an example.
newName | The new name for the selection set is passed here. |
sets | A table of the selection sets to operate on. There are sets.Count() sets in the table. |
op | One of the following values defined in Arguments for BaseObject::NewSetByOperator() |
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{}
virtual 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 in Object, ShapeObject, PolyObject, TriObject, MSPluginShape, MSShapeXtnd, MSPluginSimpleObject, MSSimpleObjectXtnd, MSSimpleManipulatorXtnd, MSPluginModifier, MSModifierXtnd, MSSimpleModXtnd, MSPluginObject< ShapeObject >, MSPluginObject< HelperObject >, MSPluginObject< GeomObject >, MSPluginObject< GenCamera >, MSPluginObject< GenLight >, MSObjectXtnd< GenCamera, MSPluginCamera >, MSObjectXtnd< HelperObject, MSPluginHelper >, MSObjectXtnd< GeomObject, MSPluginGeomObject >, MSObjectXtnd< ShapeObject, MSPluginShape >, and MSObjectXtnd< GenLight, MSPluginLight >.
{ return 0; }
virtual BOOL HasUVW | ( | int | mapChannel | ) | [inline, virtual] |
It is called to find out if the object is has UVW coordinates for the specified mapping channel.
This method returns TRUE if the object has UVW coordinates; otherwise FALSE. See the method HasUVW() above for more details.
mapChannel | See List of Mapping Channels Values. |
Reimplemented in Object, ShapeObject, PolyObject, TriObject, and MSModifierXtnd.
{ return (mapChannel==1) ? HasUVW() : FALSE; }
virtual 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.
sw | The new state for the generate UVW flag. |
Reimplemented in ShapeObject, MSPluginShape, MSShapeXtnd, MSPluginSimpleObject, MSSimpleObjectXtnd, MSSimpleManipulatorXtnd, MSPluginModifier, MSModifierXtnd, MSSimpleModXtnd, MSPluginObject< ShapeObject >, MSPluginObject< HelperObject >, MSPluginObject< GeomObject >, MSPluginObject< GenCamera >, MSPluginObject< GenLight >, MSObjectXtnd< GenCamera, MSPluginCamera >, MSObjectXtnd< HelperObject, MSPluginHelper >, MSObjectXtnd< GeomObject, MSPluginGeomObject >, MSObjectXtnd< ShapeObject, MSPluginShape >, and MSObjectXtnd< GenLight, MSPluginLight >.
{ }
virtual void SetGenUVW | ( | int | mapChannel, |
BOOL | sw | ||
) | [inline, virtual] |
This method is called to change the state of its Generate UVW boolean for the specified mapping channel.
If the state changes, the object must send a REFMSG_CHANGE up the pipeline by calling NotifyDependents().
mapChannel | The mapping channel index. See List of Mapping Channel Index Values. |
sw | The new state for the generate UVW flag. |
Reimplemented in ShapeObject, and MSModifierXtnd.
{ if (mapChannel==1) SetGenUVW (sw); }
virtual void ShowEndResultChanged | ( | BOOL | showEndResult | ) | [inline, virtual] |
This method notifies the BaseObject that the end result display has been switched (the "Show End Result" button has been toggled).
Sometimes this is needed for display changes. This method is
implemented in Edit
Mesh, which uses it as shown below: void
EditMeshMod::ShowEndResultChanged(BOOL showEndResult) {
NotifyDependents(FOREVER, PART_DISPLAY, REFMSG_CHANGE);
}
This allows the Edit
Mesh modifier to update itself in repsonse to a user click of
the "Show End Result" button in the modifier panel.
showEndResult | TRUE if Show End Result is on; FALSE if off. |
Reimplemented in PatchObject, SplineShape, and MSModifierXtnd.
{ }
virtual BOOL HasViewDependentBoundingBox | ( | ) | [inline, virtual] |
This method return true if GetWorldBoundBox returns different boxes for different viewports.
It is used to inhibit a caching of the bounding box for all viewports. This was added to allow developers to disable the bounding box cache. It may be overridden to return true if an object has a dynamic drawing style, or as the method suggests is view dependent.
{ return false; }
friend class ModifyTaskImp
[friend] |