Public Member Functions | Public Attributes

DefNoteTrack Class Reference

Search for all occurrences

Detailed Description

See also:
Class NoteKeyTab, Class Animatable.

Description:
This class is available in release 3.0 and later only.

This class is 3ds Max's implementation of Note Tracks. It provides implementation for the Animatable methods that let the keys work in Track View. Developers use this class to access the table of keys associated with a track. Methods of class Animatable are available to get access to this class.

#include <notetrck.h>

Inheritance diagram for DefNoteTrack:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  DefNoteTrack ()
  DefNoteTrack (DefNoteTrack &n)
DefNoteTrack operator= (DefNoteTrack &track)
CoreExport void  HoldTrack ()
Class_ID  ClassID ()
  Retrieves a constant that uniquely identifies the plugin class.
int  NumKeys ()
TimeValue  GetKeyTime (int index)
CoreExport void  MapKeys (TimeMap *map, DWORD flags)
CoreExport void  DeleteKeys (DWORD flags)
CoreExport void  CloneSelectedKeys (BOOL offset)
CoreExport void  DeleteTime (Interval iv, DWORD flags)
CoreExport void  ReverseTime (Interval iv, DWORD flags)
CoreExport void  ScaleTime (Interval iv, float s)
CoreExport void  InsertTime (TimeValue ins, TimeValue amount)
CoreExport void  AddNewKey (TimeValue t, DWORD flags)
CoreExport int  GetSelKeyCoords (TimeValue &t, float &val, DWORD flags)
CoreExport void  SetSelKeyCoords (TimeValue t, float val, DWORD flags)
CoreExport int  GetTrackVSpace (int lineHeight)
CoreExport BOOL  CanCopyTrack (Interval iv, DWORD flags)
CoreExport BOOL  CanPasteTrack (TrackClipObject *cobj, Interval iv, DWORD flags)
CoreExport TrackClipObject CopyTrack (Interval iv, DWORD flags)
CoreExport void  PasteTrack (TrackClipObject *cobj, Interval iv, DWORD flags)
CoreExport Interval  GetTimeRange (DWORD flags)
CoreExport int  HitTestTrack (TrackHitTab &hits, Rect &rcHit, Rect &rcTrack, float zoom, int scroll, DWORD flags)
CoreExport int  PaintTrack (ParamDimensionBase *dim, HDC hdc, Rect &rcTrack, Rect &rcPaint, float zoom, int scroll, DWORD flags)
CoreExport void  SelectKeys (TrackHitTab &sel, DWORD flags)
CoreExport void  SelectKeyByIndex (int i, BOOL sel)
CoreExport int  NumSelKeys ()
CoreExport void  FlagKey (TrackHitRecord hit)
CoreExport int  GetFlagKeyIndex ()
CoreExport BOOL  IsAnimated ()
CoreExport void  EditTrackParams (TimeValue t, ParamDimensionBase *dim, MCHAR *pname, HWND hParent, IObjParam *ip, DWORD flags)
CoreExport int  TrackParamsType ()
CoreExport BOOL  SupportTimeOperations ()
CoreExport IOResult  Save (ISave *isave)
  Called for saving data.
CoreExport IOResult  Load (ILoad *iload)
  Called for loading data.
CoreExport void  DeleteThis ()
  Deletes an instance of this class.
RefResult  NotifyRefChanged (Interval changeInt, RefTargetHandle hTarget, PartID &partID, RefMessage message)
  Receives and responds to messages.
CoreExport RefTargetHandle  Clone (RemapDir &remap)
  This method is used by 3ds Max to clone an object.

Public Attributes

NoteKeyTab  keys

Constructor & Destructor Documentation

DefNoteTrack ( ) [inline]
{}
DefNoteTrack ( DefNoteTrack n ) [inline]
{keys=n.keys;}

Member Function Documentation

DefNoteTrack& operator= ( DefNoteTrack track ) [inline]
{keys=track.keys;return *this;}
CoreExport void HoldTrack ( )
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.

Returns:
A class id that uniquely identifies a plugin class
See also:
Class ClassID, List of Class IDs.

Reimplemented from Animatable.

int NumKeys ( ) [inline, virtual]
Remarks:
This method returns the number of keys managed by the plug-in, or NOT_KEYFRAMEABLE if it does not work with keys.
Default Implementation:
{return NOT_KEYFRAMEABLE;}

Reimplemented from Animatable.

{return keys.Count();}
TimeValue GetKeyTime ( int  index ) [inline, virtual]
Remarks:
This method returns the time of the key specified by index.
Parameters:
index Specifies the key whose time should be returned.
Default Implementation:
{return 0;}

Reimplemented from Animatable.

{return keys[index]->time;}
CoreExport void MapKeys ( TimeMap map,
DWORD  flags 
) [virtual]
Remarks:
The method is called to update the keys specified by the flags, using the TimeMap passed. The plug-in should go through the specified keys and change their time to TimeMap::map(time). See the sample code below for how this is done.
Parameters:
map Point to instance of Class TimeMap.

flags The flags indicate the keys to operate on. One or more of the following values:

TRACK_DOSEL
Selected keys only.

TRACK_DOALL
All the keys, ignore their selection state.

TRACK_SLIDEUNSEL
Slide unselected keys to the right. Keys are slid by the amount the last key was transformed.

TRACK_RIGHTTOLEFT
Enumerate right to left. If TRACK_SLIDEUNSEL is set, keys will slide to the left.

TRACK_DOSUBANIMS
Sub-Animatables keys as well.

TRACK_DOCHILDNODES
Child Nodes keys as well

TRACK_MAPRANGE
The range, if not locked to first and last key, should be mapped as well.
Sample Code:
        INTERP_CONT_TEMPLATE
        void InterpControl<INTERP_CONT_PARAMS>::MapKeys(TimeMap *map,DWORD flags )
        {
            int n = keys.Count();
            BOOL changed = FALSE;
            if (!n) goto doneMapKeys;
            HoldTrack();
            if (flags&TRACK_DOALL) {
                for (int i = 0; i < n; i++) {
                    if (keys[i].TimeLocked()) continue;
                    keys[i].time = map->map(keys[i].time);
                    changed = TRUE;
                }
            } else if (flags&TRACK_DOSEL) {
                BOOL slide = flags&TRACK_SLIDEUNSEL;
                TimeValue delta = 0, prev;
                int start, end, inc;
                if (flags&TRACK_RIGHTTOLEFT) {
                    start = n-1;
                    end = -1;
                    inc = -1;
                }
                else {
                    start = 0;
                    end = n;
                    inc = 1;
                }
                for (int i = start; i != end; i += inc) {
                    if (keys[i].TimeLocked()) continue;
                    if (keys[i].TestKFlag(KEY_SELECTED)) {
                        prev = keys[i].time;
                        keys[i].time =
                            map->map(keys[i].time);
                        delta = keys[i].time - prev;
                        changed = TRUE;
                    }
                    else if (slide) {
                        keys[i].time += delta;
                    }
                }
            }
            if (flags&TRACK_MAPRANGE && keys.TestTFlag(RANGE_UNLOCKED)) {
                TimeValue t0 = map->map(keys.range.Start());
                TimeValue t1 = map->map(keys.range.End());
                keys.range.Set(t0,t1);
            }
            if (changed) {
                keys.KeysChanged();
                ivalid.SetEmpty();
                NotifyDependents(FOREVER, PART_ALL,
                    REFMSG_CHANGE);
            }
            doneMapKeys:
            Animatable::MapKeys(map,flags);
        }

Reimplemented from Animatable.

CoreExport void DeleteKeys ( DWORD  flags ) [virtual]
Remarks:
This method is called to delete keys, as specified by the flags passed.
Parameters:
flags One or more of the following values:

TRACK_DOSEL
Delete selected keys only.

TRACK_DOALL
Delete all keys (ignore selection state).

TRACK_SLIDEUNSEL
Slide unselected keys to the right.

TRACK_RIGHTTOLEFT
Enumerate right to left. If TRACK_SLIDEUNSEL is set, keys will slide to the left.
Default Implementation:
{}

Reimplemented from Animatable.

CoreExport void CloneSelectedKeys ( BOOL  offset ) [virtual]
Remarks:
This method is called to make a copy of the selected keys.
Parameters:
offset If TRUE, set the new key time to be centered between the original key and the next key.

Reimplemented from Animatable.

CoreExport void DeleteTime ( Interval  iv,
DWORD  flags 
) [virtual]
Remarks:
This method is called to delete the specified interval of time (or the keys within the interval).
Parameters:
iv The interval of time to delete.
flags One or more of the following values:

TIME_INCLEFT
Include the left endpoint.

TIME_INCRIGHT
Include the right endpoint.

TIME_NOSLIDE
Delete any keys in the interval but don't actually remove the block of time.
Default Implementation:
{}

Reimplemented from Animatable.

CoreExport void ReverseTime ( Interval  iv,
DWORD  flags 
) [virtual]
Remarks:
This method is called to reverse the data within the specified interval. For example, if the interval passed is from frame 10 to 20, and there is a key at frame 12, the key should be moved to frame 18. Considered another way, if all the times were normalized, and there was a value n between 0 and 1, n should be changed to 1-n.
Parameters:
iv The interval of time over which to reverse the data.
flags One or more of the following values:

TIME_INCLEFT
Include the left endpoint.

TIME_INCRIGHT
Include the right endpoint.
Default Implementation:
{}
Sample Code:
        INTERP_CONT_TEMPLATE
        void InterpControl<INTERP_CONT_PARAMS>::ReverseTime( Interval iv, DWORD flags )
        {
            Interval test = TestInterval(iv,flags);
            int n = keys.Count();
            HoldTrack();
            for ( int i = 0; i < n; i++ ) {
                if (keys[i].TimeLocked()) continue;
                if ( test.InInterval(keys[i].time) ) {
                    TimeValue delta = keys[i].time - iv.Start();
                    keys[i].time = iv.End()-delta;
                }
            }
            keys.KeysChanged();
            keys.CheckForDups();
            ivalid.SetEmpty();
            NotifyDependents(FOREVER, PART_ALL, REFMSG_CHANGE);
        }

Reimplemented from Animatable.

CoreExport void ScaleTime ( Interval  iv,
float  s 
) [virtual]
Remarks:
This method is called to scale an interval of time by the specified scale factor.
Parameters:
iv The interval of time to scale. The origin of the scale is at iv.Start().
s The scale factor for the time.
Default Implementation:
{}
Sample Code:
        INTERP_CONT_TEMPLATE
        void InterpControl<INTERP_CONT_PARAMS>::ScaleTime( Interval iv, float s)
        {
            int n = keys.Count();
            TimeValue delta = int(s*float(iv.End()-iv.Start())) + iv.Start() - iv.End();
            HoldTrack();
            for ( int i = 0; i < n; i++ ) {
                if (keys[i].TimeLocked()) continue;
                if ( iv.InInterval(keys[i].time) ) {
                    keys[i].time =
                        int(s*float(keys[i].time - iv.Start())) + iv.Start();
                } else
                if (keys[i].time > iv.End()) {
                    keys[i].time += delta;
                }
            }
            keys.KeysChanged();
            ivalid.SetEmpty();
            NotifyDependents(FOREVER, PART_ALL, REFMSG_CHANGE);
        }

Reimplemented from Animatable.

CoreExport void InsertTime ( TimeValue  ins,
TimeValue  amount 
) [virtual]
Remarks:
This method is called to insert the specified amount of time at the specified insertion point.
Parameters:
ins The time to begin the insertion.
amount The amount of time to insert.
Default Implementation:
{}

Reimplemented from Animatable.

CoreExport void AddNewKey ( TimeValue  t,
DWORD  flags 
) [virtual]
Remarks:
This method is called to add a new key at the specified time. The value of the key is set to the value of the previous key, or interpolated between keys, based on the flags passed.
Parameters:
t The time to add the key.
flags One or more of the following values:

ADDKEY_SELECT
Select the new key and deselect any other selected keys.

ADDKEY_INTERP
If TRUE then initialize the new key to the interpolated value at that time. If FALSE, initialize the key to the value of the previous key.
Default Implementation:
{}

Reimplemented from Animatable.

CoreExport int GetSelKeyCoords ( TimeValue &  t,
float &  val,
DWORD  flags 
) [virtual]
Remarks:
This method is used to determine the commonality of the selected keys for display in the time/value type in fields of Track View. It is also used to retrieve the value and/or time of the selected keys (if there is only one selected, or they are common to the selected keys). The flags parameter specified which values to retrieve. The return value indicates if nothing, or several keys were selected. It also indicates if the selected keys shared a common time and/or common value.
Parameters:
t The time of the selected keys is returned here (if appropriate).
val The value of the selected keys is returned here (if appropriate).
flags One of the following values:

KEYCOORDS_TIMEONLY
Only the time t needs to be updated.

KEYCOORDS_VALUEONLY
Only the value val needs to be updated.
Returns:
This indicates what was selected, and what these keys had in common. One or more of the following values should be set:

KEYS_NONESELECTED
This indicates that no keys are selected.

KEYS_MULTISELECTED
This indicates that multiple keys are selected. Both of these last two bits could be set.

KEYS_COMMONTIME
If the selected keys share the same time then this flag should be set. In this case it is appropriate to update t if required.

KEYS_COMMONVALUE
If the selected keys share the same value then this flag should be set. In this case it is appropriate to update val if required.
Default Implementation:
{return KEYS_NONESELECTED;}

Reimplemented from Animatable.

CoreExport void SetSelKeyCoords ( TimeValue  t,
float  val,
DWORD  flags 
) [virtual]
Remarks:
This method is called to update the time and/or value of the selected keys as specified by the flags. This is called if the user uses the time/value type in fields of Track View.
Parameters:
t The time to set for the selected keys (if the flags indicate this is needed).
val The value to set for the selected keys (if the flags indicate this is needed).
flags One of the following values:

KEYCOORDS_TIMEONLY
Only the time needs to be updated.

KEYCOORDS_VALUEONLY
Only the value needs to be updated.
Default Implementation:
{}

Reimplemented from Animatable.

CoreExport int GetTrackVSpace ( int  lineHeight ) [inline, virtual]
Remarks:
Returns the vertical space occupied by the track in units of one line.
Parameters:
lineHeight The height of a single line in pixels.
Default Implementation:
{ return 1; }

Reimplemented from Animatable.

{return 1;}
CoreExport BOOL CanCopyTrack ( Interval  iv,
DWORD  flags 
) [inline, virtual]
Remarks:
Returns TRUE if this item can copy its data over the specified range; otherwise returns FALSE.
Parameters:
iv The interval of time that would be copied.
flags One or more of the following values:

TIME_INCLEFT
Include the left endpoint.

TIME_INCRIGHT
Include the right endpoint.
Default Implementation:
{return FALSE;}

Reimplemented from Animatable.

{return 1;}
CoreExport BOOL CanPasteTrack ( TrackClipObject cobj,
Interval  iv,
DWORD  flags 
) [inline, virtual]
Remarks:
Returns TRUE if this item can paste its data over the specified range; otherwise returns FALSE.
Parameters:
cobj The clipboard object that would be pasted. The item should look at the SuperClassID and Class_ID of the creator of the clip object to determine if it is a suitable object to paste. See Class TrackClipObject.
iv The interval of time that would be pasted.
flags One or more of the following values:

TIME_INCLEFT
Include the left endpoint.

TIME_INCRIGHT
Include the right endpoint.
Default Implementation:
{return FALSE;}

Reimplemented from Animatable.

{return cobj->ClassID()==ClassID();}
CoreExport TrackClipObject* CopyTrack ( Interval  iv,
DWORD  flags 
) [virtual]
Remarks:
This method is called to copy the item's track data over the specified interval.
Parameters:
iv The interval of time over which to copy the track data.
flags One or more of the following values:

TIME_INCLEFT
Include the left endpoint.

TIME_INCRIGHT
Include the right endpoint.
Returns:
The item should return an instance of a class derived from TrackClipObject that contains the data for the item. See Class TrackClipObject.
Default Implementation:
{return NULL;}

Reimplemented from Animatable.

CoreExport void PasteTrack ( TrackClipObject cobj,
Interval  iv,
DWORD  flags 
) [virtual]
Remarks:
This method is called to paste the specified clip object to this track. This method will not be called unless CanPasteTrack() returned TRUE.
Parameters:
cobj The data to paste.
iv The interval of time to paste.
flags One or more of the following values:

TIME_INCLEFT
Include the left endpoint.

TIME_INCRIGHT
Include the right endpoint.

Reimplemented from Animatable.

CoreExport Interval GetTimeRange ( DWORD  flags ) [virtual]
Remarks:
Implemented by the System.

Returns an interval representing the tracks time range, based on the flags passed.
Parameters:
flags One or more of the following values:

TIMERANGE_SELONLY
The bounding interval of selected keys only.

TIMERANGE_ALL
Whatever the channel's time range is - usually the bounding interval of all keys.

TIMERANGE_CHILDNODES
The node's time range should include its child nodes.

TIMERANGE_CHILDANIMS
A animatable's child anim ranges should be included.
Returns:
An interval representing the tracks time range.

Reimplemented from Animatable.

CoreExport int HitTestTrack ( TrackHitTab hits,
Rect rcHit,
Rect rcTrack,
float  zoom,
int  scroll,
DWORD  flags 
) [virtual]
Remarks:
This method is called to determine which keys lie within the rcHit rectangle. Keys that are hit are added to the hits table.
Parameters:
hits The table of TrackHitRecords to update. Each key that lies within the hit rectangle (is hit) should be added to this table. It is up to the plug-in to define a scheme that allows it to identify its hits using the data members of Class TrackHitRecord. Also see Class Tab for methods to add to the table.
rcHit This is the region that was selected for hit testing. This may be a small rectangle about the mouse pick point, or a larger rectangle if the user selected by window.
rcTrack This is the entire rectangular region of the track.
zoom The is the time zoom factor.
scroll This is the time scroll factor.
flags One or more of the following value:

HITTRACK_SELONLY
Selected only.

HITTRACK_UNSELONLY
Unselected only.

HITTRACK_ABORTONHIT
Abort hit testing on first hit.

HITCURVE_TESTTANGENTS
Hit test curve tangents.
Returns:
One of the following values:

TRACK_DONE
This indicates the track was hit tested.

TRACK_DORANGE
This indicates that the system will handle hit testing to the range bar for the item. For example a node returns this value because it does not have any keys. Therefore it just lets the user hit test the range bar. In general, anything that is not a leaf controller will not implement this method and return the default. The system will then simply hit test the range bar.

TRACK_ASKCLIENT
If a plug-in returns this value then the anim's client will be given a chance to paint the track in Track View. If a client returns this value then the method PaintSubTrack() will be called.
Default Implementation:
{ return TRACK_DORANGE; }

Reimplemented from Animatable.

CoreExport int PaintTrack ( ParamDimensionBase dim,
HDC  hdc,
Rect rcTrack,
Rect rcPaint,
float  zoom,
int  scroll,
DWORD  flags 
) [virtual]
Remarks:
This method is called to display the item in the track view. If an item needs to draw itself in a special fashion, it implements this method to do so. For example, a sound plug-in may draw its waveform using this method. If an item does not need to draw itself, the default implementation may be used. This draws the range bar for the item.

Note: When drawing something to appear in Track View, a developer should not do any clipping of their own. 3ds Max will take care of all clipping itself.
Parameters:
dim The dimension for the parameter of this track.
hdc The handle of the device context.
rcTrack The entire rectangle of the inside of the track.
rcPaint This is the rectangular region that needs to be repainted - the invalid region.
zoom The time zoom factor.
scroll The time scroll factor.
flags One or more of the following values which are filters for controllers with more than one curve:

DISPLAY_XCURVE
DISPLAY_YCURVE

Note:
RGB controllers interpret X as red, Y as green, and Z as blue. DISPLAY_ZCURVE
Returns:
One of the following values:

TRACK_DONE
Indicates the track was painted.

TRACK_DORANGE
Indicates the system should draw the range bars for the item.

TRACK_ASKCLIENT
Indicates the anim's client will be given a chance to paint the track in Track View. See Animatable::PaintSubTrack() which will be called to do this.
Default Implementation:
{ return TRACK_DORANGE; }

Reimplemented from Animatable.

CoreExport void SelectKeys ( TrackHitTab sel,
DWORD  flags 
) [virtual]
Remarks:
This method is called to select or deselect a set of keys identified by the TrackHitTab and the specified flags.
Parameters:
sel The table of track hit records. See Class TrackHitRecord and Class Tab. Note the following: typedef Tab<TrackHitRecord> TrackHitTab;

flags Either SELKEYS_SELECT, SELKEYS_DESELECT, or a combination of SELKEYS_CLEARKEYS and SELKEYS_CLEARCURVE will be specified.

One or more of the following values:

SELKEYS_SELECT
The keys should be selected.

SELKEYS_DESELECT
The keys should be deselected.

SELKEYS_CLEARKEYS
All keys should be deselected.

SELKEYS_CLEARCURVE
All keys on the function curve should be deselected.

SELKEYS_FCURVE
Indicates that we are operating on the keys of a function curve, and not of a track.
Default Implementation:
{}

Reimplemented from Animatable.

CoreExport void SelectKeyByIndex ( int  i,
BOOL  sel 
) [virtual]
Remarks:
This method is available in release 2.0 and later only.

This method is called to set the selected state of the key whose index is passed.
Parameters:
i The key to select or deselect.
sel TRUE to select the key; FALSE to deselect it.
Default Implementation:
{}

Reimplemented from Animatable.

CoreExport int NumSelKeys ( ) [virtual]
Remarks:
Returns the number of selected keys.
Default Implementation:
{return 0;}

Reimplemented from Animatable.

CoreExport void FlagKey ( TrackHitRecord  hit ) [virtual]
Remarks:
This method is called to have the plug-in flag or mark a specific key identified by the TrackHitRecord.

As an example, when the user goes to move a selection set of keys in the Track View, a yellow marker is drawn. To move the group of keys, the user clicks on a single one. The system needs to track this one key as it is moved, and needs a way to identify it. This method is called so the developer can flag this key as the one that was selected. This is needed because the Track View doesn't know anything about a specific controllers ordering of keys and thus cannot refer to it by index.

The system will call GetFlagKeyIndex() (described below) to retrieve the index of the key that was flagged.
Parameters:
hit The hit record that the controller gave the Track View in the first place to identify the hit. Thus this is enough information to identify the key. See Class TrackHitRecord.
Default Implementation:
{}
Sample Code:
        INTERP_CONT_TEMPLATE
        void InterpControl<INTERP_CONT_PARAMS>::FlagKey(TrackHitRecord hit)
        {
            int n = keys.Count();
            for ( int i = 0; i < n; i++ ) {
                keys[i].ClearKFlag(KEY_FLAGGED);
            }
            assert(hit.hit>=0&&hit.hit<(DWORD)n);
            keys[hit.hit].SetKFlag(KEY_FLAGGED);
        }

Reimplemented from Animatable.

CoreExport int GetFlagKeyIndex ( ) [virtual]
Remarks:
Returns the index of the key that is flagged, or -1 if no keys are flagged. See the method above.
Default Implementation:
{return -1;}
Sample Code:
        INTERP_CONT_TEMPLATE
        int InterpControl<INTERP_CONT_PARAMS>::GetFlagKeyIndex()
        {
            int n = keys.Count();
            for ( int i = 0; i < n; i++ ) {
                if (keys[i].TestKFlag(KEY_FLAGGED)) {
                    return i;
                }
            }
            return -1;
        }

Reimplemented from Animatable.

CoreExport BOOL IsAnimated ( ) [inline, virtual]
Remarks:
Returns TRUE if this animatable actually has animation; otherwise FALSE. This method is recursive, so for example, if you call node->IsAnimated() it will return TRUE if any aspect of the node is animated; otherwise it will return FALSE.
Default Implementation:
The default implementation returns TRUE if a child anim has animation.

Reimplemented from Animatable.

{return TRUE;}
CoreExport void EditTrackParams ( TimeValue  t,
ParamDimensionBase dim,
MCHAR *  pname,
HWND  hParent,
IObjParam ip,
DWORD  flags 
) [virtual]
Remarks:
This method is called for the plug-in to put up a modal dialog and let the user edit the tracks parameters for the selected keys. This function should not return until the user has completed editing at which time any windows that were created should be destroyed. Unlike BeginEditParams() and EndEditParams() this interface is modal.
Parameters:
t This time represents the horizontal position of where the user right clicked to bring up the modal edit track parameters dialog. See the flags below for when this parameter is valid.
dim The parameter dimension. See Class ParamDimensionBase.
pname The name of the parameter as given by the client.
hParent This is the parent window that should be used to create any dialogs.
ip An interface pointer available for calling functions in 3ds Max.
flags One or more of the following values:

EDITTRACK_FCURVE
The user is in the function curve editor.

EDITTRACK_TRACK
The user is in one of the track views.

EDITTRACK_SCENE
The user is editing a path in the scene.

EDITTRACK_BUTTON
The user invoked by choosing the properties button. In this case the time parameter is NOT valid.

EDITTRACK_MOUSE
The user invoked by right clicking with the mouse. In this case the time parameter is valid.
Default Implementation:
{}

Reimplemented from Animatable.

CoreExport int TrackParamsType ( ) [inline, virtual]
Remarks:
This method returns a value that indicates how the track parameter editing is invoked.
Returns:
One of the following values:

TRACKPARAMS_NONE

Has no track parameters. If this is returned then EditTrackParams() will not be called.

TRACKPARAMS_KEY

Entered by right clicking on a selected key. This should be used if the dialog provides parameters for the entire controller (for example as the Noise controller's dialog does).

TRACKPARAMS_WHOLE

Entered by right clicking anywhere in the track. This should be used if the dialog will represent the selection of keys (as a key info type dialog does).
Default Implementation:
{return TRACKPARAMS_NONE;}

Reimplemented from Animatable.

{return TRACKPARAMS_KEY;}
CoreExport BOOL SupportTimeOperations ( ) [inline, virtual]
Remarks:
If an anim supports time operations in the track view (cut, copy, paste, etc.), it should implement this method to return TRUE. When it is FALSE the user cannot select blocks of time in the anim's track.
Default Implementation:
{return FALSE;}

Reimplemented from Animatable.

{return TRUE;}
CoreExport IOResult Save ( ISave isave ) [virtual]

Called for saving data.

Called by the system to allow the plugin to save its data.

Parameters:
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.
Returns:
The default implementation is return IO_OK.
  • IO_OK means the result was acceptable, with no errors.
  • IO_ERROR This should be returned if an error occurred.

Reimplemented from ReferenceMaker.

CoreExport IOResult Load ( ILoad iload ) [virtual]

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.

Parameters:
iload - This interface pointer may be used to call methods to read data from disk.
Returns:
The default implementation is return IO_OK.
  • IO_OK means the result was acceptable, with no errors.
  • IO_ERROR This should be returned if an error occurred.

Reimplemented from ReferenceMaker.

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.

Note:
See the method ClassDesc::Create() for details on how Max allocates plugin objects.
See ReferenceMaker::DeleteMe() and ReferenceTarget::MaybeAutoDelete() for information on how plugin instances are deleted by the system.
Remarks:
See Memory Allocation.

See also:
Plugin DLL Functions, Class ClassDesc.

Reimplemented from Animatable.

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.

  • For developer that need to update a dialog box with data about an object you reference note the following related to this method: This method may be called many times. For instance, say you have a dialog box that displays data about an object you reference. This method will get called many time during the drag operations on that object. If you updated the display every time you'd wind up with a lot of 'flicker' in the dialog box. Rather than updating the dialog box each time, you should just invalidate the window in response to the NotifyRefChanged() call. Then, as the user drags the mouse your window will still receive paint messages. If the scene is complex the user may have to pause (but not let up on the mouse) to allow the paint message to go through since they have a low priority. This is the way many windows in 3ds Max work.
Parameters:
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.
Returns:
The return value from this method is of type RefResult. This is usually REF_SUCCEED indicating the message was processed. Sometimes, the return value may be REF_STOP. This return value is used to stop the message from being propagated to the dependents of the item.

Implements ReferenceMaker.

                                                 {return REF_SUCCEED;}
CoreExport RefTargetHandle Clone ( RemapDir remap ) [virtual]

This method is used by 3ds Max to clone an object.

See also:
CloneRefHierarchy(), class RemapDir This method is called by 3ds Max to have the plugin clone itself. The plug-in's implementation of this method should copy both the data structure and all the data residing in the data structure of this reference target. The plugin should clone all its references as well. Also, the plug-in's implementation of this method must call BaseClone(). In order for classes derived from this class to clone cleanly, the Clone method should just create the new instance, and then call an implementation of BaseClone that clones the references and copies any other necessary data. For example:
            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

Note:
See the remarks in method BaseClone() below.
Parameters:
remap - A RemapDir instance used for remapping references during a Clone.
Returns:
A pointer to the cloned item.

Reimplemented from ReferenceTarget.


Member Data Documentation


DefNoteTrack DefNoteTrack DefNoteTrack DefNoteTrack DefNoteTrack DefNoteTrack DefNoteTrack DefNoteTrack DefNoteTrack DefNoteTrack
DefNoteTrack DefNoteTrack DefNoteTrack DefNoteTrack DefNoteTrack DefNoteTrack DefNoteTrack DefNoteTrack DefNoteTrack DefNoteTrack