Class IObject

3DS Max Plug-In SDK

Class IObject

See Also: Class BaseInterfaceServer, Class FPInterface, Class FPInterfaceDesc, Function Publishing, Class InterfaceServer,

class IObject : public BaseInterfaceServer

Description:

This class is available in release 4.0 and later only.

This is the base class used to publish functions from those objects not derived from Animatable. A developer inherits from this class and implements the methods of this class to provide information about the interfaces published by the class.

There is a corresponding ParamType2 type code, TYPE_IOBJECT, that allows instances of these classes to be passed and returned in FPInterface methods. This provides a simple form of user-defined type, in the sense that these instance collections are passed as interfaces rather than pointers. MAXScript has wrapper value classes for IObjects and so this mechanism provides a light-weight alternative to the MAXScript SDK facilities for adding new wrapper value classes to the scripter.

MAXScript also calls the AcquireInterface() and ReleaseInterface() methods on IObjects as it creates and collects these wrappers, so that IObject objects can keep track of MAXScript's extant references to them.

Methods:

public:

 

Prototype:

virtual TCHAR* GetIObjectName() = 0;

Remarks:

Returns the object/class name.

Default Implementation:

{ return _T(""); }

Prototype:

virtual int NumInterfaces() const = 0;

Remarks:

Returns the number of interfaces published by this object.

Default Implementation:

{ return 0; }

Prototype:

virtual BaseInterface *GetInterfaceAt(int i) const = 0;

Remarks:

Returns a pointer to the 'i-th' interface.

Parameters:

int i

The zero based index of the interface to return.

Default Implementation:

{ return NULL; }

Prototype:

virtual BaseInterface* GetInterface(Interface_ID id) = 0;

Remarks:

Returns a pointer to the interface whose ID is specified.

Parameters:

Interface_ID id

The ID of the interface to return.

Default Implementation:

{ return NULL; }

Prototype:

virtual void AcquireIObject();

Remarks:

This method is called when MAXScript makes a reference to this object. This is part of the IObject reference management and can be implemented by dynamically allocated IObjects for ref-count based lifetime control.

Default Implementation:

{ }

Prototype:

virtual void ReleaseIObject();

Remarks:

This method is called when MAXScript deletes a reference to this object. This is part of the IObject reference management and can be implemented by dynamically allocated IObjects for ref-count based lifetime control.

Default Implementation:

{ }

Prototype:

virtual void DeleteIObject();

Remarks:

This method is the virtual destructor for the IObject.

Default Implementation:

{ }