Public Member Functions

Object Class Reference

This reference page is linked to from the following overview topics: Lesson 2: The Scene Graph and Nodes, Overview: Scene Graph and Nodes, Scene Objects, Reference Messages, Deformable Objects, Mappable Objects, Geometry Pipeline System, Pipeline Overview, Object State, Viewport Rendering and the Pipeline, Writing Pipeline Compatible Objects, Object Locking, Channel Locking, Channel Copying, Preparing Channels for Modification, Simple Modifiers, Topology Modifiers, Mapping Coordinate Modifiers, Validity Intervals, Extracting the Mesh from a Node, Creating and Retrieving 3ds Max NURBS Objects, Shader Semantics and Annotations, Animatables and Sub-Animatables, Wrapping 3ds Max Objects, Converting Objects to Compatible Types, Using a Deformer, Implementing Sub-Object Selection.


Search for all occurrences

Detailed Description

The object class is the base class for all objects.

An object is one of two things: A procedural object or a derived object. Derived objects are part of the system and may not be created by plug-ins. They are containers for modifiers. Procedural objects can be many different things such as cameras, lights, helper objects, geometric objects, etc. Methods of this class are responsible for things such as allowing the object to be deformed (changing its points), retrieving a deformed bounding box, converting the object between different types (to a mesh or patch for example), texture mapping the object (if appropriate) and interacting with the system regarding mapping. There are other methods involved in validity intervals for the object and its channels, and a method used to return the sub-object selection state of the object.

Method Groups:
See Method Groups for Class Object.
See also:
Class BaseObject, Class Deformer, Class Interval, Class GraphicsWindow,
Template Class Tab, Geometry Pipeline System

#include <object.h>

Inheritance diagram for Object:
Inheritance graph
[legend]

List of all members.

Public Member Functions

CoreExport  Object ()
CoreExport  ~Object ()
virtual int  IsRenderable ()=0
  Indicates whether the object may be rendered.
virtual void  InitNodeName (MSTR &s)=0
  This is the default name of the node when it is created.
virtual int  UsesWireColor ()
  This method determines if the object color is used for display.
virtual int  DoOwnSelectHilite ()
  If an object wants to draw itself in the 3D viewports in its selected state in some custom manner this method should return nonzero.
virtual int  IntersectRay (TimeValue t, Ray &r, float &at, Point3 &norm)
  This method is called to compute the intersection point and surface normal at this intersection point of the ray passed and the object.
virtual BOOL  NormalAlignVector (TimeValue t, Point3 &pt, Point3 &norm)
  Objects that don't support the IntersectRay() method (such as helper objects) can implement this method to provide a default vector for use with the normal align command in 3ds Max.
Data Flow Evaluation Methods

Most plug-in procedural objects do not need to be concerned with the following methods associated with locks, channels and shallow copies.

The only type of plug-ins that needs to be concerned with these methods are objects that actually flow down the pipeline. Most procedural plug-ins don't go down the pipeline, instead they convert themselves to a TriObject or PatchObject, and these goes down the pipeline. It is these TriObjects or PatchObject that deal with these methods. However plug-in objects that actually flow down the pipeline will use these methods. For more information see the Advanced Topics section on the Geometry Pipeline System.

void  LockObject ()
  Implemented by the System.
void  UnlockObject ()
  Implemented by the System.
int  IsObjectLocked ()
  Implemented by the System.
virtual ObjectState  Eval (TimeValue t)=0
  This method is called to evaluate the object and return the result as an ObjectState.
void  LockChannels (ChannelMask channels)
  Implemented by the System.
void  UnlockChannels (ChannelMask channels)
  Implemented by the System.
ChannelMask  GetChannelLocks ()
  Implemented by the System.
void  SetChannelLocks (ChannelMask channels)
  Implemented by the System.
ChannelMask  GetChannelLocks (ChannelMask m)
  Implemented by the System.
virtual BOOL  CanCacheObject ()
  This method determines if this object can have channels cached.
virtual void  WSStateInvalidate ()
  This is called by a node when the node's world space state has become invalid.
virtual BOOL  IsWorldSpaceObject ()
  Returns TRUE if the object as a world space object; otherwise FALSE.
CoreExport INode GetWorldSpaceObjectNode ()
virtual BOOL  IsParticleSystem ()
CoreExport void  CopyChannelLocks (Object *obj, ChannelMask needChannels)
  Implemented by the System.
virtual void  TopologyChanged ()
virtual int  IsDeformable ()
  Indicates whether this object is deformable.
virtual int  NumPoints ()
  The points of a deformable object are accessed through a virtual array interface.
virtual Point3  GetPoint (int i)
  The points of a deformable object are accessed through a virtual array interface.
virtual void  SetPoint (int i, const Point3 &p)
  The points of a deformable object are accessed through a virtual array interface.
virtual BOOL  IsPointSelected (int i)
  Returns TRUE if the 'i-th' point is selected; otherwise FALSE.
virtual float  PointSelection (int i)
  Returns a floating point weighted point selection if the object supports it.
virtual BOOL  HasWeights ()
  Returns TRUE if the object has weights for its points that can be set; otherwise FALSE.
virtual double  GetWeight (int i)
  Returns the weight of the specified point of the object.
virtual void  SetWeight (int i, const double w)
  Sets the weight of the specified point.
virtual BOOL  PolygonCount (TimeValue t, int &numFaces, int &numVerts)
  Retreives the number of faces and vertices of the polyginal mesh representation of this object.
virtual void  PointsWereChanged ()
  Informs the object that its points have been deformed, so it can invalidate its cache.
virtual CoreExport void  Deform (Deformer *defProc, int useSel=0)
  This is the method used to deform the object with a deformer.
virtual CoreExport void  GetDeformBBox (TimeValue t, Box3 &box, Matrix3 *tm=NULL, BOOL useSel=FALSE)
  This method computes the bounding box in the objects local coordinates or the optional space defined by tm.
virtual int  IsMappable ()
  This method lets you know if the ApplyUVWMap() method is available for this object.
virtual int  NumMapChannels ()
  Returns the maximum number of channels supported by this type of object.
virtual int  NumMapsUsed ()
  Returns the number of maps currently used by this object.
virtual void  ApplyUVWMap (int type, float utile, float vtile, float wtile, int uflip, int vflip, int wflip, int cap, const Matrix3 &tm, int channel=1)
  This method may be called to map the object with UVW mapping coordinates.
virtual CoreExport int  CanConvertToType (Class_ID obtype)
  Indicates whether the object can be converted to the specified type.
virtual CoreExport Object ConvertToType (TimeValue t, Class_ID obtype)
  This method converts this object to the type specified and returns a pointer it.
virtual Class_ID  PreferredCollapseType ()
  This method allows objects to specify the class that is the best class to convert to when the user collapses the stack.
virtual CoreExport void  GetCollapseTypes (Tab< Class_ID > &clist, Tab< MSTR * > &nlist)
  When the user clicks on the Edit Stack button in the modify branch a list of 'Convert To:' types is presented.
virtual Object CollapseObject ()
  This method is called on the world space cache object when the stack gets collapsed, that lets the pipeline object decide, if it wants to return a different object than itself.
virtual DWORD  GetSubselState ()
  For objects that have sub selection levels, this method returns the current selection level of the object.
virtual void  SetSubSelState (DWORD s)
CoreExport void  ReadyChannelsForMod (ChannelMask channels)
  Implemented by the System.
virtual CoreExport Interval  ChannelValidity (TimeValue t, int nchan)
  Retrieve the current validity interval for the nchan channel of the object.
virtual CoreExport void  SetChannelValidity (int nchan, Interval v)
  Sets the validity interval of the specified channel.
virtual CoreExport void  InvalidateChannels (ChannelMask channels)
  This method invalidates the intervals for the given channel mask.
virtual CoreExport Interval  ObjectValidity (TimeValue t)
  This method returns the validity interval of the object as a whole at the specified time.
virtual Object MakeShallowCopy (ChannelMask channels)
  This method must make a copy of its "shell" and then shallow copy (see below) only the specified channels.
virtual CoreExport void  ShallowCopy (Object *fromOb, ChannelMask channels)
  This method copies the specified channels from the fromOb to this and copies the validity intervals.
virtual CoreExport void  FreeChannels (ChannelMask channels)
  This method deletes the memory associated with the specified channels and set the intervals associated with the channels to invalid (empty).
virtual CoreExport void  NewAndCopyChannels (ChannelMask channels)
  This method replaces the locked channels with newly allocated copies.
virtual CoreExport void  MaybeEnlargeViewportRect (GraphicsWindow *gw, Rect &rect)
  This method allows the object to enlarge its viewport rectangle, if it wants to.
CoreExport bool  IsBaseClassOwnedChannel (int nchan)
CoreExport void  UpdateValidity (int nchan, Interval v)
  When a modifier is applied to an object, it needs to include its own validity interval in the interval of the object.
Interval  GetNoEvalInterval ()
void  SetNoEvalInterval (Interval iv)
virtual CoreExport void  ReduceCaches (TimeValue t)
  This method give the object the chance to reduce its caches.
virtual int  IsConstObject ()
  This is called to determine if this is a construction object or not.
virtual int  NumPipeBranches (bool selected=true)
  This method returns the number of pipeline branches combined by the object.
virtual Object GetPipeBranch (int i, bool selected=true)
  Retrieves sub-object branches from an object that supports branching.
virtual INode GetBranchINode (TimeValue t, INode *node, int i, bool selected=true)
  When an object has sub-object branches, it is likely that the sub-objects are transformed relative to the object.
Shapes Within Objects

Shape viewports can reference shapes contained within objects, so the system needs to be able to access the shapes within an object.

The following four methods provide this access. These methods are used by the loft object. Since loft objects are made up of shapes, this gives the system the ability to query the object to find out if it is a shape container. Most objects don't contain shapes so they can just use the default implementations.

virtual int  NumberOfContainedShapes ()
  Returns the number of shapes contained inside this object.
virtual ShapeObject GetContainedShape (TimeValue t, int index)
  This method returns the ShapeObject specified by the index passed at the time specified.
virtual void  GetContainedShapeMatrix (TimeValue t, int index, Matrix3 &mat)
  Returns the matrix associated with the shape whose index is passed.
virtual BitArray  ContainedShapeSelectionArray ()
  This is used by the lofter.
virtual BOOL  IsShapeObject ()
virtual BOOL  CheckObjectIntegrity ()
  This method is used for debugging only.
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 Object FindBaseObject ()
  It is called to return a pointer to the base object (an object that is not a derived object).
virtual BOOL  IsParamSurface ()
  There are several methods used to access a parametric position on the surface of the object.
virtual int  NumSurfaces (TimeValue t)
  Returns the number of parametric surfaces within the object.
virtual Point3  GetSurfacePoint (TimeValue t, float u, float v, Interval &iv)
  This method needs to be implemented if Object::IsParamSurface() returns TRUE.
virtual Point3  GetSurfacePoint (TimeValue t, int surface, float u, float v, Interval &iv)
  This method is used to retrieve a point on the specified surface of the object based on two parameters of the surface, u and v.
virtual void  SurfaceClosed (TimeValue t, int surface, BOOL &uClosed, BOOL &vClosed)
  This method allows the object to return flags that indicate whether the parametric surface is closed in the U and V dimensions.
virtual BOOL  GetExtendedProperties (TimeValue t, MSTR &prop1Label, MSTR &prop1Data, MSTR &prop2Label, MSTR &prop2Data)
  This method allows an object to return extended Properties fields.
CoreExport SvGraphNodeReference  SvTraverseAnimGraph (IGraphObjectManager *gom, Animatable *owner, int id, DWORD flags)
CoreExport bool  SvHandleDoubleClick (IGraphObjectManager *gom, IGraphNode *gNode)
CoreExport MSTR  SvGetName (IGraphObjectManager *gom, IGraphNode *gNode, bool isBeingEdited)
CoreExport COLORREF  SvHighlightColor (IGraphObjectManager *gom, IGraphNode *gNode)
CoreExport bool  SvIsSelected (IGraphObjectManager *gom, IGraphNode *gNode)
  Returns true if the object is selected in its schematic view.
CoreExport MultiSelectCallback SvGetMultiSelectCallback (IGraphObjectManager *gom, IGraphNode *gNode)
CoreExport bool  SvCanSelect (IGraphObjectManager *gom, IGraphNode *gNode)
CoreExport void  AddXTCObject (XTCObject *pObj, int priority=0, int branchID=-1)
  This method adds an extension object into the pipeline.
CoreExport int  NumXTCObjects ()
  Returns the number of extension objects maintained by this Object.
CoreExport XTCObject GetXTCObject (int index)
  Returns a pointer to the specified extension object.
CoreExport void  RemoveXTCObject (int index)
  Removes the extension object as indicated by the index.
CoreExport void  SetXTCObjectPriority (int index, int priority)
  Sets the priority for the extension object whose index is passed.
CoreExport int  GetXTCObjectPriority (int index)
  Returns the integer priority number of the extension object whose index is passed.
CoreExport void  SetXTCObjectBranchID (int index, int branchID)
  Sets the branch ID of the extension object whose index is passed.
CoreExport int  GetXTCObjectBranchID (int index)
  Returns the integer branch ID of the extension object whose index is passed.
CoreExport void  MergeAdditionalChannels (Object *from, int branchID)
  This method has to be called whenever the CompoundObject updates a branch (calling Eval() on it).
CoreExport void  BranchDeleted (int branchID, bool reorderChannels)
  This method has to be called on the CompoundObject so it can delete the XTCObjects for the specified branch.
CoreExport void  CopyAdditionalChannels (Object *from, bool deleteOld=true, bool bShallowCopy=false)
  This method copies all extension objects from the "from" object into the current object.
CoreExport void  DeleteAllAdditionalChannels ()
  Implemented by the System.
virtual BOOL  UseSelectionBrackets ()
  This method allows an object to choose whether or not it will display selection brackets in shaded viewports.
virtual BOOL  IsManipulator ()
CoreExport void *  GetInterface (ULONG id)
  Inherited from Animatable.
CoreExport BaseInterface GetInterface (Interface_ID id)
  Inherited from Animatable.
virtual void  ReduceDisplayCaches ()
  Should reduce any derived display data to save memory, since the node wont be drawn until the user undhides it.
virtual bool  NeedGWCacheRebuilt (GraphicsWindow *gw, Material *ma, int numMat)
  This returns whether the Graphics Cache for this object needs to be rebuilt.
virtual void  BuildGWCache (GraphicsWindow *gw, Material *ma, int numMat, BOOL threaded)
  This builds the graphics window cached mesh.

Constructor & Destructor Documentation

CoreExport Object ( )
CoreExport ~Object ( )

Member Function Documentation

virtual int IsRenderable ( ) [pure virtual]

Indicates whether the object may be rendered.

Some objects such as construction grids and helpers should not be rendered and can return zero.

Returns:
Nonzero if the object may be rendered; otherwise 0.

Implemented in DummyObject, CameraObject, LightObject, HelperObject, GeomObject, ShapeObject, SimpleWSMObject, MSPluginGeomObject, MSGeomObjectXtnd, MSPluginShape, and MSShapeXtnd.

virtual void InitNodeName ( MSTR s ) [pure virtual]
virtual int UsesWireColor ( ) [inline, virtual]

This method determines if the object color is used for display.

Returns:
TRUE if the object color is used for display; otherwise FALSE.

Reimplemented in CameraObject, HelperObject, WSMObject, MSPluginHelper, MSHelperXtnd, MSPluginLight, MSLightXtnd, MSPluginCamera, MSCameraXtnd, MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

{ return TRUE; }    // TRUE if the object color is used for display
virtual int DoOwnSelectHilite ( ) [inline, virtual]

If an object wants to draw itself in the 3D viewports in its selected state in some custom manner this method should return nonzero.

If this item returns nonzero, the BaseObject::Display() method should respect the selected state of the object when it draws itself. If this method returns zero the system will use its standard method of showing the object as selected.

Returns:
Nonzero if the object will draw itself in the selected state; otherwise 0. If nonzero, the plug-in developer is responsible for displaying the object in the selected state as part of its Display() method.

Reimplemented in DummyObject, SimpleWSMObject, and SimpleParticle.

{ return 0; }
virtual int IntersectRay ( TimeValue  t,
Ray r,
float &  at,
Point3 norm 
) [inline, virtual]

This method is called to compute the intersection point and surface normal at this intersection point of the ray passed and the object.

Parameters:
t The time to compute the intersection.
r Ray to intersect. See Class Ray.
at The point of intersection.
norm Surface normal at the point of intersection.
Returns:
Nonzero if a point of intersection was found; otherwise 0.
See also:
The Mesh class implementation of this method.

Reimplemented in ShapeObject, PatchObject, PolyObject, SimpleObject, TriObject, MSPluginShape, MSShapeXtnd, MSSimpleObjectXtnd, 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 FALSE;}
virtual BOOL NormalAlignVector ( TimeValue  t,
Point3 pt,
Point3 norm 
) [inline, virtual]

Objects that don't support the IntersectRay() method (such as helper objects) can implement this method to provide a default vector for use with the normal align command in 3ds Max.

Parameters:
t The time to compute the normal align vector.
pt The point of intersection.
norm The normal at the point of intersection.
Returns:
TRUE if this method is implemented to return the normal align vector; otherwise FALSE.

Reimplemented in HelperObject, ConstObject, ParticleObject, WSMObject, MSPluginHelper, MSHelperXtnd, MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

{return FALSE;}
void LockObject ( ) [inline]

Implemented by the System.

This method locks the object as a whole. The object defaults to not modifiable.

{ locked |= OBJECT_LOCKED; }
void UnlockObject ( ) [inline]

Implemented by the System.

This method unlocks the object as a whole.

{ locked &= ~OBJECT_LOCKED; }
int IsObjectLocked ( ) [inline]

Implemented by the System.

Returns nonzero if the object is locked; otherwise 0.

{ return (locked&OBJECT_LOCKED ? 1 : 0); }
virtual ObjectState Eval ( TimeValue  t ) [pure virtual]

This method is called to evaluate the object and return the result as an ObjectState.

When the system has a pointer to an object it doesn't know if it's a procedural object or a derived object. So it calls Eval() on it and gets back an ObjectState. A derived object managed by the system may have to call Eval() on its input for example. A plug-in (like a procedural object) typically just returns itself. A plug-in that does not just return itself is the Morph Object (/MAXSDK/SAMPLES/OBJECTS/MORPHOBJ.CPP). This object uses a morph controller to compute a new object and fill in an ObjectState which it returns.

Parameters:
t Specifies the time to evaluate the object.
Returns:
The result of evaluating the object as an ObjectState.
Sample Code:
Typically this method is implemented as follows:
    { return ObjectState(this); }

Implemented in DummyObject, LinearShape, SimpleManipulator, PatchObject, PolyObject, SimpleObject, SimpleWSMObject, SimpleParticle, SimpleShape, SimpleSpline, SplineShape, TriObject, MSHelperXtnd, MSShapeXtnd, MSSimpleObjectXtnd, 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 >.

void LockChannels ( ChannelMask  channels ) [inline]

Implemented by the System.

Locks the specified channels of the object.

Parameters:
channels The channels to lock.
{ locked |= channels; } 
void UnlockChannels ( ChannelMask  channels ) [inline]

Implemented by the System.

Unlocks the specified channel(s) of the object.

Parameters:
channels Specifies the channels to unlock.
{ locked &= ~channels; }
ChannelMask GetChannelLocks ( ) [inline]

Implemented by the System.

Returns the locked status of the channels.

Returns:
The channels of the object that are locked.
{ return locked; }    
void SetChannelLocks ( ChannelMask  channels ) [inline]

Implemented by the System.

Sets the locked status of the object's channels.

Parameters:
channels The channel to set to locked.
{ locked = channels; }    
ChannelMask GetChannelLocks ( ChannelMask  m ) [inline]

Implemented by the System.

Returns the locked status of the channels.

Parameters:
m Not used.
Returns:
The channels of the object that are locked.
{ return locked; }
virtual BOOL CanCacheObject ( ) [inline, virtual]

This method determines if this object can have channels cached.

Particle objects flow up the pipeline without making shallow copies of themselves and therefore cannot be cached. Objects other than particle system can just use the default implementation.

Returns:
TRUE if the object can be cached; otherwise FALSE.

Reimplemented in ParticleObject.

{return TRUE;}
virtual void WSStateInvalidate ( ) [inline, virtual]

This is called by a node when the node's world space state has become invalid.

Normally an object does not (and should not) be concerned with this, but in certain cases like particle systems an object is effectively a world space object an needs to be notified.

Reimplemented in SimpleParticle.

{}
virtual BOOL IsWorldSpaceObject ( ) [inline, virtual]

Returns TRUE if the object as a world space object; otherwise FALSE.

World space objects (particles for example) can not be instanced because they exist in world space not object space. Objects other than particle system can just use the default implementation.

Reimplemented in SimpleParticle.

{return FALSE;}
CoreExport INode* GetWorldSpaceObjectNode ( )
virtual BOOL IsParticleSystem ( ) [inline, virtual]

Reimplemented in ParticleObject.

{return FALSE;}
CoreExport void CopyChannelLocks ( Object obj,
ChannelMask  needChannels 
)

Implemented by the System.

Copies the specified channels from the object passed.

Parameters:
obj The source object.
needChannels Indicates the channels to copy.
virtual void TopologyChanged ( ) [inline, virtual]
virtual int IsDeformable ( ) [inline, virtual]

Indicates whether this object is deformable.

A deformable object is simply an object with points that can be modified. Deformable objects must implement the generic deformable object methods (NumPoints(), GetPoint(i), SetPoint(i), Deform()). A deformable object is simply an object with points that can be modified. These points can be stored in any form the object wants. They are accessed through a virtual array interface with methods to get and set the 'i-th' point. If an object has tangents for instance, it would convert them to and from points as necessary. For example, a simple Bezier spline object that stored its control handles relative to the knot would convert them to be absolute when GetPoint() was called with 'i' specifying one of the control points. When the control point is later set, the object can convert it back to be relative to its knot. At this point it could also apply any constraints that it may have, such as maintaining a degree of continuity. The idea is that the entity calling GetPoint(i) and SetPoint(i) doesn't care what the point represents. It will simply apply some function to the point.

Note:
The Deformable object methods only need to be implemented if the object returns TRUE from this method.
Returns:
Return nonzero if the object is deformable and implements the generic deformable object methods; otherwise 0.

Reimplemented in LinearShape, ParticleObject, PatchObject, PolyObject, SplineShape, and TriObject.

{ return 0; } 
virtual int NumPoints ( ) [inline, virtual]

The points of a deformable object are accessed through a virtual array interface.

This method specifies the number of points in the object. The meaning of 'points' is defined by the object. A TriObject uses the vertices as the points for example. b>

Returns:
The number of points in the object.

Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, and TriObject.

{ return 0;}
virtual Point3 GetPoint ( int  i ) [inline, virtual]

The points of a deformable object are accessed through a virtual array interface.

This method returns the 'i-th' point of the object.

Note:
If your plug-in is a modifier and you want to operate on the selected points of the object you are modifying, you can't tell which points are selected unless you know the type of object. If it is a generic deformable object there is no way of knowing since the way the object handles selection is up to it. Therefore, if you want to operate on selected points of a generic deformable object, use a Deformer.
Parameters:
i Specifies which point should be returned.
Returns:
The 'i-th' point of the object.

Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, and TriObject.

{ return Point3(0,0,0); }
virtual void SetPoint ( int  i,
const Point3 p 
) [inline, virtual]

The points of a deformable object are accessed through a virtual array interface.

This method stores the 'i-th' point of the object.

Parameters:
i The index of the point to store.
p The point to store.

Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, and TriObject.

{}             
virtual BOOL IsPointSelected ( int  i ) [inline, virtual]

Returns TRUE if the 'i-th' point is selected; otherwise FALSE.

Parameters:
i The zero based index of the point to check.

Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, and TriObject.

{ return FALSE; }
virtual float PointSelection ( int  i ) [inline, virtual]

Returns a floating point weighted point selection if the object supports it.

The default implementation just returns 1.0f if selected and 0.0f if not.

Parameters:
i The zero based index of the point to check.

Reimplemented in PolyObject, and TriObject.

                                         {
        return IsPointSelected(i) ? 1.0f : 0.0f;
    }
virtual BOOL HasWeights ( ) [inline, virtual]

Returns TRUE if the object has weights for its points that can be set; otherwise FALSE.

{ return FALSE; }
virtual double GetWeight ( int  i ) [inline, virtual]

Returns the weight of the specified point of the object.

Parameters:
i The point to return the weight of.
{ return 1.0; }
virtual void SetWeight ( int  i,
const double  w 
) [inline, virtual]

Sets the weight of the specified point.

Parameters:
i The point whose weight to set.
w The value to set.
{}
virtual BOOL PolygonCount ( TimeValue  t,
int &  numFaces,
int &  numVerts 
) [inline, virtual]

Retreives the number of faces and vertices of the polyginal mesh representation of this object.

If this method returns FALSE then this functionality is not supported. Note: Plug-In developers should use the global function GetPolygonCount(Object*, int&, int&) to retrieve the number f vertices and faces in an arbitrary object.

Parameters:
t The time at which to compute the number of faces and vertices.
numFaces The number of faces is returned here.
numVerts The number of vertices is returned here.
Returns:
TRUE if the method is fully implemented; otherwise FALSE.

Reimplemented in PatchObject, PolyObject, SimpleObject, and TriObject.

{ return FALSE; }
virtual void PointsWereChanged ( ) [inline, virtual]

Informs the object that its points have been deformed, so it can invalidate its cache.

A developer who uses the GetPoint() / SetPoint() approach to modifying an object will call PointsWereChanged() to invalidate the object's cache. For example, if a modifier calls SetPoint(), when it is finished it should call this method so the object can invalidate and/or update its bounding box and any other data it might cache.

Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, and TriObject.

{}
virtual CoreExport void Deform ( Deformer defProc,
int  useSel = 0 
) [virtual]

This is the method used to deform the object with a deformer.

The developer should loop through the object's points calling the defProc for each point (or each selected point if useSel is nonzero). The Deform() method is mostly a convenience. Modifiers can implement a 'Deformer' callback object which is passed to the Deform() method. The object then iterates through its points calling their deformer's callback for each point. The only difference between using the Deform() method as opposed to iterating through the points is that the Deform() method should respect sub-object selection. For example, the TriObject's implementation of Deform() iterates through its vertices, if the TriObject's selection level is set to vertex then it only calls the Deformer's callback for vertices that are selected. This way modifiers can be written that can be applied only to selection sets without any specific code to check selected points. The default implementation of this method just iterates through all points using GetPoint(i) and SetPoint(i). If an object supports sub-object selection sets then it should override this method.

Parameters:
defProc A pointer to an instance of the Deformer class. This is the callback object that actually performs the deformation.
useSel A flag to indicate if the object should use the selected points only. If nonzero the selected points are used; otherwise all the points of the object are used.
Default Implementation:
    void Object::Deform(Deformer *defProc,int useSel)
    {
        int nv = NumPoints();
        for (int i=0; i<nv; i++)
            SetPoint(i,defProc->Map(i,GetPoint(i)));
        PointsWereChanged();
    }
Sample Code:
This code shows the TriObject implementation of this method. Note how it looks at the useSel parameter to only call the selected points if required.
    void TriObject::Deform(Deformer *defProc,int useSel)
    {
        int nv = NumPoints();
        int i;
        if ( useSel ) {
            BitArray sel = mesh.VertexTempSel();
            float *vssel = mesh.getVSelectionWeights ();
            if (vssel) {
                for (i=0; i<nv; i++) {
                    if(sel[i]) {
                        SetPoint(i,defProc->Map(i,GetPoint(i)));
                        continue;
                    }
                    if (vssel[i]==0) continue;
                    Point3 & A = GetPoint(i);
                    Point3 dir = defProc->Map(i,A) - A;
                    SetPoint(i,A+vssel[i]*dir);
                }
            }
            else {
                for (i=0; i<nv; i++) if (sel[i])
                    SetPoint(i,defProc->Map(i,GetPoint(i)));
            }
        }
        else {
            for (i=0; i<nv; i++)
                SetPoint(i,defProc->Map(i,GetPoint(i)));
        }
        PointsWereChanged();
    }

Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, and TriObject.

virtual CoreExport void GetDeformBBox ( TimeValue  t,
Box3 box,
Matrix3 tm = NULL,
BOOL  useSel = FALSE 
) [virtual]

This method computes the bounding box in the objects local coordinates or the optional space defined by tm.

Note: If you are looking for a precise bounding box, use this method and pass in the node's object TM (INode::GetObjectTM()) as the matrix.

Parameters:
t The time to compute the box.
box A reference to a box the result is stored in.
tm This is an alternate coordinate system used to compute the box. If the tm is not NULL this matrix should be used in the computation of the result.
useSel If TRUE, the bounding box of selected sub-elements should be computed; otherwise the entire object should be used.

Reimplemented in DummyObject, LinearShape, SimpleManipulator, PatchObject, PolyObject, SimpleObject, SimpleWSMObject, SimpleParticle, SimpleShape, SimpleSpline, SplineShape, TriObject, MSHelperXtnd, MSLightXtnd, MSCameraXtnd, MSSimpleObjectXtnd, 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 IsMappable ( ) [inline, virtual]

This method lets you know if the ApplyUVWMap() method is available for this object.

This is used by things like the UVW mapping modifier, so that it can determine which objects can have their mapping modified. Returns nonzero if the object is mappable; otherwise zero.

Reimplemented in PatchObject, PolyObject, and TriObject.

{ return 0; }
virtual int NumMapChannels ( ) [inline, virtual]

Returns the maximum number of channels supported by this type of object.

TriObjects for instance return MAX_MESHMAPS which is currently set to 100.

Reimplemented in PatchObject, PolyObject, and TriObject.

{ return IsMappable(); }    // returns number possible.
virtual int NumMapsUsed ( ) [inline, virtual]

Returns the number of maps currently used by this object.

This is at least 1+(highest channel in use). This is used so a plug-in that does something to all map channels doesn't always have to do it to every channel up to MAX_MESHMAPS but rather only to this value.

Reimplemented in PatchObject, PolyObject, and TriObject.

{ return NumMapChannels(); }    // at least 1+(highest channel in use).
virtual void ApplyUVWMap ( int  type,
float  utile,
float  vtile,
float  wtile,
int  uflip,
int  vflip,
int  wflip,
int  cap,
const Matrix3 tm,
int  channel = 1 
) [inline, virtual]

This method may be called to map the object with UVW mapping coordinates.

If the object returns nonzero from IsMappable() then this method should be implemented.

Parameters:
type The mapping type. One of the following values: MAP_PLANAR
MAP_CYLINDRICAL
MAP_SPHERICAL
MAP_BALL
MAP_BOX
utile Number of tiles in the U direction.
vtile Number of tiles in the V direction.
wtile Number of tiles in the W direction.
uflip If nonzero the U values are mirrored.
vflip If nonzero the V values are mirrored.
wflip If nonzero the W values are mirrored.
cap This is used with MAP_CYLINDRICAL. If nonzero, then any face normal that is pointing more vertically than horizontally will be mapped using planar coordinates.
tm This defines the mapping space. As each point is mapped, it is multiplied by this matrix, and then it is mapped.
channel This indicates which channel the mapping is applied to. See List of Mapping Channel Index Values.

Reimplemented in PatchObject, PolyObject, and TriObject.

                                         {}
virtual CoreExport int CanConvertToType ( Class_ID  obtype ) [virtual]

Indicates whether the object can be converted to the specified type.

If the object returns nonzero to indicate it can be converted to the specified type, it must handle converting to and returning an object of that type from ConvertToType().

See also:
Class ObjectConverter for additional details on converting objects between types.
Parameters:
obtype The Class_ID of the type of object to convert to. See Class Class_ID, List of Class_IDs.
Returns:
Nonzero if the object can be converted to the specified type; otherwise 0.
Default Implementation:
{ return 0; }

Reimplemented in LinearShape, PatchObject, PolyObject, SimpleObject, SimpleParticle, SimpleShape, SimpleSpline, SplineShape, TriObject, MSSimpleObjectXtnd, 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 Object* ConvertToType ( TimeValue  t,
Class_ID  obtype 
) [virtual]

This method converts this object to the type specified and returns a pointer it.

Note that if ConvertToType() returns a new object it should be a completely different object with no ties (pointers or references) to the original.

See also:
class ObjectConverter for additional details on converting objects between types.
The following is an issue that developers of world space modifiers need to
be aware of if the world space modifier specifies anything but generic deformable objects as its input type. In other words, if a world space modifier, in its implementation of Modifier::InputType(), doesn't specifically return defObjectClassID then the following issue regarding the 3ds Max pipeline needs to be considered. Developers of other plug-ins that don't meet this condition don't need to be concerned with this issue.
World space modifiers that work on anything other than generic deformable
objects are responsible for transforming the points of the object they modify into world space using the ObjectState TM. To understand why this is necessary, consider how 3ds Max applies the node transformation to the object flowing down the pipeline.
In the geometry pipeline architecture, the node in the scene has its
transformation applied to the object in the pipeline at the transition between the last object space modifier and the first world space modifier. The node transformation is what places the object in the scene -- thus this is what puts the object in world space. The system does this by transforming the points of the object in the pipeline by the node transformation. This is only possible however for deformable objects. Deformable objects are those that support the Object::IsDeformable(), NumPoints(), GetPoint() and SetPoint() methods. These deformable objects can be deformed by the system using these methods, and thus the system can modify the points to put them in world space itself.
If a world space modifier does not specify that it works on deformable
objects, the system is unable to transform the points of the object into world space. What it does instead is apply the transformation to the ObjectState TM. In this case, a world space modifier is responsible for transforming the points of the object into world space itself, and then setting the ObjectState TM to the identity. There is an example of this in the sample code for the Bomb space warp. The Bomb operates on TriObjects and implements InputType() as { return Class_ID(TRIOBJ_CLASS_ID,0); }. Since it doesn't specifically return defObjectClassID, it is thus responsible for transforming the points of the object into world space itself. It does this in its implementation of ModifyObject() as follows:
    if (os->GetTM())
    {
        Matrix3 tm = *(os->GetTM());
        for (int i=0; i<triOb->mesh.getNumVerts(); i++) {
            triOb->mesh.verts[i] = triOb->mesh.verts[i] *tm;
        }
        os->obj->UpdateValidity(GEOM_CHAN_NUM,os->tmValid());
        os->SetTM(NULL,FOREVER);
    }
As the code above shows, the Bomb checks if the ObjectState TM is non-NULL. If it is, the points of the object are still not in world space and thus must be transformed. It does this by looping through the points of the TriObject and multiplying each point by the ObjectState TM. When it is done, it sets the ObjectState TM to NULL to indicate the points are now in world space. This ensure that any later WSMs will not transform the points with this matrix again.
For the Bomb world space modifier this is not a problem since it specifies
in its implementation of ChannelsChanged() that it will operate on the geometry channel (PART_GEOM). Certain world space modifiers may not normally specify PART_GEOM in their implementation of ChannelsChanged(). Consider the camera mapping world space modifier. Its function is to apply mapping coordinates to the object it is applied to. Thus it would normally only specify PART_TEXMAP for ChannelsChanged(). However, since it operates directly on TriObjects, just like the Bomb, the system cannot transform the points into world space, and therefore the camera mapping modifier must do so in its implementation of ModifyObject(). But since it is actually altering the points of the object by putting them into world space it is altering the geometry channel. Therefore, it should really specify PART_GEOM | PART_TEXMAP in its implementation of ChannelsChanged(). If it didn't do this, but went ahead and modified the points of the object anyway, it would be transforming not copies of the points, but the original points stored back in an earlier cache or even the base object.
This is the issue developers need to be aware of. To state this in simple
terms then: Any world space modifier that needs to put the points of the object into world space (since it doesn't implement InputType() as defObjectClassID) needs to specify PART_GEOM in its implementation of ChannelsChanged().
Parameters:
t The time at which to convert.
obtype The Class_ID of the type of object to convert to. See Class Class_ID, List of Class_IDs.
Returns:
A pointer to an object of type obtype.
Default Implementation:
{ return NULL; }
Sample Code:
The following code shows how a TriObject can be retrieved from a node. Note on the code that if you call ConvertToType() on an object and it returns a pointer other than itself, you are responsible for deleting that object.
    // Retrieve the TriObject from the node
    int deleteIt;
    TriObject *triObject = GetTriObjectFromNode(ip->GetSelNode(0),deleteIt);
    // Use the TriObject if available
    if (!triObject) return;
    // ...
    // Delete it when done...
    if (deleteIt) triObject->DeleteMe();
    
    // Return a pointer to a TriObject given an INode or return NULL
    // if the node cannot be converted to a TriObject
    TriObject *Utility::GetTriObjectFromNode(INode *node, int &deleteIt)
    {
        deleteIt = FALSE;
        Object *obj = node->EvalWorldState(0).obj;
        if (obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0))) {
            TriObject *tri = (TriObject *) obj->ConvertToType(0,Class_ID(TRIOBJ_CLASS_ID, 0));
    // Note that the TriObject should only be deleted
    // if the pointer to it is not equal to the object
    // pointer that called ConvertToType()
            if (obj != tri) 
                deleteIt = TRUE;
            return tri;
        }
        else {
            return NULL;
        }
    }

Reimplemented in LinearShape, PatchObject, PolyObject, SimpleObject, SimpleParticle, SimpleShape, SimpleSpline, SplineShape, TriObject, MSSimpleObjectXtnd, 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 Class_ID PreferredCollapseType ( ) [inline, virtual]

This method allows objects to specify the class that is the best class to convert to when the user collapses the stack.

The main base classes have default implementations. For example, GeomObject specifies TriObjects as its preferred collapse type and shapes specify splines as their preferred collapse type

Returns:
The Class_ID of the preferred object type. See List of Class_IDs.

Reimplemented in GeomObject, ShapeObject, MSPluginShape, and MSShapeXtnd.

{return Class_ID(0,0);}
virtual CoreExport void GetCollapseTypes ( Tab< Class_ID > &  clist,
Tab< MSTR * > &  nlist 
) [virtual]

When the user clicks on the Edit Stack button in the modify branch a list of 'Convert To:' types is presented.

The use may click on one of these choices to collapse the object into one of these types (for instance, an Editable Mesh or an Editable NURBS object). This method returns a list of Class_IDs and descriptive strings that specify the allowable types of objects that this object may be collapsed into. Note: Most plug-ins call the base class method in Object in their implementation of this method. The base class implementation provided by Object checks if the object can convert to both an editable mesh and an editable spline. If it can, these are added to the allowable types.

Parameters:
clist The table of allowable Class_IDs.
nlist The table of pointers to strings that correspond to the table of Class_IDs above.
Sample Code:
    void SphereObject::GetCollapseTypes(Tab<Class_ID> &clist,Tab<MSTR*>&nlist)
    {
        Object::GetCollapseTypes(clist, nlist);
        Class_ID id = EDITABLE_SURF_CLASS_ID;
        MSTR *name = new MSTR(GetString(IDS_SM_NURBS_SURFACE));
        clist.Append(1,&id);
        nlist.Append(1,&name);
    }

Reimplemented in PatchObject, SimpleSpline, SplineShape, MSSimpleObjectXtnd, 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 Object* CollapseObject ( ) [inline, virtual]

This method is called on the world space cache object when the stack gets collapsed, that lets the pipeline object decide, if it wants to return a different object than itself.

The default implementation simply returns this. A PolyObject e.g. can create and return an EditablePolyObject in this method, so that the collapsed object has a UI. I only implemented this method for PolyObject, but this can potentially implemented that way for all pipeline objects, that currently pass up the editable version. It is important, that all places, that collapse the stack are calling this method after evaluating the stack.

It also is important, that the editable version implements this method to
simply return this, otherwise you'll get a non-editable object when you collapse an editable polyobject.
Returns:
A pointer to the resulting object.

Reimplemented in PolyObject.

{ return this;}
virtual DWORD GetSubselState ( ) [inline, virtual]

For objects that have sub selection levels, this method returns the current selection level of the object.

For example, a TriObject has the following selection levels: object, vertex, face, edge. Other object types may have different selection levels. The only standard is that a value of 0 indicates object level. b>

Returns:
The current selection level of the object.

Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, and TriObject.

{return 0;} 
virtual void SetSubSelState ( DWORD  s ) [inline, virtual]

Reimplemented in PolyObject, and TriObject.

{}
CoreExport void ReadyChannelsForMod ( ChannelMask  channels )

Implemented by the System.

If the requested channels are locked, this method will replace their data
with a copy and unlock them, otherwise it leaves them alone.
Parameters:
channels The channels to ready for modification.
virtual CoreExport Interval ChannelValidity ( TimeValue  t,
int  nchan 
) [virtual]

Retrieve the current validity interval for the nchan channel of the object.

Note:
Most procedural objects won't implement this method since they don't have individual channels. Developers wanting to get the validity interval for a procedural object should use Object::ObjectValidity() instead.
Parameters:
t The time to retrieve the validity interval of the channel.
nchan Specifies the channel to return the validity interval of. See Object Channel Indices.
Returns:
The validity interval of the specified channel.

Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, and TriObject.

virtual CoreExport void SetChannelValidity ( int  nchan,
Interval  v 
) [virtual]

Sets the validity interval of the specified channel.

Parameters:
nchan Specifies the channel. See Object Channel Indices
v The validity interval for the channel.

Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, and TriObject.

virtual CoreExport void InvalidateChannels ( ChannelMask  channels ) [virtual]

This method invalidates the intervals for the given channel mask.

This just sets the validity intervals to empty (calling SetEmpty() on the interval).

Parameters:
channels Specifies the channels to invalidate.

Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, and TriObject.

virtual CoreExport Interval ObjectValidity ( TimeValue  t ) [virtual]
virtual Object* MakeShallowCopy ( ChannelMask  channels ) [inline, virtual]

This method must make a copy of its "shell" and then shallow copy (see below) only the specified channels.

It must also copy the validity intervals of the copied channels, and invalidate the other intervals.

Parameters:
channels The channels to copy.
Returns:
A pointer to the shallow copy of the object.

Reimplemented in LinearShape, PatchObject, PolyObject, SimpleParticle, SplineShape, TriObject, and MSShapeXtnd.

{ return NULL; }
virtual CoreExport void ShallowCopy ( Object fromOb,
ChannelMask  channels 
) [virtual]

This method copies the specified channels from the fromOb to this and copies the validity intervals.

A plug-in needs to copy the specified channels from the specified object fromOb to itself by just copying pointers (not actually copying the data). No new memory is typically allocated, this method is just copying the pointers.

Parameters:
fromOb Object to copy the channels from.
channels Channels to copy.

Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, TriObject, and MSShapeXtnd.

virtual CoreExport void FreeChannels ( ChannelMask  channels ) [virtual]

This method deletes the memory associated with the specified channels and set the intervals associated with the channels to invalid (empty).

Parameters:
channels Specifies the channels to free.

Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, and TriObject.

virtual CoreExport void NewAndCopyChannels ( ChannelMask  channels ) [virtual]

This method replaces the locked channels with newly allocated copies.

It will only be called if the channel is locked.

Parameters:
channels The channels to be allocate and copy.

Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, and TriObject.

virtual CoreExport void MaybeEnlargeViewportRect ( GraphicsWindow gw,
Rect rect 
) [virtual]

This method allows the object to enlarge its viewport rectangle, if it wants to.

The system will call this method for all objects when calculating the viewport rectangle; the object can enlarge the rectangle if desired. This is used by the Editable Spline code to allow extra room for vertex serial numbers, which can extend outside the normal bounding rectangle.

Parameters:
gw Points to the GraphicsWindow associated with the viewport.
rect The enlarged rectangle is returned here.
Default Implementation:
{}
Sample Code:
    void SplineShape::MaybeEnlargeViewportRect(GraphicsWindow *gw, Rect &rect)
    {
        if(!showVertNumbers)
            return;
        MCHAR dummy[256];
        SIZE size;
        int maxverts = -1;
        for(int i = 0; i < shape.splineCount; ++i) {
            int verts = shape.splines[i]->KnotCount();
            if(verts > maxverts)
                maxverts = verts;
        }
        sprintf(dummy,"%d",maxverts);
        gw->getTextExtents(dummy, &size);
        rect.SetW(rect.w() + size.cx);
        rect.SetY(rect.y() - size.cy);
        rect.SetH(rect.h() + size.cy);
    }

Reimplemented in SplineShape.

CoreExport bool IsBaseClassOwnedChannel ( int  nchan ) [inline]
{ return (nchan == EXTENSION_CHAN_NUM) ? true : false;}
CoreExport void UpdateValidity ( int  nchan,
Interval  v 
)

When a modifier is applied to an object, it needs to include its own validity interval in the interval of the object.

To do this, a modifier calls the UpdateValidity() method of an object. This method intersects interval v to the nchan channel validity of the object.

Parameters:
nchan The validity interval of the modifier is intersected with this channel of the object. See Object Channel Indices.
v The interval to intersect.
Interval GetNoEvalInterval ( ) [inline]

This method is used internally.

{ return noEvalInterval; }
void SetNoEvalInterval ( Interval  iv ) [inline]

This method is used internally.

{noEvalInterval = iv; }
virtual CoreExport void ReduceCaches ( TimeValue  t ) [virtual]

This method give the object the chance to reduce its caches.

Parameters:
t The time to discard any caches the object has.
virtual int IsConstObject ( ) [inline, virtual]

This is called to determine if this is a construction object or not.

Returns:
Nonzero if the object is a construction object; otherwise 0.

Reimplemented in ConstObject.

{ return 0; }  
virtual int NumPipeBranches ( bool  selected = true ) [inline, virtual]

This method returns the number of pipeline branches combined by the object.

This is not the total number of branches, but rather the number that are active. For example in the boolean object, if the user does not have any operands selected, this methods would return zero. If they have one selected it would return one.

Parameters:
selected This parameter must be supported by all compound objects. In case the selected parameter is true the object should only return the number of pipebranches, that are currently selected in the UI (this is the way it worked in R3 and before. In case this parameter is false, the object has to return the number of all branches, no matter if they are selected or not
{return 0;}
virtual Object* GetPipeBranch ( int  i,
bool  selected = true 
) [inline, virtual]

Retrieves sub-object branches from an object that supports branching.

Certain objects combine a series of input objects (pipelines) into a single object. These objects act as a multiplexer allowing the user to decide which branch(s) they want to see the history for. It is up to the object how they want to let the user choose. For example the object may use sub-object selection to allow the user to pick a set of objects for which the common history will be displayed. When the history changes for any reason, the object should send a notification (REFMSG_BRANCHED_HISTORY_CHANGED) using NotifyDependents().

Parameters:
i The branch index.
selected This parameter must be supported by all compound objects. In case the selected parameter is true the object should only return the number of pipebranches, that are currently selected in the UI (this is the way it worked in R3 and before. In case this parameter is false, the object has to return the number of all branches, no matter if they are selected or not
Returns:
The 'i-th' sub-object branch.
{return NULL;}
virtual INode* GetBranchINode ( TimeValue  t,
INode node,
int  i,
bool  selected = true 
) [inline, virtual]

When an object has sub-object branches, it is likely that the sub-objects are transformed relative to the object.

This method gives the object a chance to modify the node's transformation so that operations (like edit modifiers) will work correctly when editing the history of the sub object branch. An object can implement this method by returning a pointer to a new INodeTransformed that is based on the node passed into this method. See Class INodeTransformed.

Parameters:
t The time to get the INode.
node The original INode pointer.
i The branch index.
selected This parameter must be supported by all compound objects. In case the selected parameter is true the object should only return the number of pipebranches, that are currently selected in the UI (this is the way it worked in R3 and before. In case this parameter is false, the object has to return the number of all branches, no matter if they are selected or not
Returns:
A pointer to an INode. This can be the original passed in (the default implementation does this) or a new INodeTransformed.
{return node;}
virtual int NumberOfContainedShapes ( ) [inline, virtual]

Returns the number of shapes contained inside this object.

A shape container may return zero if it doesn't currently have any shapes.

Returns:
The number of shapes. A return value of -1 indicates this is not a container.
{ return -1; }    // NOT a container!
virtual ShapeObject* GetContainedShape ( TimeValue  t,
int  index 
) [inline, virtual]

This method returns the ShapeObject specified by the index passed at the time specified.

See Class ShapeObject.

Parameters:
t The time to return the shape.
index The index of the shape.
{ return NULL; }
virtual void GetContainedShapeMatrix ( TimeValue  t,
int  index,
Matrix3 mat 
) [inline, virtual]

Returns the matrix associated with the shape whose index is passed.

This matrix contains the offset within the object used to align the shape viewport to the shape.

Parameters:
t The time to return the matrix.
index The index of the shape whose matrix to return.
mat The matrix is returned here.
{}
virtual BitArray ContainedShapeSelectionArray ( ) [inline, virtual]

This is used by the lofter.

The lofter can have several shapes selected, and the bit array returned here will have a bit set for each selected shape. See Class BitArray.

Returns:
{ return BitArray(); }
virtual BOOL IsShapeObject ( ) [inline, virtual]

Reimplemented in ShapeObject.

{ return FALSE; }
virtual BOOL CheckObjectIntegrity ( ) [inline, virtual]

This method is used for debugging only.

The TriObject implements this method by making sure its face's vert indices are all valid.

Returns:
TRUE if valid; otherwise FALSE.

Reimplemented in PolyObject, and TriObject.

{return TRUE;}              
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 from BaseObject.

Reimplemented in ShapeObject, PolyObject, TriObject, MSPluginShape, MSShapeXtnd, MSPluginSimpleObject, MSSimpleObjectXtnd, MSSimpleManipulatorXtnd, 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.

Parameters:
mapChannel See List of Mapping Channels Values.

Reimplemented from BaseObject.

Reimplemented in ShapeObject, PolyObject, and TriObject.

{ return (mapChannel==1) ? HasUVW() : FALSE; }
virtual Object* FindBaseObject ( ) [inline, virtual]

It is called to return a pointer to the base object (an object that is not a derived object).

This method is overridden by DerivedObjects to search down the pipeline for the base object. The default implementation just returns this. This function is still implemented by derived objects and WSM's to search down the pipeline. This allows you to just call it on a nodes ObjectRef without checking for type.

{ return this;  }
virtual BOOL IsParamSurface ( ) [inline, virtual]

There are several methods used to access a parametric position on the surface of the object.

If this method returns TRUE then Object::GetSurfacePoint() will be called to return a point on the surface that corresponds to the u and v parameters passed to it. If this method returns FALSE then it is assumed the object does not support returning a point on the surface based on parameteric values. For sample code see /MAXSDK/SAMPLES/OBJECTS/SPHERE.CPP. If the object has several parametric surfaces then a second version of GetSurfacePoint() with an integer which specifies which surface will be called.

Reimplemented in PatchObject.

{return FALSE;}
virtual int NumSurfaces ( TimeValue  t ) [inline, virtual]

Returns the number of parametric surfaces within the object.

Parameters:
t The time at which to check.
{return 1;}
virtual Point3 GetSurfacePoint ( TimeValue  t,
float  u,
float  v,
Interval iv 
) [inline, virtual]

This method needs to be implemented if Object::IsParamSurface() returns TRUE.

This method is used to retrieve a point on the surface of the object based on two parameters of the surface, u and v. Note: This method assumes there is a single parametric surface. If there is more than 1 (NumSurfaces() returns > 1, use the GetSurface() method below which allows for multiple surfaces.

Parameters:
t The time to retrieve the point.
u The parameter along the horizontal axis of the surface.
v The parameter along the vertical axis of the surface.
iv This interval is updated based on the interval of the surface parameter.

Reimplemented in PatchObject.

{return Point3(0,0,0);}
virtual Point3 GetSurfacePoint ( TimeValue  t,
int  surface,
float  u,
float  v,
Interval iv 
) [inline, virtual]

This method is used to retrieve a point on the specified surface of the object based on two parameters of the surface, u and v.

Parameters:
t The time to retrieve the point.
surface The zero based index of the surface. This number is >=0 and <NumSurfaces().
u The parameter along the horizontal axis of the surface.
v The parameter along the vertical axis of the surface.
iv This interval is updated based on the interval of the surface parameter.
{return Point3(0,0,0);}
virtual void SurfaceClosed ( TimeValue  t,
int  surface,
BOOL &  uClosed,
BOOL &  vClosed 
) [inline, virtual]

This method allows the object to return flags that indicate whether the parametric surface is closed in the U and V dimensions.

Set the appropriate closure variables to TRUE if the surface is closed in that direction, FALSE if it is not. A torus, for example, is closed in both directions.

Parameters:
t The time to check the surface.
surface The zero based index of the surface. This number is >=0 and <NumSurfaces().
uClosed Set to TRUE if the surface is closed in U; otherwise to FALSE.
vClosed Set to TRUE if the surface is closed in V; otherwise to FALSE.
{uClosed = vClosed = TRUE;}
virtual BOOL GetExtendedProperties ( TimeValue  t,
MSTR prop1Label,
MSTR prop1Data,
MSTR prop2Label,
MSTR prop2Data 
) [inline, virtual]

This method allows an object to return extended Properties fields.

It is called when the Object Properties dialog is being prepared. If you don't want to display any extended properties, simply return FALSE. To display extended property fields, place the field label in the appropriate label string and the display value in a formatted string. Two fields are supplied, each with a label and a data string; if only using one, make the second label field and data field blank (""). Return TRUE to indicate you have filled in the fields. The properties dialog will display your returned values.

Parameters:
t The time at which the strings are requested.
prop1Label The string for the property 1 label.
prop1Data The formatted data string to appear as property 1.
prop2Label The string for the property 2 label.
prop2Data The formatted data string to appear as property 2.
Returns:
TRUE if this method is implemented and the fields are filled in; otherwise FALSE.

Reimplemented in ShapeObject, PatchObject, MSPluginShape, and MSShapeXtnd.

{return FALSE;}
CoreExport SvGraphNodeReference SvTraverseAnimGraph ( IGraphObjectManager gom,
Animatable owner,
int  id,
DWORD  flags 
) [virtual]
Remarks:
This method is available in release 3.0 and later only.

This method traverses the graph of objects in the 3ds Max scene, adding desired objects to the schematic view. Developers can specialize this behaviour by overriding this method and adding whatever objects are interesting to the schematic view. Objects are added to the schematic view by calling IGraphObjectManager::AddAnimatable(...). Reference lines are added to the schematic view by calling IGraphObjectManager::AddReference(...). Implementers of this method should call it recursively to process other objects in the scene.

See Class IGraphObjectManager.
Parameters:
gom Points to the schematic view window manager.
owner The owning animatable.
id This is usually the sub-anim number (but can actually be any value the developer chooses).
flags See List of Schematic %View AddAnimatable Flags.
Returns:
A SvGraphNodeReference object.

Reimplemented from Animatable.

CoreExport bool SvHandleDoubleClick ( IGraphObjectManager gom,
IGraphNode gNode 
) [virtual]
Remarks:
This method is available in release 3.0 and later only.

This method is called when this node is double-clicked in the schematic view.
Parameters:
gom Points to the schematic view window manager.
gNode Points to the node in the schematic view.
Returns:
true is handled; false if not interested in the event.
Default Implementation:
{ return false; }

Reimplemented from Animatable.

CoreExport MSTR SvGetName ( IGraphObjectManager gom,
IGraphNode gNode,
bool  isBeingEdited 
) [virtual]
Remarks:
Returns the name of the object as it appears in the schematic view.
Parameters:
gom Points to the schematic view window manager.
gNode Points to this node in the schematic view.
isBeingEdited TRUE if the item is being edited; FALSE if not.
Default Implementation:
        {
            Animatable *owner;
            int subNum;
            MSTR name;
            owner = gNode->GetOwner();
            subNum = gNode->GetID();
            name = owner->SubAnimName(subNum);
            return name;
        }

Reimplemented from Animatable.

CoreExport COLORREF SvHighlightColor ( IGraphObjectManager gom,
IGraphNode gNode 
) [virtual]
Remarks:
This method is available in release 3.0 and later only.

Returns the highlight color for this node. The highlight color is used to outline nodes in the schematic view when SvIsHighlighted(...) returns true.
Parameters:
gom Points to the schematic view window manager.
gNode Points to this node in the schematic view.
Returns:
See COLORREF-DWORD format.
Default Implementation:
{ return gom->SvGetUIColor(SV_UICLR_PLUGIN_HIGHLIGHT); }

Reimplemented from Animatable.

CoreExport bool SvIsSelected ( IGraphObjectManager gom,
IGraphNode gNode 
) [virtual]

Returns true if the object is selected in its schematic view.

Reimplemented from Animatable.

CoreExport MultiSelectCallback* SvGetMultiSelectCallback ( IGraphObjectManager gom,
IGraphNode gNode 
) [virtual]
Remarks:
This method is called before a multiple select/deselect operation in the schematic view. Returns a callback used to perform the (de)selection. May return NULL if this object cannot be selected in some principle editor outside the schematic view.
Parameters:
gom Points to the schematic view window manager.
gNode Points to the node in the schematic view.
Returns:
A pointer to the callback object. See Class MultiSelectCallback.
Default Implementation:
{ return NULL; }

Reimplemented from Animatable.

CoreExport bool SvCanSelect ( IGraphObjectManager gom,
IGraphNode gNode 
) [virtual]
Remarks:
Returns true if this object can be selected in some editor (viewport, material editor, plug-in specific editor, etc.). Selection is actually accomplished by via the SvGetMultiSelectCallback(...) mechanism described above.
Parameters:
gom Points to the schematic view window manager.
gNode Points to the node in the schematic view.
Default Implementation:
{ return false; }

Reimplemented from Animatable.

CoreExport void AddXTCObject ( XTCObject pObj,
int  priority = 0,
int  branchID = -1 
)

This method adds an extension object into the pipeline.

Implemented by the System.

Parameters:
pObj Points to the extension object to add.
priority The priority of the object. The methods (XTCObject::Display(), PreChanChangedNotify() etc) of higher priority XTCObjects will be called before those of lower priority XTCObjects.
branchID The branch identifier of the object.
CoreExport int NumXTCObjects ( )

Returns the number of extension objects maintained by this Object.

Implemented by the System.

CoreExport XTCObject* GetXTCObject ( int  index )

Returns a pointer to the specified extension object.

Implemented by the System.

Parameters:
index The zero based index of the extension object to return.
CoreExport void RemoveXTCObject ( int  index )

Removes the extension object as indicated by the index.

Implemented by the System.

Parameters:
index The zero based index of the extension object to remove.
CoreExport void SetXTCObjectPriority ( int  index,
int  priority 
)

Sets the priority for the extension object whose index is passed.

Implemented by the System.

Parameters:
index The zero based index of the extension object to remove.
priority The new priority to assign.
CoreExport int GetXTCObjectPriority ( int  index )

Returns the integer priority number of the extension object whose index is passed.

Implemented by the System.

Parameters:
index The zero based index of the extension object to check.
CoreExport void SetXTCObjectBranchID ( int  index,
int  branchID 
)

Sets the branch ID of the extension object whose index is passed.

Implemented by the System.

Parameters:
index The zero based index of the extension object whose branch ID is set.
branchID The branch identifier to set.
CoreExport int GetXTCObjectBranchID ( int  index )

Returns the integer branch ID of the extension object whose index is passed.

Implemented by the System.

Parameters:
index The zero based index of the extension object whose branch ID is to be returned.
CoreExport void MergeAdditionalChannels ( Object from,
int  branchID 
)

This method has to be called whenever the CompoundObject updates a branch (calling Eval() on it).

Object *from is the object returned from Eval(os.obj). The branchID is an integer that specifies that branch. The extension channel will get a callback to XTCObject::RemoveXTCObjectOnMergeBranches() and XTCObject::MergeXTCObject(). By default it returns true to RemoveXTCObjectOnMergeBranches which means that the existing XTCObjects with that branchID will be deleted. The method MergeXTCObject simply copies the XTCObjects from the incoming branch into the compound object. Implemented by the System.

Parameters:
from The object to merge additional channels from.
branchID The branch identifier to set.
CoreExport void BranchDeleted ( int  branchID,
bool  reorderChannels 
)

This method has to be called on the CompoundObject so it can delete the XTCObjects for the specified branch.

The XTCObject will again have the final decision if the XTCObject gets really deleted or not in a callback to XTCObject::RemoveXTCObjectOnBranchDeleted() which will return true if the XTCOject should be removed. Implemented by the System.

Parameters:
branchID Specifies which brach of the compound object the extension objects are deleted from.
reorderChannels TRUE to reorder the channels, otherwise FALSE.
CoreExport void CopyAdditionalChannels ( Object from,
bool  deleteOld = true,
bool  bShallowCopy = false 
)

This method copies all extension objects from the "from" object into the current object.

In case deleteOld is false the objects will be appended. If it is true the old XTCObjects will be deleted. Implemented by the System.

Parameters:
from The source object which contains extension objects.
deleteOld If true the original objects are deleted after the copy; if false they remain after the copy.
bShallowCopy If true only a ShallowCopy() is performed; if false a complete copy of the objects is done.
CoreExport void DeleteAllAdditionalChannels ( )

Implemented by the System.

This method will delete all additional channels.

virtual BOOL UseSelectionBrackets ( ) [inline, virtual]

This method allows an object to choose whether or not it will display selection brackets in shaded viewports.

The method will return FALSE if no selection brackets are displayed or TRUE if it does display selection brackets.

Reimplemented in SimpleManipulator.

{ return TRUE; }
virtual BOOL IsManipulator ( ) [inline, virtual]

Reimplemented in Manipulator.

{ return FALSE; }
CoreExport void* GetInterface ( ULONG  id ) [virtual]
CoreExport BaseInterface* GetInterface ( Interface_ID  id ) [virtual]
virtual void ReduceDisplayCaches ( ) [inline, virtual]

Should reduce any derived display data to save memory, since the node wont be drawn until the user undhides it.

This function should delete any derived data used to display the object such as gfx normals, direct mesh caches etc. Tnis is called when the user hides the node or sets it as bounding box

Reimplemented in PolyObject, and TriObject.

{  }
virtual bool NeedGWCacheRebuilt ( GraphicsWindow gw,
Material ma,
int  numMat 
) [inline, virtual]

This returns whether the Graphics Cache for this object needs to be rebuilt.

Parameters:
GraphicsWindow *gw the active graphics window
Material *ma the material aray assigned to the mesh
int numMat the number of materials in the material array

Reimplemented in PolyObject, and TriObject.

{ return false; }
virtual void BuildGWCache ( GraphicsWindow gw,
Material ma,
int  numMat,
BOOL  threaded 
) [inline, virtual]

This builds the graphics window cached mesh.

Parameters:
GraphicsWindow *gw the active graphics window
Material *ma the material aray assigned to the mesh
int numMat the number of materials in the material array
BOOL threaded whether when building the cache it can use additional threads. This is needed since the system may be creating many meshes at the same time

Reimplemented in PolyObject, and TriObject.

{  }

Object Object Object Object Object Object Object Object Object Object
Object Object Object Object Object Object Object Object Object Object