#include <mxsPlugin.h>
Public Member Functions |
|
MSPluginSimpleObject () | |
MSPluginSimpleObject (MSPluginClass *pc, BOOL loading) | |
~MSPluginSimpleObject () | |
void | DeleteThis () |
HWND | AddRollupPage (HINSTANCE hInst, MCHAR *dlgTemplate, DLGPROC dlgProc, MCHAR *title, LPARAM param=0, DWORD flags=0, int category=ROLLUP_CAT_STANDARD) |
void | DeleteRollupPage (HWND hRollup) |
IRollupWindow * | GetRollupWindow () |
ReferenceTarget * | get_delegate () |
void | GetClassName (MSTR &s) |
Retrieves the name of the plugin class.
|
|
Class_ID | ClassID () |
Retrieves a constant that uniquely
identifies the plugin class. |
|
int | NumSubs () |
Animatable * | SubAnim (int i) |
MSTR | SubAnimName (int i) |
int | NumParamBlocks () |
IParamBlock2 * | GetParamBlock (int i) |
IParamBlock2 * | GetParamBlockByID (BlockID id) |
void * | GetInterface (ULONG id) |
Inherited from Animatable. |
|
RefResult | NotifyRefChanged (Interval changeInt, RefTargetHandle hTarget, PartID &partID, RefMessage message) |
Receives and responds to messages. |
|
int | NumRefs () |
Returns the total number of references this
ReferenceMaker can hold. |
|
RefTargetHandle | GetReference (int i) |
Returns the 'i-th' reference. |
|
void | RefDeleted () |
void | RefAdded (RefMakerHandle rm) |
RefTargetHandle | Clone (RemapDir &remap) |
This method is used by 3ds Max to clone an
object. |
|
IOResult | Save (ISave *isave) |
IOResult | Load (ILoad *iload) |
void | NotifyTarget (int msg, RefMakerHandle rm) |
MCHAR * | GetObjectName () |
void | BeginEditParams (IObjParam *ip, ULONG flags, Animatable *prev) |
void | EndEditParams (IObjParam *ip, ULONG flags, Animatable *next) |
void | BuildMesh (TimeValue t) |
BOOL | OKtoDisplay (TimeValue t) |
void | InvalidateUI () |
CreateMouseCallBack * | GetCreateMouseCallBack () |
This method allows the system to retrieve a
callback object used in creating an object in the 3D viewports.
|
|
BOOL | HasUVW () |
It is called to find out if the object is
has UVW coordinates. |
|
void | SetGenUVW (BOOL sw) |
This method is called to change the state of
its Generate UVW boolean. |
|
Static Public Member Functions |
|
static RefTargetHandle | create (MSPluginClass *pc, BOOL loading) |
Public Attributes |
|
IObjParam * | ip |
Protected Member Functions |
|
virtual void | SetReference (int i, RefTargetHandle rtarg) |
Stores a
ReferenceTarget as its 'i-th' reference`. |
MSPluginSimpleObject | ( | ) | [inline] |
{ }
MSPluginSimpleObject | ( | MSPluginClass * | pc, |
BOOL | loading | ||
) |
~MSPluginSimpleObject | ( | ) | [inline] |
{ DeleteAllRefsFromMe(); }
static RefTargetHandle create | ( | MSPluginClass * | pc, |
BOOL | loading | ||
) | [static] |
void DeleteThis | ( | ) |
HWND AddRollupPage | ( | HINSTANCE | hInst, |
MCHAR * | dlgTemplate, | ||
DLGPROC | dlgProc, | ||
MCHAR * | title, | ||
LPARAM | param = 0 , |
||
DWORD | flags = 0 , |
||
int | category =
ROLLUP_CAT_STANDARD |
||
) | [virtual] |
Implements MSPlugin.
void DeleteRollupPage | ( | HWND | hRollup | ) | [virtual] |
Implements MSPlugin.
IRollupWindow* GetRollupWindow | ( | ) | [virtual] |
Implements MSPlugin.
ReferenceTarget* get_delegate | ( | ) | [inline, virtual] |
void GetClassName | ( | MSTR & | s | ) | [inline, 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 SimpleObject.
Reimplemented in MSSimpleObjectXtnd.
Class_ID ClassID | ( | ) | [inline, 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.
Reimplemented in MSSimpleObjectXtnd.
{ return pc->class_id; }
int NumSubs | ( | ) | [inline, virtual] |
Reimplemented from SimpleObject.
Reimplemented in MSSimpleObjectXtnd.
Animatable* SubAnim | ( | int | i | ) | [inline, virtual] |
i | This is the index of the sub-anim to return. |
Reimplemented from SimpleObject.
Reimplemented in MSSimpleObjectXtnd.
{ return pblocks[i]; }
MSTR SubAnimName | ( | int | i | ) | [inline, virtual] |
i | The index of the parameter name to return |
Reimplemented from SimpleObject.
Reimplemented in MSSimpleObjectXtnd.
{ return pblocks[i]->GetLocalName(); }
int NumParamBlocks | ( | ) | [inline, virtual] |
Reimplemented from Animatable.
Reimplemented in MSSimpleObjectXtnd.
IParamBlock2* GetParamBlock | ( | int | i | ) | [inline, virtual] |
i | The zero based index of the ParamBlock2 to return. |
Reimplemented from Animatable.
Reimplemented in MSSimpleObjectXtnd.
{ return pblocks[i]; }
IParamBlock2* GetParamBlockByID | ( | BlockID | id | ) | [inline] |
Reimplemented from MSPlugin.
Reimplemented in MSSimpleObjectXtnd.
{ return MSPlugin::GetParamBlockByID(id); }
void* GetInterface | ( | ULONG | id | ) | [inline, virtual] |
Inherited from Animatable.
Returns a pointer to the interface.
id | - The id of the interface. |
Reimplemented from SimpleObject.
Reimplemented in MSSimpleObjectXtnd.
{ if (id == I_MAXSCRIPTPLUGIN) return (MSPlugin*)this; else return SimpleObject::GetInterface(id); }
RefResult NotifyRefChanged | ( | Interval | changeInt, |
RefTargetHandle | hTarget, | ||
PartID & | partID, | ||
RefMessage | message | ||
) | [inline, 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. |
Reimplemented from SimpleObject.
{ SimpleObject::NotifyRefChanged(changeInt, hTarget, partID, message); return ((MSPlugin*)this)->NotifyRefChanged(changeInt, hTarget, partID, message); }
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 SimpleObject.
Reimplemented in MSSimpleObjectXtnd.
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 SimpleObject.
Reimplemented in MSSimpleObjectXtnd.
virtual 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 SimpleObject.
Reimplemented in MSSimpleObjectXtnd.
void RefDeleted | ( | ) | [inline] |
void RefAdded | ( | RefMakerHandle | rm | ) | [inline] |
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.
Reimplemented in MSSimpleObjectXtnd.
void NotifyTarget | ( | int | msg, |
RefMakerHandle | rm | ||
) | [inline] |
MCHAR* GetObjectName | ( | ) | [inline, virtual] |
Reimplemented from BaseObject.
Reimplemented in MSSimpleObjectXtnd.
{ return pc->class_name->to_string(); }
void BeginEditParams | ( | IObjParam * | ip, |
ULONG | flags, | ||
Animatable * | prev | ||
) | [virtual] |
ip | Interface pointer. The developer can use it to call methods such as AddRollupPage(). Note that this pointer is only valid between BeginEditParams() and EndEditParams(). It should not be used outside this interval. |
flags | Describe which branch of the command panel or dialog the item
is being edited in. The following are possible values: BEGIN_EDIT_CREATE Indicates an item is being edited in the create branch. BEGIN_EDIT_MOTION Indicates a controller is being edited in the motion branch. BEGIN_EDIT_HIERARCHY Indicates a controller is being edited in the Pivot subtask of the hierarchy branch. BEGIN_EDIT_IK Indicates a controller is being edited in the IK subtask of the hierarchy branch. BEGIN_EDIT_LINKINFO Indicates a controller is being edited in the Link Info subtask of the hierarchy branch. |
prev | Pointer to an Animatable object. This parameter may be used in the motion and hierarchy branches of the command panel. This pointer allows a plug-in to look at the ClassID of the previous item that was being edited, and if it is the same as this item, to not replace the entire UI in the command panel, but simply update the values displayed in the UI fields. This prevents the UI from 'flickering' when the current item begins its edit. For example, if you are in the motion branch and are looking at an item's PRS controller values, and then select another item that is displayed with a PRS controller, the UI will not change - only the values displayed in the fields will change. If however you selected a target camera that has a lookat controller (not a PRS controller) the UI will change because a different set of parameters need to be displayed. Note that for items that are edited in the modifier branch this field can be ignored. |
Reimplemented from SimpleObject.
Reimplemented in MSSimpleObjectXtnd.
void EndEditParams | ( | IObjParam * | ip, |
ULONG | flags, | ||
Animatable * | next | ||
) | [virtual] |
ip | An interface pointer. The developer may use the interface
pointer to call methods such as
DeleteRollupPage(). |
flags | The following flag may be set: END_EDIT_REMOVEUI If TRUE, the item's user interface should be removed. |
next | Animatable pointer. Can be used in the motion and hierarchy branches of the command panel. It allows a plug-in to look at the ClassID of the next item that was being edited, and if it is the same as this item, to not replace the entire UI in the command panel. Note that for items that are edited in the modifier branch this field can be ignored. |
Reimplemented from SimpleObject.
Reimplemented in MSSimpleObjectXtnd.
void BuildMesh | ( | TimeValue | t | ) | [virtual] |
Implements SimpleObject.
Reimplemented in MSSimpleObjectXtnd.
BOOL OKtoDisplay | ( | TimeValue | t | ) | [virtual] |
Reimplemented from SimpleObject.
Reimplemented in MSSimpleObjectXtnd.
void InvalidateUI | ( | ) | [virtual] |
pmapParam->Invalidate();
void foo(IObjParam* ip, IParamBlock* pblock) { float newval; Interval valid = FOREVER; TimeValue t = ip->GetTime(); // Get the value from the parameter block at the current time. pblock->GetValue( PB_ANGLE, t, newval, valid ); // Set the value. Note that the notify argument is passed as FALSE. // This ensures no messages are sent when the value changes. angleSpin->SetValue( newval, FALSE ); }
Reimplemented from SimpleObject.
Reimplemented in MSSimpleObjectXtnd.
CreateMouseCallBack* GetCreateMouseCallBack | ( | ) | [virtual] |
This method allows the system to retrieve a callback object used in creating an object in the 3D viewports.
This method returns a pointer to an instance of a class derived from CreateMouseCallBack. This class has a method proc() which is where the programmer defines the user/mouse interaction during the object creation phase.
Implements BaseObject.
Reimplemented in MSSimpleObjectXtnd.
BOOL HasUVW | ( | ) | [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 Object.
Reimplemented in MSSimpleObjectXtnd.
void SetGenUVW | ( | BOOL | sw | ) | [virtual] |
This method is called to change the state of its Generate UVW boolean.
If the state changes, the object must send a REFMSG_CHANGE up the pipeline by calling NotifyDependents(). This applies to map channel 1.
sw | The new state for the generate UVW flag. |
Reimplemented from BaseObject.
Reimplemented in MSSimpleObjectXtnd.