Object

3DS Max Plug-In SDK

Object

See Also: Class Object.

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.

These are some of the main methods of Object.

InitNodeName()

This method provides a default name for the node in the scene when the object is first created.

DoOwnSelectHilite()

If a plug-in overrides this method to return TRUE, then the plug-in becomes responsible for drawing itself in a selected state (if it is selected). Otherwise, the system sets the current line/material color appropriately.

ObjectValidity()

This method returns the validity interval for the object. This is the intersection of the validity intervals for all of the object's channels.

IsDeformable()

If an object is deformable as a point object, then it should return TRUE from this method. A deformable object is a generic point object that supports the following methods:

NumPoints()

Returns the number of deformable points

GetPoint(i)

Returns the 'i-th' point.

SetPoint(i)

This method sets the 'i-th' point.

PointsWereChanged()

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.

Deform()

This is the preferred method of deforming a deformable object rather than calling GetPoint(i) and SetPoint(i). This method applies the given deformable object to its points (or just its selected points if the selected parameter is specified).

GetDeformBBox()

Gets the bounding box of the object in a particular coordinate system specified by the given matrix. This will only be called on an object that is itself deformable.

All objects must be able to convert to TriObjects. And optionally they may convert to other types. A modifier specifies the type of object it wishes to operate on (using InputType()). The modifier may only be applied if the object is of the type that the modifier requests or is capable of converting to that type.

CanConvertToType()

This method returns a boolean to indicate if the object can be converted to the desired type passed in.

ConvertToType()

If the object can be converted to the type passed in, this method creates a new instance of that object type and returns it.

IntersectRay()

This is used for ray tracing, or defining planes of tangency at a point (for example, defining a construction plane at a specific point on an object). It is also used by commands such as Place Highlight that require the surface normal at a point on an object. The mesh class implements this method so if your object is represented by a mesh this may be calculated automatically.