This reference page is linked to from the following overview topics: Material Libraries.
#include <imtl.h>
Public Member Functions |
|
CoreExport | MtlBaseLib () |
virtual CoreExport | ~MtlBaseLib () |
virtual CoreExport SClass_ID | SuperClassID () |
Retrieves a constant representing the type
of the plugin. |
|
virtual CoreExport Class_ID | ClassID () |
Retrieves a constant that uniquely
identifies the plugin class. |
|
virtual CoreExport void | GetClassName (MSTR &s) |
Retrieves the name of the plugin class.
|
|
virtual CoreExport int | NumSubs () |
virtual CoreExport Animatable * | SubAnim (int i) |
virtual CoreExport MSTR | SubAnimName (int i) |
virtual CoreExport RefResult | AutoDelete () |
Deletes the object when it has no more real
dependents. |
|
virtual CoreExport void | DeleteThis () |
Deletes an instance of this class. |
|
virtual CoreExport int | NumRefs () |
Returns the total number of references this
ReferenceMaker can hold. |
|
virtual CoreExport RefTargetHandle | GetReference (int i) |
Returns the 'i-th' reference. |
|
virtual CoreExport RefTargetHandle | Clone (RemapDir &remap) |
This method is used by 3ds Max to clone an
object. |
|
virtual CoreExport RefResult | NotifyRefChanged (Interval changeInt, RefTargetHandle hTarget, PartID &partID, RefMessage message) |
Receives and responds to messages. |
|
virtual CoreExport IOResult | Save (ISave *isave) |
Called for saving data. |
|
virtual CoreExport IOResult | Load (ILoad *iload) |
Called for loading data. |
|
virtual CoreExport void | DeleteAll () |
virtual CoreExport void | Remove (MtlBase *m) |
virtual CoreExport void | Add (MtlBase *m) |
virtual CoreExport void | RemoveDuplicates () |
Protected Member Functions |
|
virtual CoreExport void | SetReference (int i, RefTargetHandle rtarg) |
Stores a
ReferenceTarget as its 'i-th' reference`. |
|
int | GetMaterialCount () const |
Returns the count of materials under this
category. |
|
MtlBase * | GetMaterial (int i) const |
Get a pointer to the material with the given
index. |
|
MtlBase * | FindMaterial (const MCHAR *name) const |
Find the child material with the given name.
|
|
bool | AddMaterial (MtlBase *pMaterial) |
Add a material to the children list of this
category. |
|
void | RemoveMaterial (MtlBase *pMaterial) |
Removes the specified MtlBase from this category. |
|
void | SetMaterial (int i, MtlBase *pMaterial) |
void | SetMaterialCount (int count) |
Protected Attributes |
|
void * | mpReserved |
CoreExport MtlBaseLib | ( | ) |
virtual CoreExport ~MtlBaseLib | ( | ) | [virtual] |
virtual CoreExport SClass_ID SuperClassID | ( | ) | [virtual] |
Retrieves a constant representing the type of the plugin.
Reimplemented from ReferenceTarget.
virtual CoreExport Class_ID ClassID | ( | ) | [virtual] |
Retrieves a constant that uniquely identifies the plugin class.
This method must return the unique ID for the plugin class. If two ClassIDs conflict, the system will only load the first conflicting one it finds. A program (gencid.exe) is provided to generate unique class id values.
Reimplemented from Animatable.
virtual CoreExport void GetClassName | ( | MSTR & | s | ) | [virtual] |
Retrieves the name of the plugin class.
This name is usually used internally for debugging purposes. For Material plug-ins this method is used to put up the material "type" name in the Material Editor.
s | Reference to a string filled in with the name of the plugin class |
Reimplemented from ReferenceTarget.
virtual CoreExport int NumSubs | ( | ) | [virtual] |
Reimplemented from Animatable.
virtual CoreExport Animatable* SubAnim | ( | int | i | ) | [virtual] |
i | This is the index of the sub-anim to return. |
Reimplemented from Animatable.
virtual CoreExport MSTR SubAnimName | ( | int | i | ) | [virtual] |
i | The index of the parameter name to return |
Reimplemented from Animatable.
virtual CoreExport RefResult AutoDelete | ( | ) | [virtual] |
Deletes the object when it has no more real dependents.
This function is called by 3ds Max in order to delete a plugin object when its last real dependent has been deleted. It also allows derived classes to control the lifetime of their instances. The default implementation of this method will drop the references this object makes to other objects, and if the undo system is engaged (holding) it will ensure that the deletion is undo/redo-able. Override this method only if you don't want instances of your plugin to be automatically deleted when the last reference to them is deleted. Most subclasses of class ReferenceTarget will not need to override this method. Plugins should call ReferenceTarget::MaybeAutoDelete() or ReferenceMaker::DeleteMe() to delete instances of plugin objects. For more information on how 3ds Max deletes reference targets, see ReferenceTarget::MaybeAutoDelete()
Reimplemented from ReferenceTarget.
virtual CoreExport void DeleteThis | ( | ) | [virtual] |
Deletes an instance of this class.
3ds Max calls this method when it needs to delete a plugin object (an instance of a class derived from Animatable). Similarly, plugins that need to delete instances of an Animatable or a class directly derived from it via an Animatable pointer, should call this method instead of calling directly operator delete. Following these rules will ensure that the same memory manager is used to allocate and deallocate the object. The default implementation of this method deletes the object. Plugin instances that never need to be deleted from the heap can overwrite this method to do nothing.
Reimplemented from Animatable.
virtual CoreExport int NumRefs | ( | ) | [virtual] |
Returns the total number of references this ReferenceMaker can hold.
The plugin implements this method to indicate the total number of of references it can make. This includes all references whether they are NULL (inactive) or non-NULL (active) at the time when this method is called. A plugin can hold a variable number of references, thus the return value of this method is not to be cached and reused by client code.
Reimplemented from ReferenceMaker.
virtual CoreExport RefTargetHandle GetReference | ( | int | i | ) | [virtual] |
Returns the 'i-th' reference.
The plugin implements this method to return its 'i-th' reference. The plug-in simply keeps track of its references using an integer index for each one. This method is normally called by the system.
i | - The index of the reference to retrieve. Valid values are from 0 to NumRefs()-1. |
Reimplemented from ReferenceMaker.
virtual CoreExport void SetReference | ( | int | i, |
RefTargetHandle | rtarg | ||
) | [protected, virtual] |
Stores a ReferenceTarget as its 'i-th' reference`.
The plugin implements this method to store the reference handle passed to it as its 'i-th' reference. In its implementation of this method, the plugin should simply assign the reference handle passed in as a parameter to the member variable that holds the 'i-th' reference. Other reference handling methods such as ReferenceMaker::DeleteReference(), or ReferenceMaker::ReplaceReference() should not be called from within this method. The plugin itself or other plugins should not call this method directly. The system will call this method when a new reference is created or an existing one is replaced by calling ReferenceMaker::ReplaceReference().
i | - The index of the reference to store. Valid values are from 0 to NumRefs()-1. |
rtarg | - The reference handle to store. |
Reimplemented from ReferenceMaker.
virtual CoreExport RefTargetHandle Clone | ( | RemapDir & | remap | ) | [virtual] |
This method is used by 3ds Max to clone an object.
class MyDerivedPlugin : public MyBasePlugin { const int MY_REFERENCE = 1; ReferenceTarget* Clone(RemapDir& remap) { ReferenceTarget* result = new MyDerivedPlugin(); BaseClone(this, result, remap); return result; } void BaseClone(ReferenceTarget* from, ReferenceTarget* to, RemapDir& remap) { if (!to || !from || from == to) return; MyBasePlugin::BaseClone(from, to, remap); to->ReplaceReference(MY_REFERENCE, remap->CloneRef(from->GetReference(MY_REFERENCE))); } };
This method should not be directly called by plug-ins. Instead, either RemapDir::CloneRef() or CloneRefHierachy() should be used to perform cloning. These methods ensure that the mapping from the original object to the clone is added to the RemapDir used for cloning, which may be used during backpatch operations
remap | - A RemapDir instance used for remapping references during a Clone. |
Reimplemented from ReferenceTarget.
virtual CoreExport RefResult NotifyRefChanged | ( | Interval | changeInt, |
RefTargetHandle | hTarget, | ||
PartID & | partID, | ||
RefMessage | message | ||
) | [virtual] |
Receives and responds to messages.
A plugin which makes references must implement a method to receive and respond to messages broadcast by its dependents. This is done by implementing NotifyRefChanged(). The plugin developer usually implements this method as a switch statement where each case is one of the messages the plugin needs to respond to. The Method StdNotifyRefChanged calls this, which can change the partID to new value. If it doesn't depend on the particular message& partID, it should return REF_DONTCARE.
changeInt | - This is the interval of time over which the message is active. Currently, all plug-ins will receive FOREVER for this interval. |
hTarget | - This is the handle of the reference target the message was sent by. The reference maker uses this handle to know specifically which reference target sent the message. |
partID | - This contains information specific to the message passed in. Some messages don't use the partID at all. See the section List of Reference Messages for more information about the meaning of the partID for some common messages. |
message | - The message parameters passed into this method is the specific message which needs to be handled. |
Implements ReferenceMaker.
Called for saving data.
Called by the system to allow the plugin to save its data.
isave | - This pointer may be used to call methods to write data to disk. See the section on Loading and Saving for an overview of the load/save process. |
Reimplemented from ReferenceMaker.
Called for loading data.
Called by the system to allow the plug-in to load its data. See the section on Loading and Saving for an overview of the load - save process.
iload | - This interface pointer may be used to call methods to read data from disk. |
Reimplemented from ReferenceMaker.
virtual CoreExport void DeleteAll | ( | ) | [virtual] |
virtual CoreExport void Remove | ( | MtlBase * | m | ) | [virtual] |
virtual CoreExport void Add | ( | MtlBase * | m | ) | [virtual] |
virtual CoreExport void RemoveDuplicates | ( | ) | [virtual] |
int GetMaterialCount | ( | ) | const [protected] |
Returns the count of materials under this category.
MtlBase* GetMaterial | ( | int | i | ) | const [protected] |
Get a pointer to the material with the given index.
[in] | i | - The index of the material. |
MtlBase* FindMaterial | ( | const MCHAR * | name | ) | const [protected] |
Find the child material with the given name.
[in] | name | - The name of the child material to find. |
bool AddMaterial | ( | MtlBase * | pMaterial | ) | [protected] |
Add a material to the children list of this category.
[in] | pMaterial | - The material to add to this category. Can be NULL. |
void RemoveMaterial | ( | MtlBase * | pMaterial | ) | [protected] |
void SetMaterial | ( | int | i, |
MtlBase * | pMaterial | ||
) | [protected] |
void SetMaterialCount | ( | int | count | ) | [protected] |
void* mpReserved
[protected] |