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.
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.
#include <object.h>
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.
|
CoreExport Object | ( | ) |
CoreExport ~Object | ( | ) |
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.
Implemented in DummyObject, CameraObject, LightObject, HelperObject, GeomObject, ShapeObject, SimpleWSMObject, MSPluginGeomObject, MSGeomObjectXtnd, MSPluginShape, and MSShapeXtnd.
virtual void InitNodeName | ( | MSTR & | s | ) | [pure virtual] |
This is the default name of the node when it is created.
s | The default name of the node is stored here. |
Implemented in DummyObject, SphereGizmoObject, CylGizmoObject, BoxGizmoObject, SimpleManipulator, CameraObject, LightObject, HelperObject, GeomObject, ShapeObject, SimpleObject, SimpleWSMObject, SimpleParticle, SimpleShape, SimpleSpline, SplineShape, MSPluginShape, 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 >.
virtual int UsesWireColor | ( | ) | [inline, virtual] |
This method determines if the object color is used for display.
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.
Reimplemented in DummyObject, SimpleWSMObject, and SimpleParticle.
{ return 0; }
This method is called to compute the intersection point and surface normal at this intersection point of the ray passed and the object.
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. |
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;}
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.
t | The time to compute the normal align vector. |
pt | The point of intersection. |
norm | The normal at the point of intersection. |
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.
t | Specifies the time to evaluate the object. |
{ 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.
channels | The channels to lock. |
{ locked |= channels; }
void UnlockChannels | ( | ChannelMask | channels | ) | [inline] |
Implemented by the System.
Unlocks the specified channel(s) of the object.
channels | Specifies the channels to unlock. |
{ locked &= ~channels; }
ChannelMask GetChannelLocks | ( | ) | [inline] |
Implemented by the System.
Returns the locked status of the channels.
{ return locked; }
void SetChannelLocks | ( | ChannelMask | channels | ) | [inline] |
Implemented by the System.
Sets the locked status of the object's channels.
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.
m | Not used. |
{ 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.
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] |
CoreExport void CopyChannelLocks | ( | Object * | obj, |
ChannelMask | needChannels | ||
) |
Implemented by the System.
Copies the specified channels from the object passed.
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.
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>
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.
i | Specifies which point should be returned. |
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.
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.
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.
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.
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.
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.
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. |
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.
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. |
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(); }
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.
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.
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().
obtype | The Class_ID of the type of object to convert to. See Class Class_ID, List of Class_IDs. |
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 >.
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.
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); }
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. |
// 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
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.
clist | The table of allowable Class_IDs. |
nlist | The table of pointers to strings that correspond to the table of Class_IDs above. |
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.
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>
Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, and TriObject.
{return 0;}
virtual void SetSubSelState | ( | DWORD | s | ) | [inline, virtual] |
CoreExport void ReadyChannelsForMod | ( | ChannelMask | channels | ) |
Implemented by the System.
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.
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. |
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.
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).
channels | Specifies the channels to invalidate. |
Reimplemented in LinearShape, PatchObject, PolyObject, SplineShape, and TriObject.
virtual CoreExport Interval ObjectValidity | ( | TimeValue | t | ) | [virtual] |
This method returns the validity interval of the object as a whole at the specified time.
t | The time to compute the validity interval. |
Reimplemented in DummyObject, GizmoObject, SphereGizmoObject, CylGizmoObject, BoxGizmoObject, LinearShape, SimpleManipulator, PatchObject, PolyObject, SimpleObject, SimpleWSMObject, SimpleParticle, SimpleShape, SimpleSpline, SplineShape, TriObject, MSHelperXtnd, 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* 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.
channels | The channels to copy. |
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.
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).
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.
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.
gw | Points to the GraphicsWindow associated with the viewport. |
rect | The enlarged rectangle is returned here. |
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.
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] |
void SetNoEvalInterval | ( | Interval | iv | ) | [inline] |
virtual CoreExport void ReduceCaches | ( | TimeValue | t | ) | [virtual] |
This method give the object the chance to reduce its caches.
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.
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.
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().
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 |
{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.
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 |
{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.
{ 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.
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.
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] |
virtual BOOL IsShapeObject | ( | ) | [inline, virtual] |
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.
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.
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.
t | The time at which to check. |
{return 1;}
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.
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.
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.
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.
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. |
Reimplemented in ShapeObject, PatchObject, MSPluginShape, and MSShapeXtnd.
{return FALSE;}
CoreExport SvGraphNodeReference SvTraverseAnimGraph | ( | IGraphObjectManager * | gom, |
Animatable * | owner, | ||
int | id, | ||
DWORD | flags | ||
) | [virtual] |
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. |
Reimplemented from Animatable.
CoreExport bool SvHandleDoubleClick | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
gNode | Points to the node in the schematic view. |
Reimplemented from Animatable.
CoreExport MSTR SvGetName | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode, | ||
bool | isBeingEdited | ||
) | [virtual] |
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. |
{ 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] |
gom | Points to the schematic view window manager. |
gNode | Points to this node in the schematic view. |
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] |
gom | Points to the schematic view window manager. |
gNode | Points to the node in the schematic view. |
Reimplemented from Animatable.
CoreExport bool SvCanSelect | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
gNode | Points to the node in the schematic view. |
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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] |
CoreExport void* GetInterface | ( | ULONG | id | ) | [virtual] |
Inherited from Animatable.
Returns a pointer to the interface.
id | - The id of the interface. |
Reimplemented from BaseObject.
Reimplemented in IDerivedObject, LightObject, ShapeObject, WSMObject, PatchObject, PodObj, SimpleObject, SimpleParticle, SplineShape, TriObject, MSPluginSimpleObject, MSSimpleObjectXtnd, MSPluginSimpleManipulator, 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 >.
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 BaseObject.
Reimplemented in SimpleManipulator, 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 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.
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.
Reimplemented in PolyObject, and TriObject.
{ }