3ds Max C++ API Reference
Control Class Referenceabstract

#include <control.h>

+ Inheritance diagram for Control:

Public Member Functions

CoreExport Control ()
 
virtual ~Control ()
 
virtual BOOL InheritsParentTransform ()
 
CoreExport int NumRefs ()
 Returns the total number of references this ReferenceMaker can hold. More...
 
CoreExport RefTargetHandle GetReference (int i)
 Returns the 'i-th' reference. More...
 
CoreExport int NumSubs ()
 
CoreExport AnimatableSubAnim (int i)
 
CoreExport MSTR SubAnimName (int i, bool localized=true) override
 
CoreExport voidGetInterface (ULONG id)
 Inherited from Animatable. More...
 
CoreExport int PaintFCurves (ParamDimensionBase *dim, HDC hdc, Rect &rcGraph, Rect &rcPaint, float tzoom, int tscroll, float vzoom, int vscroll, DWORD flags)
 
CoreExport int GetFCurveExtents (ParamDimensionBase *dim, float &min, float &max, DWORD flags)
 This method is called to calculate the largest and smallest values of the anim. More...
 
virtual CoreExport void BaseClone (ReferenceTarget *from, ReferenceTarget *to, RemapDir &remap)
 
virtual BOOL PreventNodeDeletion ()
 
virtual CoreExport float EvalVisibility (TimeValue t, View &view, Box3 pbox, Interval &valid)
 
virtual BOOL VisibleInViewports ()
 
virtual BOOL CanInstanceController ()
 
CoreExport void CloneControl (Control *ctrl, RemapDir &remap)
 
virtual CoreExport SvGraphNodeReference SvTraverseAnimGraph (IGraphObjectManager *gom, Animatable *object, int id, DWORD flags)
 
virtual CoreExport MSTR SvGetName (IGraphObjectManager *gom, IGraphNode *gNode, bool isBeingEdited)
 
virtual CoreExport bool SvHandleDoubleClick (IGraphObjectManager *gom, IGraphNode *gNode)
 
virtual CoreExport bool SvCanInitiateLink (IGraphObjectManager *gom, IGraphNode *gNode)
 
virtual CoreExport bool SvCanConcludeLink (IGraphObjectManager *gom, IGraphNode *gNode, IGraphNode *gNodeChild)
 
virtual CoreExport bool SvLinkChild (IGraphObjectManager *gom, IGraphNode *gNodeThis, IGraphNode *gNodeChild)
 
virtual CoreExport bool SvEditProperties (IGraphObjectManager *gom, IGraphNode *gNode)
 
virtual CoreExport voidGetInterface (ULONG id)
 Inherited from Animatable. More...
 
virtual CoreExport BaseInterfaceGetInterface (Interface_ID id)
 Inherited from Animatable. More...
 
New Controller Assignment


virtual void Copy (Control *from)=0
 
virtual BOOL IsReplaceable ()
 
Undo/Redo Methods

Controllers, like objects and modifiers, need to be able to undo and redo themselves.

Whenever a controller is about to modify its data, it checks the state of the global Hold object to see if it is holding. If so it must register a RestoreObject with the hold (see the Advanced Topics section eUndo/Redo). Controllers also support another type of undo and redo through two methods: CommitValue() and RestoreValue().
The purpose of this 'inner' hold and restore buffer is not to hold and restore the entire state of the controller, but to hold and restore the value of the controller at a single instant in time. When SetValue() is called on a controller with the commit parameter equal to zero, the controller records the new value, but does not necessarily modify any data. For example, a keyframe controller doesn't actually generate a new key ?it just updates a cache it maintains. Then, if the controller is asked to evaluate itself at the exact same TimeValue for which the controller was just set, it can just return the cached value.
The RestoreValue() method will simply throw out the temporary value whereas the CommitValue() method will cause the value to be actually committed (a key generated in the case of a keyframe controller).
The purpose of this inner hold and restore is for iterative procedures that need to set values many times at a single TimeValue and don't want to incur the overhead of things like recalculating the tangents at adjacent keys. Some examples of these types of procedures are inverse kinematics and collision detection.

virtual void CommitValue (TimeValue t)
 
virtual void RestoreValue (TimeValue t)
 
Lookat Controller Methods
virtual INodeGetTarget ()
 
virtual RefResult SetTarget (INode *targ)
 
Sub-Controllers
virtual ControlGetPositionController ()
 
virtual ControlGetRotationController ()
 
virtual ControlGetScaleController ()
 
virtual BOOL SetPositionController (Control *c)
 
virtual BOOL SetRotationController (Control *c)
 
virtual BOOL SetScaleController (Control *c)
 
virtual ControlGetXController ()
 
virtual ControlGetYController ()
 
virtual ControlGetZController ()
 
virtual ControlGetWController ()
 
virtual ControlGetRollController ()
 
virtual BOOL SetRollController (Control *c)
 
Transform Controller Methods


virtual DWORD GetInheritanceFlags ()
 
virtual BOOL SetInheritanceFlags (DWORD f, BOOL keepPos)
 
virtual BOOL ChangeParents (TimeValue t, const Matrix3 &oldP, const Matrix3 &newP, const Matrix3 &tm)
 
virtual RefResult PinNodeChanged (RefMessage message, const Interval &changeInt, PartID &partID)
 
IsLeaf/IsKeyable/IsColor
virtual BOOL IsColorController ()
 
virtual BOOL IsLeaf ()
 
virtual int IsKeyable ()
 
Get/Set Value Methods
virtual void GetValue (TimeValue t, void *val, Interval &valid, GetSetMethod method=CTRL_ABSOLUTE)=0
 
void GetValue (TimeValue t1, void *val1, GetSetMethod method1=CTRL_ABSOLUTE)
 
virtual void SetValue (TimeValue t, void *val, int commit=1, GetSetMethod method=CTRL_ABSOLUTE)=0
 
virtual CoreExport bool GetLocalTMComponents (TimeValue t, TMComponentsArg &cmpts, Matrix3Indirect &parentMatrix)
 
Range Type for Controller
virtual int GetORT (int type)
 
virtual CoreExport void SetORT (int ort, int type)
 
virtual CoreExport void EnableORTs (BOOL enable)
 
Load/Save
CoreExport IOResult Save (ISave *isave)
 
CoreExport IOResult Load (ILoad *iload)
 
Inverse Kinematics

The following is an overview of the control flow of the system calling these IK methods on the controller during IK calculations: First the system calls EnumIKParams() once to get the number of IK parameters (degrees of freedom) from the plug-in.

This lets the system know how many parameters the controller has. This happens only once when the entire chain is set up. For example, during interactive IK, when the user presses the mouse button down, the chain is set up. In applied IK, when the user presses the Apply IK button, the chain is set up.
Next, the IK task is defined. For example, if the user is doing interactive IK, they press the mouse button down and the IK chain is set up. Next, they move the mouse a few pixels. This results in a delta for the end effector. This defines the task for the end effector. The end effector wants to move some delta or rotate some amount. This has defined a task to be solved.
In order to solve the task the system must iterate towards a solution. To do this it first needs to compute the derivatives of all the parameters. The system calls CompDerivs() on the controller. The controller computes the derivative and tells the system by calling methods on the IKDeriv argument passed to the method. It provides its derivative for each of the parameters.
Next, the system uses this derivative information to formulate a change in the parameter that will get closer to the solution. The system then computes an amount to change the parameter and then calls IncIKParams(). The delta passed to this method is the amount of change it wants in the parameter. The controller then applies this change (perhaps not all of it due to constraints it might have) and returns the amount that was applied.
This completes a single iteration. All the parameters have been adjusted a bit and hopefully we have moved closer to a solution. At this point the system calls CompDerivs() again because just moving the parameters a small amount may have actually changed the derivative. The cycle begins again. When the IK solver reaches its solution, the IK task is finished.

virtual void EnumIKParams (IKEnumCallback &callback)
 
virtual BOOL CompDeriv (TimeValue t, Matrix3 &ptm, IKDeriv &derivs, DWORD flags)
 
virtual float IncIKParam (TimeValue t, int index, float delta)
 
virtual void ClearIKParam (Interval iv, int index)
 
virtual void InitIKJoints (InitJointData *posData, InitJointData *rotData)
 
virtual BOOL GetIKJoints (InitJointData *posData, InitJointData *rotData)
 
virtual BOOL GetDOFParams (TimeValue t, Matrix3 &ptm, DOFParams &dofs, BOOL nodeSel)
 
virtual BOOL CreateLockKey (TimeValue t, int which)
 
virtual void MirrorIKConstraints (int axis, int which, BOOL pasteMirror=FALSE)
 
virtual BOOL TerminateIK ()
 
virtual void InitIKJoints2 (InitJointData2 *posData, InitJointData2 *rotData)
 
virtual BOOL GetIKJoints2 (InitJointData2 *posData, InitJointData2 *rotData)
 
virtual void NodeIKParamsChanged ()
 
virtual void TMInvalidated ()
 
virtual BOOL OKToBindToNode (INode *node)
 
Copying and Pasting IK Parameters in the Hierarchy Branch


virtual BOOL CanCopyIKParams (int which)
 
virtual IKClipObjectCopyIKParams (int which)
 
virtual BOOL CanPasteIKParams (IKClipObject *co, int which)
 
virtual void PasteIKParams (IKClipObject *co, int which)
 
Ease/Mulitplier Curves
virtual BOOL CanApplyEaseMultCurves ()
 
CoreExport TimeValue ApplyEase (TimeValue t, Interval &valid)
 
CoreExport void AppendEaseCurve (Control *cont)
 
CoreExport void DeleteEaseCurve (int i)
 
CoreExport ControlGetEaseCurve (int i)
 
CoreExport int NumEaseCurves ()
 
CoreExport float GetMultVal (TimeValue t, Interval &valid)
 
CoreExport void AppendMultCurve (Control *cont)
 
CoreExport void DeleteMultCurve (int i)
 
CoreExport ControlGetMultCurve (int i)
 
CoreExport int NumMultCurves ()
 
Post Clone Notification
virtual void PostCloneNode ()
 
Display a Gizmo (apparatus) in a Scene

Controllers that want to have a gizmo (apparatus) available in the scene need to implement these methods:

virtual int Display (TimeValue t, INode *inode, ViewExp *vpt, int flags)
 
virtual int HitTest (TimeValue t, INode *inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt)
 
virtual void GetWorldBoundBox (TimeValue t, INode *inode, ViewExp *vpt, Box3 &box)
 
virtual void ActivateSubobjSel (int level, XFormModes &modes)
 
virtual void SelectSubComponent (CtrlHitRecord *hitRec, BOOL selected, BOOL all, BOOL invert=FALSE)
 
virtual void ClearSelection (int selLevel)
 
virtual int SubObjectIndex (CtrlHitRecord *hitRec)
 
virtual void SelectAll (int selLevel)
 
virtual void InvertSelection (int selLevel)
 
Reference Coordinate System Definition

When the user is in a sub-object selection level, the system needs to get the reference coordinate system definition from the current controller being edited so that it can display the axis.

Following methods are used for this purpose:

virtual void GetSubObjectCenters (SubObjAxisCallback *cb, TimeValue t, INode *node)
 
virtual void GetSubObjectTMs (SubObjAxisCallback *cb, TimeValue t, INode *node)
 
Modify Sub-object Apparatuses
virtual void SubMove (TimeValue t, Matrix3 &partm, Matrix3 &tmAxis, Point3 &val, BOOL localOrigin=FALSE)
 
virtual void SubRotate (TimeValue t, Matrix3 &partm, Matrix3 &tmAxis, Quat &val, BOOL localOrigin=FALSE)
 
virtual void SubScale (TimeValue t, Matrix3 &partm, Matrix3 &tmAxis, Point3 &val, BOOL localOrigin=FALSE)
 
virtual BOOL RescaleTime (Interval oseg, Interval nseg)
 
virtual int GetDrawPixelStep ()
 
virtual int GetExtentTimeStep ()
 
- Public Member Functions inherited from ReferenceTarget
virtual CoreExport void GetClassName (MSTR &s, bool localized=true) const override
 Retrieves the name of the plugin class. More...
 
virtual CoreExport SClass_ID SuperClassID ()
 Retrieves a constant representing the type of the plugin. More...
 
virtual BOOL IsRefTarget ()
 Checks if this is a ReferenceTarget. More...
 
CoreExport RefResult TestForLoop (const Interval &refInterval, RefMakerHandle hmaker)
 Tests for a cyclical reference. More...
 
CoreExport BOOL HasDependents ()
 Checks if a ReferenceTarget has references. More...
 
CoreExport BOOL HasRealDependents ()
 Checks if this has Real (Strong) Dependents. More...
 
void BeginDependencyTest ()
 Starts Dependency Test. More...
 
BOOL EndDependencyTest ()
 Ends Dependency Test. More...
 
virtual void RefAdded (RefMakerHandle rm)
 Called after a reference is made to a target. More...
 
virtual void RefAddedUndoRedo (RefMakerHandle rm)
 Called after a reference is made to a target because of undo or redo. More...
 
virtual void RefDeleted ()
 Called after a references to this is deleted. More...
 
virtual void RefDeletedUndoRedo ()
 Called after a references to this is deleted because of undo or redo. More...
 
CoreExport RefResult DeleteAllRefsToMe ()
 Deletes all references to this ReferenceTarget. More...
 
CoreExport RefResult TransferReferences (RefTargetHandle oldTarget, BOOL delOld=FALSE)
 Transfers all the references from oldTarget to this. More...
 
CoreExport int DoEnumDependents (DependentEnumProc *dep)
 Begins an enumeration that searches back in the dependency network. More...
 
virtual CoreExport RefTargetHandle Clone (RemapDir &remap)
 This method is used by 3ds Max to clone an object. More...
 
virtual CoreExport RefResult NotifyDependents (const Interval &changeInt, PartID partID, RefMessage message, SClass_ID sclass=NOTIFY_ALL, BOOL propagate=TRUE, RefTargetHandle hTarg=NULL, NotifyDependentsOption notifyDependentsOption=REFNOTIFY_ALLOW_OPTIMIZATIONS)
 Notify all dependent RefMakers concerned with the message. More...
 
void FlagDependents (TimeValue t, PartID which=PART_PUT_IN_FG)
 This sends the REFMSG_FLAGDEPENDENTS message up the pipeline. More...
 
virtual void NotifyForeground (TimeValue t)
 This method is called to flag dependents into the FG. More...
 
virtual void NotifyTarget (int message, ReferenceMaker *hMaker)
 Sends messages to ReferenceTargets. More...
 
virtual CoreExport BaseInterfaceGetInterface (Interface_ID id)
 Inherited from Animatable. More...
 
CoreExport ReferenceTarget ()
 Constructor. More...
 
virtual CoreExport RefResult AutoDelete ()
 Deletes the object when it has no more real dependents. More...
 
CoreExport RefResult MaybeAutoDelete ()
 Deletes the object when it has no more real dependents. More...
 
- Public Member Functions inherited from ReferenceMaker
CoreExport RefResult ReplaceReference (int which, RefTargetHandle newtarg, BOOL delOld=TRUE)
 Used when cloning reference makers. More...
 
CoreExport RefResult DeleteAllRefsFromMe ()
 Deletes all references from this ReferenceMaker. More...
 
CoreExport RefResult DeleteAllRefs ()
 Deletes all references both to and from this item. More...
 
CoreExport RefResult DeleteReference (int i)
 Deletes the specified reference. More...
 
virtual BOOL CanTransferReference (int i)
 Tells whether this reference can be transfered. More...
 
CoreExport ReferenceSaveManagerGetReferenceSaveManager ()
 Access the ReferenceSaveManager of this ReferenceMaker. More...
 
virtual int RemapRefOnLoad (int iref)
 Used to load old files with references. More...
 
virtual CoreExport void RescaleWorldUnits (float f)
 Rescale size of all world units in reference hierarchy. More...
 
virtual CoreExport void EnumAuxFiles (AssetEnumCallback &assetEnum, DWORD flags)
 Enumerate auxiliary files (e.g. bitmaps) More...
 
virtual CoreExport void SaveEnum (SaveEnumProc &sep, BOOL isNodeCall=0)
 The default save enumeration. More...
 
virtual CoreExport bool SpecifySaveReferences (ReferenceSaveManager &referenceSaveManager)
 Used to specify reference slot remapping during scene file save. More...
 
CoreExport int DoEnumDependents (DependentEnumProc *dep)
 Begins an enumeration that searches back in the dependency network. More...
 
CoreExport bool EnumRefHierarchy (RefEnumProc &proc, bool includeCustAttribs=true, bool includeIndirectRefs=true, bool includeNonPersistentRefs=true, bool preventDuplicatesViaFlag=true)
 This method provides a general purpose reference enumerator. More...
 
CoreExport int FindRef (RefTargetHandle rtarg)
 Get the index of the ReferenceTarget. More...
 
virtual BOOL IsRefMaker ()
 Tells whether it is a ReferenceMaker. More...
 
virtual BOOL IsRealDependency (ReferenceTarget *rtarg)
 Returns whether this is a "real" (strong) dependency or not. More...
 
virtual BOOL ShouldPersistWeakRef (RefTargetHandle rtarg)
 Specifies whether a weak reference is to be persisted on a partial load or save. More...
 
CoreExport ReferenceMaker ()
 Constructor. More...
 
CoreExport void DeleteMe ()
 Deletes an instance of this class. More...
 
- Public Member Functions inherited from Animatable
virtual void FreeCaches ()
 
virtual int NumChildren ()
 
virtual AnimatableChildAnim (int i)
 
virtual CoreExport MSTR NodeName ()
 
virtual void EditTrack ()
 
virtual CoreExport BOOL SubAnimSetKeyBufferPresent (int subNum)
 returns true if the sub-anim has a "Set Key" buffer present More...
 
virtual BOOL SetKeyBufferPresent ()
 returns true if there is a "Set Key" buffer present More...
 
virtual CoreExport void SubAnimCommitSetKeyBuffer (TimeValue t, int subNum)
 Commit any "Set Key" buffers on the given sub-anim. More...
 
virtual void CommitSetKeyBuffer (TimeValue t)
 Commit any "Set Key" buffers. More...
 
virtual CoreExport void SubAnimRevertSetKeyBuffer (int subNum)
 Revert any "Set Key" buffers on the given sub-anim. More...
 
virtual void RevertSetKeyBuffer ()
 Revert any "Set Key" buffers. More...
 
virtual LRESULT CALLBACK TrackViewWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 This function is obsolete. More...
 
virtual bool IsParamBlockDesc2Used (ParamBlockDesc2 *desc)
 Returns true if the passed description is being used. More...
 
virtual bool GetMacroRecorderName (bool used_as_rhs_value, MSTR &objectSpecifiedName)
 This method is called to access the object specified name to use for the Maxscript macrorecorder. More...
 
CoreExport Animatable ()
 Constructor. More...
 
virtual CoreExport void DeleteThis ()
 Deletes an instance of this class. More...
 
virtual void GetClassName (MSTR &s) MAX_SEALED
 
MSTR ClassName (bool localized=true) const
 Returns the name of the plugin class. More...
 
virtual CoreExport Class_ID ClassID ()
 Retrieves a constant that uniquely identifies the plugin class. More...
 
virtual void BeginEditParams (IObjParam *ip, ULONG flags, Animatable *prev=NULL)
 
virtual void EndEditParams (IObjParam *ip, ULONG flags, Animatable *next=NULL)
 
virtual CoreExport void ReleaseInterface (ULONG id, void *i)
 
virtual CoreExport int SetProperty (ULONG id, void *data)
 
virtual CoreExport voidGetProperty (ULONG id)
 
CoreExport void AppendProperty (AnimProperty *prop)
 A function to directly add arbitrary properties to this object developers should ensure that the properties ID does not conflict with any Max-specific IDs. More...
 
CoreExport AnimPropertyFindProperty (DWORD id)
 Find any property. More...
 
CoreExport void AddAppDataChunk (const Class_ID &cid, SClass_ID sid, DWORD sbid, DWORD len, void *data)
 Adds application/plugin specific (custom) data to an Animatable. More...
 
CoreExport AppDataChunkGetAppDataChunk (const Class_ID &cid, SClass_ID sid, DWORD sbid)
 Retrieves the application/plugin specific (custom) data stored with an Animatable. More...
 
CoreExport BOOL RemoveAppDataChunk (const Class_ID &cid, SClass_ID sid, DWORD sbid)
 Deletes the application/plugin specific (custom) data stored with an Animatable. More...
 
CoreExport void ClearAllAppData ()
 Deletes all application/plugin specific (custom) data stored with an Animatable. More...
 
virtual MSTR SubAnimName (int i) MAX_SEALED
 
virtual BOOL CanDeleteSubAnim (int i)
 
virtual void DeleteSubAnim (int i)
 
virtual DWORD GetSubAnimCurveColor (int subNum)
 
virtual int SubNumToRefNum (int subNum)
 
virtual BOOL CanCopyAnim ()
 
CoreExport int HasSubElements (int type=0)
 
virtual int GetSubFCurveExtents (int subNum, ParamDimensionBase *dim, float &min, float &max, DWORD flags)
 The values max and min should be initialized before calling this function. More...
 
virtual ParamDimensionGetParamDimension (int i)
 
virtual BOOL SelectSubAnim (int subNum)
 
virtual BOOL BypassTreeView ()
 
virtual BOOL BypassTrackBar ()
 
virtual BOOL BypassPropertyLevel ()
 
virtual BOOL InvisibleProperty ()
 
virtual int NumKeys ()
 
virtual TimeValue GetKeyTime (int index)
 
virtual int GetKeyIndex (TimeValue t)
 
virtual BOOL GetNextKeyTime (TimeValue t, DWORD flags, TimeValue &nt)
 
virtual void CopyKeysFromTime (TimeValue src, TimeValue dst, DWORD flags)
 
virtual void DeleteKeyAtTime (TimeValue t)
 
virtual BOOL IsKeyAtTime (TimeValue t, DWORD flags)
 
virtual int GetKeyTimes (Tab< TimeValue > &times, Interval range, DWORD flags)
 
virtual int GetKeySelState (BitArray &sel, Interval range, DWORD flags)
 
CoreExport void OpenTreeEntry (int type, DWORD tv)
 
CoreExport void CloseTreeEntry (int type, DWORD tv)
 
CoreExport int IsTreeEntryOpen (int type, DWORD tv)
 
CoreExport BOOL GetSelInTrackView (DWORD tv)
 
CoreExport void SetSelInTrackView (DWORD tv, BOOL sel)
 
CoreExport BOOL InTrackViewSelSet (int which)
 
CoreExport void SetTrackViewSelSet (int which, BOOL inOut)
 
virtual BOOL AssignController (Animatable *control, int subAnim)
 
virtual BOOL CanAssignController (int subAnim)
 Return true if we can reassign the subanim specified. More...
 
virtual BOOL CanMakeUnique ()
 
CoreExport int EnumAnimTree (AnimEnum *animEnum, Animatable *client, int subNum)
 
virtual int RenderBegin (TimeValue t, ULONG flags=0)
 
virtual int RenderEnd (TimeValue t)
 
virtual CoreExport Interval GetTimeRange (DWORD flags)
 
virtual void EditTimeRange (Interval range, DWORD flags)
 
virtual void DeleteTime (Interval iv, DWORD flags)
 
virtual void ReverseTime (Interval iv, DWORD flags)
 
virtual void ScaleTime (Interval iv, float s)
 
virtual void InsertTime (TimeValue ins, TimeValue amount)
 
virtual BOOL SupportTimeOperations ()
 
virtual CoreExport void MapKeys (TimeMap *map, DWORD flags)
 
virtual void DeleteKeys (DWORD flags)
 
virtual void DeleteKeyByIndex (int index)
 
virtual void SelectKeys (TrackHitTab &sel, DWORD flags)
 
virtual void SelectSubKeys (int subNum, TrackHitTab &sel, DWORD flags)
 
virtual void SelectSubCurve (int subNum, BOOL sel)
 
virtual void SelectKeyByIndex (int i, BOOL sel)
 
virtual BOOL IsKeySelected (int i)
 
virtual void FlagKey (TrackHitRecord hit)
 
virtual int GetFlagKeyIndex ()
 
virtual int NumSelKeys ()
 
virtual void CloneSelectedKeys (BOOL offset=FALSE)
 
virtual void AddNewKey (TimeValue t, DWORD flags)
 
virtual void MoveKeys (ParamDimensionBase *dim, float delta, DWORD flags)
 
virtual void ScaleKeyValues (ParamDimensionBase *dim, float origin, float scale, DWORD flags)
 
virtual void SelectCurve (BOOL sel)
 
virtual BOOL IsCurveSelected ()
 Returns TRUE if the function curve is selected; otherwise returns FALSE. More...
 
virtual BOOL IsSubCurveSelected (int subNum)
 Returns the selected state of the sub-curve whose index is passed. More...
 
virtual int GetSelKeyCoords (TimeValue &t, float &val, DWORD flags)
 
virtual void SetSelKeyCoords (TimeValue t, float val, DWORD flags)
 
virtual int SetSelKeyCoordsExpr (ParamDimension *dim, const MCHAR *timeExpr, const MCHAR *valExpr, DWORD flags)
 
virtual void AdjustTangents (TrackHitRecord hit, ParamDimensionBase *dim, Rect &rcGraph, float tzoom, int tscroll, float vzoom, int vscroll, int dx, int dy, DWORD flags)
 
virtual void AdjustTangents (TrackHitRecord hit, ParamDimensionBase *dim, float angle, float length, DWORD flags)
 
virtual CoreExport BOOL IsAnimated ()
 
virtual BOOL CanCopyTrack (Interval iv, DWORD flags)
 
virtual BOOL CanPasteTrack (TrackClipObject *cobj, Interval iv, DWORD flags)
 
virtual TrackClipObjectCopyTrack (Interval iv, DWORD flags)
 
virtual void PasteTrack (TrackClipObject *cobj, Interval iv, DWORD flags)
 
virtual BOOL CanCopySubTrack (int subNum, Interval iv, DWORD flags)
 
virtual BOOL CanPasteSubTrack (int subNum, TrackClipObject *cobj, Interval iv, DWORD flags)
 
virtual TrackClipObjectCopySubTrack (int subNum, Interval iv, DWORD flags)
 
virtual void PasteSubTrack (int subNum, TrackClipObject *cobj, Interval iv, DWORD flags)
 
virtual int GetTrackVSpace (int lineHeight)
 
virtual int HitTestTrack (TrackHitTab &hits, Rect &rcHit, Rect &rcTrack, float zoom, int scroll, DWORD flags)
 
virtual int PaintTrack (ParamDimensionBase *dim, HDC hdc, Rect &rcTrack, Rect &rcPaint, float zoom, int scroll, DWORD flags)
 
virtual int PaintSubTrack (int subNum, ParamDimensionBase *dim, HDC hdc, Rect &rcTrack, Rect &rcPaint, float zoom, int scroll, DWORD flags)
 
virtual int HitTestFCurves (ParamDimensionBase *dim, TrackHitTab &hits, Rect &rcHit, Rect &rcGraph, float tzoom, int tscroll, float vzoom, int vscroll, DWORD flags)
 
virtual int PaintSubFCurves (int subNum, ParamDimensionBase *dim, HDC hdc, Rect &rcGraph, Rect &rcPaint, float tzoom, int tscroll, float vzoom, int vscroll, DWORD flags)
 
virtual int HitTestSubFCurves (int subNum, ParamDimensionBase *dim, TrackHitTab &hits, Rect &rcHit, Rect &rcGraph, float tzoom, int tscroll, float vzoom, int vscroll, DWORD flags)
 
virtual void EditTrackParams (TimeValue t, ParamDimensionBase *dim, const MCHAR *pname, HWND hParent, IObjParam *ip, DWORD flags)
 
virtual int TrackParamsType ()
 
CoreExport void AddNoteTrack (NoteTrack *note)
 
CoreExport void DeleteNoteTrack (NoteTrack *note, BOOL delNote=TRUE)
 
CoreExport BOOL HasNoteTracks ()
 
CoreExport int NumNoteTracks ()
 
CoreExport NoteTrackGetNoteTrack (int i)
 
virtual void FreeAllBitmaps ()
 
virtual void GetSystemNodes (INodeTab &nodes, SysNodeContext Context)
 
virtual BOOL IsSubClassOf (Class_ID classID)
 returns true if the animatable has sub-classed off the given class More...
 
virtual CoreExport void MouseCycleCompleted (TimeValue t)
 
virtual CoreExport void MouseCycleStarted (TimeValue t)
 
virtual int NumParamBlocks ()
 
virtual IParamBlock2GetParamBlock (int i)
 
virtual IParamBlock2GetParamBlockByID (short id)
 
CoreExport bool SvSaveData (ISave *isave, USHORT id)
 
CoreExport bool SvLoadData (ILoad *iLoad)
 
CoreExport DWORD SvGetRefIndex ()
 
CoreExport void SvSetRefIndex (DWORD i)
 
CoreExport bool SvDeleteRefIndex ()
 
CoreExport SvGraphNodeReference SvStdTraverseAnimGraph (IGraphObjectManager *gom, Animatable *owner, int id, DWORD flags)
 
virtual CoreExport bool SvCanSetName (IGraphObjectManager *gom, IGraphNode *gNode)
 
virtual CoreExport bool SvSetName (IGraphObjectManager *gom, IGraphNode *gNode, const MSTR &name)
 
virtual CoreExport bool SvCanRemoveThis (IGraphObjectManager *gom, IGraphNode *gNode)
 
virtual CoreExport bool SvRemoveThis (IGraphObjectManager *gom, IGraphNode *gNode)
 Called when the user deletes this object in the schematic view... More...
 
virtual CoreExport bool SvIsSelected (IGraphObjectManager *gom, IGraphNode *gNode)
 Returns true if the object is selected in its schematic view. More...
 
virtual CoreExport bool SvIsHighlighted (IGraphObjectManager *gom, IGraphNode *gNode)
 
virtual CoreExport COLORREF SvHighlightColor (IGraphObjectManager *gom, IGraphNode *gNode)
 
virtual CoreExport COLORREF SvGetSwatchColor (IGraphObjectManager *gom, IGraphNode *gNode)
 
virtual CoreExport bool SvIsInactive (IGraphObjectManager *gom, IGraphNode *gNode)
 
virtual CoreExport MultiSelectCallbackSvGetMultiSelectCallback (IGraphObjectManager *gom, IGraphNode *gNode)
 
virtual CoreExport bool SvCanSelect (IGraphObjectManager *gom, IGraphNode *gNode)
 
virtual CoreExport MSTR SvGetTip (IGraphObjectManager *gom, IGraphNode *gNode)
 
virtual CoreExport MSTR SvGetRefTip (IGraphObjectManager *gom, IGraphNode *gNode, IGraphNode *gNodeMaker)
 
virtual CoreExport bool SvCanDetach (IGraphObjectManager *gom, IGraphNode *gNode)
 
virtual CoreExport bool SvDetach (IGraphObjectManager *gom, IGraphNode *gNode)
 
virtual CoreExport MSTR SvGetRelTip (IGraphObjectManager *gom, IGraphNode *gNodeTarget, int id, IGraphNode *gNodeMaker)
 Returns a string to be displayed in the tip window in the schematic view for a relationship from "gNodeMaker" to "gNodeTarget"... More...
 
virtual CoreExport bool SvCanDetachRel (IGraphObjectManager *gom, IGraphNode *gNodeTarget, int id, IGraphNode *gNodeMaker)
 Returns true if this object can respond to the SvDetachRel(...) method... More...
 
virtual CoreExport bool SvDetachRel (IGraphObjectManager *gom, IGraphNode *gNodeTarget, int id, IGraphNode *gNodeMaker)
 Detach this relationship. More...
 
virtual CoreExport bool SvHandleRelDoubleClick (IGraphObjectManager *gom, IGraphNode *gNodeTarget, int id, IGraphNode *gNodeMaker)
 Called when this relationship is double-clicked in the schematic view... More...
 
CoreExport ICustAttribContainerGetCustAttribContainer ()
 This method returns a pointer to the custom attributes container interface class. More...
 
CoreExport void AllocCustAttribContainer ()
 This method allocates space for a custom attributes container. More...
 
CoreExport void DeleteCustAttribContainer ()
 This method deletes space used by a custom attributes container. More...
 
void SetAFlag (DWORD mask)
 
void ClearAFlag (DWORD mask)
 Clears one or more bits in the Animatable flags. More...
 
bool TestAFlag (DWORD mask) const
 Tests one or more bits in the Animatable flags. More...
 
void SetAFlagEx (DWORD mask)
 Sets one or more bits in the Animatable extended flags. More...
 
void ClearAFlagEx (DWORD mask)
 Clears one or more bits in the Animatable extended flags. More...
 
bool TestAFlagEx (DWORD mask) const
 Tests one or more bits in the Animatable extended flags. More...
 
CoreExport bool TestFlagBit (int index)
 Tests the specified flag bit. More...
 
CoreExport void SetFlagBit (int index, bool newValue=true)
 Sets the specified flag bit. More...
 
CoreExport void ClearFlagBit (int index)
 Clears the specified flag bit. More...
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Protected Member Functions

virtual CoreExport void SetReference (int i, RefTargetHandle rtarg)
 Stores a ReferenceTarget as its 'i-th' reference`. More...
 
- Protected Member Functions inherited from ReferenceTarget
virtual CoreExport int DoEnumDependentsImpl (DependentEnumProc *dep)
 Method to perform an enumeration on a ReferenceTarget. More...
 
virtual CoreExport ~ReferenceTarget ()=0
 Destructor. More...
 
- Protected Member Functions inherited from ReferenceMaker
virtual RefResult NotifyRefChanged (const Interval &changeInt, RefTargetHandle hTarget, PartID &partID, RefMessage message, BOOL propagate)=0
 Receives and responds to messages. More...
 
virtual CoreExport ~ReferenceMaker ()=0
 Destructor. More...
 
void BlockEval ()
 Validates a given reference link between this reference maker and its reference target. More...
 
void UnblockEval ()
 Validates a given reference link between this reference maker and its reference target. More...
 
int Evaluating ()
 Validates a given reference link between this reference maker and its reference target. More...
 
CoreExport RefResult StdNotifyRefChanged (const Interval &changeInt, RefTargetHandle hTarget, PartID partID, RefMessage message, BOOL propagate, NotifyDependentsOption notifyDependentsOption)
 Validates a given reference link between this reference maker and its reference target. More...
 
- Protected Member Functions inherited from Animatable
virtual CoreExport ~Animatable ()=0
 Destructor. More...
 
- Protected Member Functions inherited from Noncopyable
 Noncopyable ()
 
 ~Noncopyable ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Animatable
static CoreExport BOOL IsDeleted (Animatable *anim)
 Debug method to determine whether an object has been deleted. More...
 
static CoreExport AnimHandle GetHandleByAnim (Animatable *anim)
 Get the unique handle for an Animatable object. More...
 
static CoreExport AnimatableGetAnimByHandle (AnimHandle handle)
 Get an Animatable object from its unique handle. More...
 
static CoreExport AnimHandle GetNextHandle ()
 Get the unique handle for the next Animatable object to be created. More...
 
static CoreExport void EnumerateAllAnimatables (EnumAnimList &enumProcObject)
 Enumerator to enumerate across all animatables. More...
 
static CoreExport bool RegisterAppDataLoadCallback (const Class_ID &cid, SClass_ID sid, APPDATALOADPROC proc)
 Registers a callback proc that is called when an AppDataChunk is read from a scene file. More...
 
static CoreExport bool UnRegisterAppDataLoadCallback (const Class_ID &cid, SClass_ID sid, APPDATALOADPROC proc)
 Unregisters a callback proc that is called when an AppDataChunk is read from a scene file. More...
 
static CoreExport bool RegisterAppDataLoadCallback (DWORD sbid, APPDATALOADPROC proc)
 Registers a callback proc that is called when an AppDataChunk is read from a scene file. More...
 
static CoreExport bool UnRegisterAppDataLoadCallback (DWORD sbid, APPDATALOADPROC proc)
 Unregisters a callback proc that is called when an AppDataChunk is read from a scene file. More...
 
static CoreExport int RequestFlagBit ()
 Requests an unique flag bit index. More...
 
static CoreExport void ReleaseFlagBit (int index)
 Releases the flag bit index. More...
 
static CoreExport void ClearFlagBitInAllAnimatables (int index)
 Clears the specified flag bit in all Animatables. More...
 
- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 
- Static Public Attributes inherited from Animatable
static const AnimHandle kInvalidAnimHandle = 0
 
- Protected Attributes inherited from Animatable
DWORD aflag
 
AnimPropertyList aprops
 

Detailed Description

See also
Class ReferenceTarget, Class IKeyControl, Class IKDeriv, Class IKEnumCallback, Class StdControl, Class AngAxis, Additional_Controller_Related_Functions, Class Quat, Class Interval, Class Matrix3, Class Point3, Class ScaleValue, Class JointParams, Class SetXFormPackt.

Description:
Control is the class from which you may derived controller objects. Controllers are the objects in 3ds Max that control animation. Controllers come in different types based on the type of data they control. For example, Transform controllers control the 4x3 matrices used to define the position of nodes in the scene while float controllers control simple floating point values.

Note: Many controller plug-ins may be able to subclass from StdControl rather than Control. This simplifies the developers job. StdControl handles the processing of Out of Range Types, Ease Curves, and Multiplier Curves. See Class StdControl for more information.

Plug-In Information:

Class Defined In CONTROL.H

Super Class ID CTRL_FLOAT_CLASS_ID - Used by float controllers.

CTRL_POINT3_CLASS_ID - Used by Point3 controllers.

CTRL_MATRIX3_CLASS_ID - Used by Matrix3 controllers.

CTRL_POSITION_CLASS_ID - Used by position controllers.

CTRL_ROTATION_CLASS_ID - Used by rotation controllers.

CTRL_SCALE_CLASS_ID - Used by scale controllers.

CTRL_MORPH_CLASS_ID - Used by morph controllers.

Standard File Name Extension DLC

Extra Include File Needed None
Defines:
#define CONT_FLAGS_CHUNK 0x3003

Constructor & Destructor Documentation

◆ Control()

◆ ~Control()

virtual ~Control ( )
inlinevirtual
1060 {};

Member Function Documentation

◆ Copy()

virtual void Copy ( Control from)
pure virtual
Remarks
When a controller is assigned to a track in the track view, the new controller is plugged into the parameter and this method is called on the new controller. A pointer to the old controller is passed in to this method. The new controller can attempt to copy any data that it can from the old controller. At the very least it should initialize itself to the value of the old controller at frame 0.
Parameters
fromA pointer to the previous controller.

◆ CommitValue()

virtual void CommitValue ( TimeValue  t)
inlinevirtual
Remarks
This method, along with RestoreValue(), comprise an "inner" hold and restore mechanism (see above). When the controller's SetValue() method is called, if the commit parameter is nonzero, then the controller should save the value of the controller at the current time into its cache and also 'commit' the value. For example, this stores a key in the case of a keyframe controller. If the set value was not committed then RestoreValue() may be called to restore the previous value.
Parameters
tSpecifies the time to save the value.
Default Implementation:
{}
1107 {}

◆ RestoreValue()

virtual void RestoreValue ( TimeValue  t)
inlinevirtual
Remarks
This method is the other half of the "inner" hold and restore mechanism. This method is called to restore a previously saved value. This method restores the current cache value to the value that was set before SetValue() was last called. They way the standard 3ds Max controllers handle this is as follows: When SetValue() is called a temporary hold mechanism (TempStore define in CONTROL.H) is used to hold the current value. Then the new value is set. If RestoreValue() is later called then it restores the current value from the temporary storage. Note that in addition to restoring from the TempStore, another way a controller may restore the current value is to re-interpolate the keys.
Parameters
tSpecifies the time to restore the value.
Default Implementation:
{}
1122 {}

◆ GetTarget()

virtual INode* GetTarget ( )
inlinevirtual
Remarks
This method retrieves a lookat controller's target.
Returns
The lookat controllers target node.
Default Implementation:
{ return NULL; }
1131 { return NULL; }
#define NULL
Definition: autoptr.h:18

◆ SetTarget()

virtual RefResult SetTarget ( INode targ)
inlinevirtual
Remarks
This method stores a lookat controller's target.
Parameters
targThe target node to store.
Returns
One of the following values:

REF_SUCCEED

Indicates the target was set.

REF_FAIL

Indicates the target was not set.
Default Implementation:
{return REF_SUCCEED;}
1141 {return REF_SUCCEED;}
@ REF_SUCCEED
The operation succeeded.
Definition: ref.h:765

◆ GetPositionController()

virtual Control* GetPositionController ( )
inlinevirtual
Remarks
Implemented by transform controllers that have a position controller that can be edited in the motion branch. This method returns a pointer to the position controller of the transform controller.
Default Implementation:
{return NULL;}
1153 {return NULL;}

◆ GetRotationController()

virtual Control* GetRotationController ( )
inlinevirtual
Remarks
Implemented by transform controllers that have a rotation controller that can be edited in the motion branch. This method returns a pointer to the rotation controller of the transform controller.
Returns
Default Implementation:
{return NULL;}
1160 {return NULL;}

◆ GetScaleController()

virtual Control* GetScaleController ( )
inlinevirtual
Remarks
Implemented by transform controllers that have a scale controller that can be edited in the motion branch. This method returns the a pointer to the scale controller of the transform controller.
Returns
Default Implementation:
{return NULL;}
1167 {return NULL;}

◆ SetPositionController()

virtual BOOL SetPositionController ( Control c)
inlinevirtual
Remarks
This method assigns a new position controller. Plug-Ins don't need to be concerned with freeing the previous controller if this method is called. Any previous controller assigned will be deleted by 3ds Max if it is not used elsewhere in the scene.
Default Implementation:
{return FALSE;}
1174 {return FALSE;}

◆ SetRotationController()

virtual BOOL SetRotationController ( Control c)
inlinevirtual
Remarks
This method assigns a new rotation controller. Plug-Ins don't need to be concerned with freeing the previous controller if this method is called. Any previous controller assigned will be deleted by 3ds Max if it is not used elsewhere in the scene.
Default Implementation:
{return FALSE;}
1181 {return FALSE;}

◆ SetScaleController()

virtual BOOL SetScaleController ( Control c)
inlinevirtual
Remarks
This method assigns a new scale controller. Plug-Ins don't need to be concerned with freeing the previous controller if this method is called. Any previous controller assigned will be deleted by 3ds Max if it is not used elsewhere in the scene.
Default Implementation:
{return FALSE;}
1188 {return FALSE;}

◆ GetXController()

virtual Control* GetXController ( )
inlinevirtual
Remarks
Returns a pointer to the 'X' sub-controller of this controller. If a controller has an 'X', 'Y', or 'Z' controller, it can implement this set of methods so that its sub-controllers can respect track view filters. Examples of controllers that have XYZ sub-controllers are the Euler angle controller or the Position XYZ controller.
Default Implementation:
{return NULL;}
1199 {return NULL;}

◆ GetYController()

virtual Control* GetYController ( )
inlinevirtual
Remarks
Returns a pointer to the 'Y' sub-controller of this controller. If a controller has an 'X', 'Y', or 'Z' controller, it can implement this set of methods so that its sub-controllers can respect track view filters. Examples of controllers that have XYZ sub-controllers are the Euler angle controller or the Position XYZ controller.
Default Implementation:
{return NULL;}
1207 {return NULL;}

◆ GetZController()

virtual Control* GetZController ( )
inlinevirtual
Remarks
Returns a pointer to the 'Z' sub-controller of this controller. If a controller has an 'X', 'Y', or 'Z' controller, it can implement this set of methods so that its sub-controllers can respect track view filters. Examples of controllers that have XYZ sub-controllers are the Euler angle controller or the Position XYZ controller.
Default Implementation:
{return NULL;}
1215 {return NULL;}

◆ GetWController()

virtual Control* GetWController ( )
inlinevirtual
Remarks
Implemented by transform controllers that have a position controller that can be edited in the motion branch. This method returns a pointer to the position controller of the transform controller.
Default Implementation:
{return NULL;}
1216 {return NULL;}

◆ GetRollController()

virtual Control* GetRollController ( )
inlinevirtual
Remarks
Implemented by lookat controllers that have a float valued roll controller so that the roll can be edited via the transform type-in. This method returns a pointer to the roll controller of the lookat controller.
Default Implementation:
{return NULL;}
1225 {return NULL;}

◆ SetRollController()

virtual BOOL SetRollController ( Control c)
inlinevirtual
Remarks
This method assigns a new roll controller. Plug-Ins don't need to be concerned with freeing the previous controller if this method is called. Any previous controller assigned will be deleted by 3ds Max if it is not used elsewhere in the scene.
Default Implementation:
{return FALSE;}
1232 {return FALSE;}

◆ GetInheritanceFlags()

virtual DWORD GetInheritanceFlags ( )
inlinevirtual
Remarks
This method should be implemented by TM controllers that support filtering out inheritance. It returns the state of the transform inheritance flags. These are the values that show up in the Hierarchy branch, under the Link Info section, in the Inheritance rollup.
Returns
One or more of the following values:

Note: Each bit is used to represent a single inheritance. If the bit is CLEAR (OFF) it means inherit (checked in the 3ds Max UI). If the bit is SET it means DON'T inherit (unchecked in the 3ds Max UI).

INHERIT_POS_X

INHERIT_POS_Y

INHERIT_POS_Z

INHERIT_ROT_X

INHERIT_ROT_Y

INHERIT_ROT_Z

INHERIT_SCL_X

INHERIT_SCL_Y

INHERIT_SCL_Z

INHERIT_ALL
Default Implementation:
{return INHERIT_ALL;}
1260 {return INHERIT_ALL;}
#define INHERIT_ALL
Definition: control.h:1026

◆ SetInheritanceFlags()

virtual BOOL SetInheritanceFlags ( DWORD  f,
BOOL  keepPos 
)
inlinevirtual
Remarks
This method should be implemented by TM controllers that support filtering out inheritance.

Note: Each bit is used to represent a single inheritance. This method expects the bits of the flags passed to be CLEAR (OFF) to mean DON'T inherit (unchecked in the 3ds Max UI). If they are SET it means inherit (checked in the 3ds Max UI).
Parameters
fThe inheritance flags. One or more of the following values:

INHERIT_POS_X
INHERIT_POS_Y
INHERIT_POS_Z
INHERIT_ROT_X
INHERIT_ROT_Y
INHERIT_ROT_Z
INHERIT_SCL_X
INHERIT_SCL_Y
INHERIT_SCL_Z
INHERIT_ALL
keepPosIf TRUE the position of the node should remain the same; otherwise the node may move.
Returns
Return TRUE if TM controller supports inheritance; otherwise FALSE.
Default Implementation:
{return FALSE;}
1283 {return FALSE;} // return TRUE if TM controller supports inheritance

◆ IsColorController()

virtual BOOL IsColorController ( )
inlinevirtual
Remarks
Implemented by any Point3 controller that wishes to indicate that it is intended to control floating point RGB color values. Returns TRUE to indicate that it controls float color values; otherwise FALSE.
Default Implementation:
{return FALSE;}
1295 {return FALSE;}

◆ IsLeaf()

virtual BOOL IsLeaf ( )
inlinevirtual
Remarks
Indicates whether the controller is a leaf controller. If a controller is a leaf controller, then it MUST NOT BY DEFINITION have any sub-controllers or references. The controller should return TRUE if it has no sub-controllers. For example, a PRS controller is not a leaf controller (because it has sub-controllers for Position, Rotation and Scale), but a simple keyframed float controller is a leaf controller.
Returns
TRUE if the controller is a leaf controller; FALSE otherwise.
Default Implementation:
{return TRUE;}
1305 {return TRUE;}

◆ IsKeyable()

virtual int IsKeyable ( )
inlinevirtual
Remarks
Indicates if the controller is a keyframe controller. This means the controller stores keys at certain frames and interpolates between keys at other times.
Returns
Nonzero if the controller is a keyframe controller; zero otherwise.
Default Implementation:
{return 1;}
1313 {return 1;}

◆ IsReplaceable()

virtual BOOL IsReplaceable ( )
inlinevirtual
Remarks
This method determines if another controller can replace this one. A controller can return FALSE from this method to not allow the user to assign a new controller in its place. This will also prevent the controller from being replaced by a paste controller operation.
Returns
TRUE to allow the controller to be replaced; otherwise FALSE.
Default Implementation:
{return TRUE;}

Reimplemented in LockableControl, and LockableStdControl.

1327 {return TRUE;}

◆ ChangeParents()

virtual BOOL ChangeParents ( TimeValue  t,
const Matrix3 oldP,
const Matrix3 newP,
const Matrix3 tm 
)
inlinevirtual
Remarks
This method is called on transform, position, rotation, and scale controllers when their input matrix is about to change. This happens when the user links an object (either from one object to another or when the user links an object for the first time). Because a controllers transformation is relative to its parent, when the user changes parents, the transform controller will need to change itself. If a plug-in returns FALSE the node will calculate a change and call SetValue() to make the necessary adjustments at the specific time passed.

Consider the following example of a position controller:

If a node in the scene that is NOT animated, is linked to another node, this method would be called. If the method returned FALSE then the node would calculate a change and call SetValue() to make the adjustment and this would be okay. If however the node was animated there would be a problem. Say for example that an unlinked node was bouncing up and down along the world Z axis. If this node is then linked to a node that was rotated such that its Z axis was pointed in the direction of the world X axis (so the object is flipped over on its side) the linked node (whose animation keys are stored relative to its previous parent (the world)) would then begin to bounce up and down along the world X axis instead. This is because it is still moving along its parent's Z axis, but its parents Z axis is really the world X axis. Thus the object needs to be counter-rotated to compensate. Additionally, all the animation keys for the object also need to be counter-rotated. A position keyframe controller would need to implement this method to handle the correction of the object and its keyframes. See the sample code below.
Parameters
tThe time of the change.
oldPThe old parent matrix.
newPThe new parent matrix.
tmThe nodes current world transformation.
Returns
If FALSE the node will call SetValue() to make the necessary adjustments.
Default Implementation:
{return FALSE;}
Sample Code:
This is the code used inside 3ds Max' reactor controller (in MAXSDK/samples/controllers/reactor/reactor.cpp).
A plug-in could provide an implementation for this method using a similar concept.

BOOL Reactor::ChangeParents(TimeValue t, const Matrix3& oldP, const Matrix3& newP, const Matrix3& tm)
{
HoldAll();
// Position and rotation controllers need their path counter rotated to
// account for the new parent.
Matrix3 rel = oldP * Inverse(newP);
// Modify the controller's current value (the controller's cache).
*((Point3*)(&curpval)) = *((Point3*)(&curpval)) * rel;
*((Quat*)(&curqval)) = *((Quat*)(&curqval)) * rel;
// Modify each reaction state.
for (int i = 0; i < count; i++)
{
*((Point3*)(&mDrivenStates[i].pstate)) = *((Point3*)(&mDrivenStates[i].pstate)) * rel;
*((Quat*)(&mDrivenStates[i].qstate)) = *((Quat*)(&mDrivenStates[i].qstate)) * rel;
}
ivalid.SetEmpty();
return TRUE;
}
Definition: matrix3.h:99
Definition: point3.h:54
Definition: quat.h:172
DMatrix3 Inverse(const DMatrix3 &m)
Return the inverse of the matrix.
int TimeValue
Definition: maxtypes.h:31
1375 {return FALSE;}

◆ GetValue() [1/2]

virtual void GetValue ( TimeValue  t,
void val,
Interval valid,
GetSetMethod  method = CTRL_ABSOLUTE 
)
pure virtual
Remarks
Retrieves the value of the controller at the specified time, and updates the validity interval passed in to reflect the interval of the controller. This method is responsible for handling Out of Range Types, Ease Curves and Multiplier Curves. See the sample code below.
Parameters
tSpecifies the time to retrieve the value.
valThis points to a variable to hold the computed value of the controller at the specified time. What the plug-in needs to do to store the value of the controller depends on the controller type. There are six controller types: float, Point3, Position, Rotation, Scale, and Transform. The way the value is stored also depends on the GetSetMethod parameter method. See "val parameter Handling" below for a list of the possible cases, and how the value should be stored in each case.
validThe interval into which the validity of the evaluated parameters is intersected.
methodOne of the following values:

CTRL_RELATIVE
Indicates the plug-in should apply the value of the controller to *val. See Above.

CTRL_ABSOLUTE
Indicates the controller should simply store its value in *val. See Above.
val parameter Handling
float:
  • method == CTRL_ABSOLUTE - *val points to a float. The controller should simply store the value.
  • method == CTRL_RELATIVE, *val points to a float. The controller should add its value to the existing floating point value.
Point3:
  • method == CTRL_ABSOLUTE, *val points to a Point3. The controller should simply store the value.
  • method == CTRL_RELATIVE, *val points to a Point3. The controller should add its value to the existing Point3 value.
Position:
  • method == CTRL_ABSOLUTE, *val points to a Point3. The controller should simply store the value.
  • method == CTRL_RELATIVE, *val points to a Matrix3. The controller should apply its value to the matrix by pre-multiplying its position.
    Matrix3 *mat = (Matrix3*)val;
    Point3 v = the computed value of the controller...
    mat->PreTranslate(v);
    void PreTranslate(const Point3 &p)

Rotation:
  • method == CTRL_ABSOLUTE, *val points to a Quat. The controller should simply store the value.
  • method == CTRL_RELATIVE, *val points to a Matrix3. The controller should apply its value to the matrix by pre-multiplying its rotation.
    Matrix3 *mat = (Matrix3*)val;
    Quat q = the computed value of the controller...
    PreRotateMatrix(*mat,q);
    void PreRotateMatrix(Matrix3 &mat, const Quat &q)
Scale:
  • method == CTRL_ABSOLUTE, *val points to a ScaleValue. The controller should simply store the value.
  • method == CTRL_RELATIVE, *val points to a Matrix3. The controller should apply its value to the matrix by pre-multiplying its scale.
    Matrix3 *mat = (Matrix3*)val;
    ScaleValue s = the computed value of the controller...
    ApplyScaling(*mat,s);
    CoreExport void ApplyScaling(Matrix3 &m, const ScaleValue &v)
Transform (Matrix3)
  • method == CTRL_ABSOLUTE, *val points to a Matrix3. The controller should simply store the value. Note: Developers should only pass CTRL_RELATIVE when getting the value of a Matrix3 controller. This is because the controller may use the matrix as input to compute the value. Therefore it is not acceptable to use CTRL_ABSOLUTE to get the value.
  • method == CTRL_RELATIVE, *val points to a Matrix3. The controller should apply its value to the matrix by pre-multiplying. When GetValue() is called on a transform controller the method is CTRL_RELATIVE and the matrix passed is usually the parent of the node. Note: Important for Matrix3 Controllers: when Control::SetValue() is called *val points to an instance of Class SetXFormPacket. See that class for more details on how it is used.
Sample Code:
The following code is from the BoolControl implementation of this method (see MAXSDK/samples/controllers/boolcntrl/boolcntrl.cpp).
void BoolCntrl::GetValue(TimeValue t, void *val, Interval &valid, GetSetMethod method)
{
if (GetSetKeyMode() && setkeyBuffer) {
SetAFlag(A_USE_SETVAL_BUFFER_RANGE);
StdControl::GetValue(t, val, valid, method);
ClearAFlag(A_USE_SETVAL_BUFFER_RANGE);
} else {
StdControl::GetValue(t, val, valid, method);
}
}
void SetAFlag(DWORD mask)
Definition: Animatable.h:299
void ClearAFlag(DWORD mask)
Clears one or more bits in the Animatable flags.
Definition: Animatable.h:304
Definition: interval.h:36
CoreExport void GetValue(TimeValue t, void *val, Interval &valid, GetSetMethod method=CTRL_ABSOLUTE)
CoreExport BOOL GetSetKeyMode()
GetSetMethod
Definition: control.h:1006

Implemented in StdControl.

◆ GetValue() [2/2]

void GetValue ( TimeValue  t1,
void val1,
GetSetMethod  method1 = CTRL_ABSOLUTE 
)
inline
Remarks
Use this override when validity interval is irrelevant
1449 { Interval i = FOREVER; GetValue(t1, val1, i, method1); }
virtual void GetValue(TimeValue t, void *val, Interval &valid, GetSetMethod method=CTRL_ABSOLUTE)=0
#define FOREVER
Definition: interval.h:168

◆ SetValue()

virtual void SetValue ( TimeValue  t,
void val,
int  commit = 1,
GetSetMethod  method = CTRL_ABSOLUTE 
)
pure virtual
Remarks
This method sets the value of the controller at the specified time. This method is responsible for handling Out of Range Types, Ease Curves and Multiplier Curves. See the sample code below.

Note: Developers who want to create keys for a keyframe controller by calling SetValue() directly can do so, but the animate button should be turned on using the following code:

SuspendAnimate();

AnimateOn();

// Call SetValue() – make sure commit=1

ResumeAnimate();
Parameters
tSpecifies the time to save the value.
valPoints to an instance of a data type that corresponds with the controller type. These are the same as GetValue() above with the following exceptions:

For rotation controllers, if the GetSetMethod is CTRL_RELATIVE, *val points to an AngAxis, while if it is CTRL_ABSOLUTE it points to a Quat.

For Matrix3 controllers *val points to an instance of class SetXFormPacket. See Class SetXFormPacket.
commitWhen SetValue() is called the controller should store it value (usually into a cache it maintains), and if this parameter is set, also 'commit' it's value (usually by calling CommitValue()).

For example, consider a 3ds Max keyframe controller: If commit==1 and if the Animate button is on, then the cache should be updated and a key should be created. If the Animate button is off then the cache should be updated and the keys should all be offset. If commit==0 then the cache value is set and its validity interval is set to the current time. If later commit==1 then a key would be created from that cached value. If SetValue() is never called with commit=1 then the key is never set. For instance with Inverse Kinetmatics, SetValue() is called many times over and over at the same TimeValue with commit=0. The controller doesn't create a key, it just changes its cached value. When an IK solution is finally reached, SetValue() is called with commit=1 and a key is created.

Note that calling SetValue() with commit=0 and then calling CommitValue() should have the same effect as calling SetValue() with commit=1.

See the methods CommitValue() and RestoreValue() below.
methodOne of the following values:

CTRL_RELATIVE
Indicates the plug-in should add the value to the existing value *val (i.e. Move/Rotate/Scale)

CTRL_ABSOLUTE
Indicates the plug-in should just set the value. Important Note for Matrix3 Controllers:When SetValue() is called the method parameter is ignored. The *val pointer passed to SetValue() points to an instance of Class SetXFormPacket. See that class for more details on how it is used.
Sample Code:
The following code is from the BoolControl implementation of this method (see MAXSDK/samples/controllers/boolcntrl/boolcntrl.cpp).
void BoolCntrl::SetValue(TimeValue t, void *val, int commit, GetSetMethod method)
{
if(GetLocked()==false)
{
if (GetSetKeyMode() && setkeyBuffer) {
SetAFlag(A_USE_SETVAL_BUFFER_RANGE);
StdControl::SetValue(t, val, commit, method);
ClearAFlag(A_USE_SETVAL_BUFFER_RANGE);
} else {
StdControl::SetValue(t, val, commit, method);
}
}
}
CoreExport void SetValue(TimeValue t, void *val, int commit=1, GetSetMethod method=CTRL_ABSOLUTE)

Implemented in StdControl.

◆ GetLocalTMComponents()

virtual CoreExport bool GetLocalTMComponents ( TimeValue  t,
TMComponentsArg cmpts,
Matrix3Indirect parentMatrix 
)
virtual
Remarks
This method returns the PRS components of the local matrix. In general, controller cannot decide on the local matrix without knowing the parent matrix. However, many controllers, such as default controllers, are well defined without the parent matrix. In these cases, it is more efficient to compute the local components directly without going through the world matrix.

Therefore, the argument parentMatrix is a reference to Matrix3Indirect. This would allow clients to supply a "delayed parent matrix," which will be computed only if it is necessary. It returns true for Matrix3, Position, Rotation, or Scale controllers, and return false otherwise.

The PRS components will be put in argument cmpts in the respective fields with corresponding validity intervals. NULL pointer, of TMComponentsArg::position for example, indicates that the client is not concerned about the component. When it is not NULL, the corresponding pointer to the validity interval MUST NOT be NULL. When it is not NULL, TMComponentsArg::rotation is a float[4]. rotRep tells what the numbers mean.

Position, Rotation, or Scale, controllers will put results at the respective component when the corresponding pointer is not NULL.

Upon entry, parentMatrix should represent the parent matrix up to the first requested components. For Matrix3 controllers, for example, if cmpts.position==NULL && cmpts.rotation!=NULL, then parentMatrix should be matrix that includes the parent node matrix plus the position of this node. Upon return, this matrix may be modified.
Parameters
tThe time at which to get the local TM components.
cmptsSee Structure TMComponentsArgs.
parentMatrixThe parent matrix.

Note the definition: LocalMatrix = WorldMatrix * ParentWorldMatrix^(-1)

Reimplemented in StdControl.

◆ InheritsParentTransform()

virtual BOOL InheritsParentTransform ( )
inlinevirtual
Remarks
This method is only implemented by transform controllers. Transform controllers that do not inherit their parent's transform should override this method.

When a transform controller is evaluated, the parent transform is passed in to the controller and the controller typically applies its value to the parent transform. However, some controllers (for example Biped) may choose to control the TM in an absolute manner and therefore ignore the incoming parent's TM. The system needs to know about this because normally if an object and its parent are selected and the user attempts to move them only the parent transform is modified because it is assumed that the child will inherit its parents TM.
Returns
TRUE if the controller inherits its parents TM; otherwise FALSE. Returning FALSE will cause SetValue() to be called even in the case when the parent is also being transformed.
Note
This method may still return TRUE even if all the bits returned from GetInheritanceFlags() are SET to indicate that nothing is inherited from the parent. This is simply because these methods don't have the same level of 'granularity'. This method deals with the overall inheritance of the parent's transform whereas the inheritance flags relate to individual parts.
Default Implementation:
{ return TRUE; }
1563 { return TRUE; }

◆ GetORT()

virtual int GetORT ( int  type)
inlinevirtual
Remarks
Implemented by the System.

Returns the specified Out of Range Type used by the controller. The system handles this method but the controller needs to process the ORT in its implementation of GetValue() and SetValue().
Parameters
typeOne of the following values:

ORT_BEFORE - leading up to the pattern

ORT_AFTER - beyond the key pattern
Returns
One of the following values:

See Out of Range Types.
DWORD aflag
Definition: Animatable.h:161
#define ORT_BEFORE
Definition: control.h:121
#define A_ORT_MASK
Used internally.
Definition: AnimatableFlags.h:113
#define A_ORT_BEFORESHIFT
Uses bits 5,6 and 7 to store ORT.
Definition: AnimatableFlags.h:115
#define A_ORT_AFTERSHIFT
Uses bits 8,9 and 10 to store ORT.
Definition: AnimatableFlags.h:117

◆ SetORT()

virtual CoreExport void SetORT ( int  ort,
int  type 
)
virtual
Remarks
Implemented by the System.

Sets the specified Out of Range Type to be used by the controller. The system handles this method but the controller needs to process the ORT in its implementation of GetValue() and SetValue().
Parameters
ortSee outOfRangeTypes.
typeOne of the following values:

ORT_BEFORE - leading up to the pattern

ORT_AFTER - beyond the key pattern

◆ EnableORTs()

virtual CoreExport void EnableORTs ( BOOL  enable)
virtual
Remarks
Implemented by the System.

Sets the enabled/disabled state for Out of Range Types. If disabled, this temporarily causes the Out of Range Types to behave as if set to constant. This can be used if you want to modify a controller but don't want ORT mapping for ORT_LOOP, ORT_CYCLE, or ORT_OSCILLATE.
Parameters
enableTRUE to enable ORTs; FALSE to disable.

◆ Save()

CoreExport IOResult Save ( ISave isave)
virtual
Remarks
Implemented by the System.

The default implementation of Save() handles the saving of the out of range types. The plug-in should call this method from its implementation of Save(). The plug-in should call this method before it saves any of its chunks.

The out of range types are saved in these chunks:

CONTROLBASE_CHUNK

INORT_CHUNK

OUTORT_CHUNK
Parameters
isaveThis pointer may be used to call methods to write data to disk. See Class ISave.
Returns
One of the following values:

IO_OK - The result was acceptable - no errors.

IO_ERROR - This is returned if an error occurred.

Reimplemented from ReferenceMaker.

◆ Load()

CoreExport IOResult Load ( ILoad iload)
virtual
Remarks
Implemented by the System.

The default implementation of Load() handles the loading of the out of range types. The plug-in should call this method from its implementation of Load(). The plug-in should call this method before it loads any of its chunks.

The out of range types are saved in these chunks:

CONTROLBASE_CHUNK

INORT_CHUNK

OUTORT_CHUNK
Parameters
iloadThis pointer may be used to call methods to load data from disk. See Class ILoad.
Returns
One of the following values:

IO_OK - The result was acceptable - no errors.

IO_ERROR - This is returned if an error occurred.

Reimplemented from ReferenceMaker.

◆ EnumIKParams()

virtual void EnumIKParams ( IKEnumCallback callback)
inlinevirtual
Remarks
This tells the system how many parameters the controller has. A controller can have as many IK parameters as it wants. An IK parameter corresponds to a degree of freedom in IK. The parameter is a floating point scalar value. For example a position controller has three degrees of freedom (X, Y, Z) and thus three parameters that IK can vary in its solution. The path controller has only a single parameter (degree of freedom) - the position along the path. The 3ds Max user may set the number of degrees of freedom. For example, a user can specify that a rotation controller cannot rotate about one or more axes. These are then no longer degrees of freedom or IK parameters.

This method is called by the system so the plug-in can specify how many IK parameters it has. It does this by calling the provided callback object proc() method once for each parameter it has. It passes a pointer to itself and the index of the IK parameter. For example a position controller with three degrees of freedom (and thus three IK parameters) would call the callback.proc() three time passing an index of 0, then 1, then 2. See the sample code below.
Parameters
callbackThis callback is provided by the system and should be called by the plug-in once for each IK parameter the plug-in has. See Class IKEnumCallback.
Default Implementation:
{}
Sample Code:
From MAXSDK/samples/controllers/layerctrl.cpp
void LayerControl::EnumIKParams(IKEnumCallback& callback)
{
if (!conts.Count())
return;
assert(active >= 0);
conts[active]->EnumIKParams(callback);
}
Definition: control.h:741
#define assert(expr)
Definition: assert1.h:81
1691 {}

◆ CompDeriv()

virtual BOOL CompDeriv ( TimeValue  t,
Matrix3 ptm,
IKDeriv derivs,
DWORD  flags 
)
inlinevirtual
Remarks
This method is used to determine what effect a change in the parameter has on the end effector. This is the derivative of the end effector with respect to the parameter. What the derivative means in this case is what happens to the end effector if the parameter is changed by some small delta.

The plug-in provides the derivatives to the system calling derivs.DP() and derivs.DR(). It should call derivs.DP() and derivs.DR() in the same order as the callback.proc() was called in the NumIKParams() method implementation.

When the controller computes the derivative it should apply itself to the parent matrix. For example a position controller would compute its derivative based on the parent and the position of the end effector and then apply itself to the parent matrix. If it does apply itself to the parent it should return TRUE. If it does not apply itself it should return FALSE.
Parameters
tSpecifies the time to compute the derivative.
ptmThe parents transformation.
derivsThis class provides methods the plug-in calls to set the derivatives. See Class IKDeriv.
flagsOne of the following values:

POSITION_DERIV
Indicates that derivs.DP() should be called.

ROTATION_DERIV
Indicates that derivs.DR() should be called.
Returns
If a controller isn't participating in IK then it should return FALSE and the client (usually PRS) will apply the controller's value to the parent TM.
Default Implementation:
{return FALSE;}
Sample Code:
The following sample code shows how the quaternion controller has implemented this method. Note that the method loops based on the number of end effectors, and calls derivs.NextDOF() after each iteration.

BOOL QuatCompDeriv(Control *cont,TimeValue t,Matrix3& ptm, IKDeriv& derivs,DWORD flags)
{
Quat q;
Interval valid;
for (int i=0; i<3; i++) {
if (!jp || jp->Active(i)) {
for (int j=0; j<derivs.NumEndEffectors(); j++) {
Point3 r = derivs.EndEffectorPos(j) - ptm.GetRow(3);
if (flags&POSITION_DERIV) {
derivs.DP(CrossProd(ptm.GetRow(i),r),j);
}
if (flags&ROTATION_DERIV) {
derivs.DR(ptm.GetRow(i),j);
}
}
derivs.NextDOF();
}
}
return FALSE;
}
virtual CoreExport void * GetProperty(ULONG id)
Definition: control.h:1054
Definition: control.h:761
virtual Point3 EndEffectorPos(int index)=0
virtual void DR(Point3 dr, int index)=0
virtual void DP(Point3 dp, int index)=0
virtual void NextDOF()=0
virtual int NumEndEffectors()=0
Definition: interpik.h:138
BOOL Active(int i)
Definition: interpik.h:222
Point3 GetRow(int i) const
#define ROTATION_DERIV
Definition: control.h:807
#define POSITION_DERIV
Definition: control.h:806
constexpr DPoint3 CrossProd(const DPoint3 &a, const DPoint3 &b)
Definition: dpoint3.h:280
#define PROPID_JOINTPARAMS
Definition: interpik.h:30
BOOL QuatCompDeriv(Control *cont, TimeValue t, Matrix3 &ptm, IKDeriv &derivs, DWORD flags)
1749 {return FALSE;}

◆ IncIKParam()

virtual float IncIKParam ( TimeValue  t,
int  index,
float  delta 
)
inlinevirtual
Remarks
When the system has computed a change in the parameter it will call this method. The controller should increment the specified parameter by the specified delta. The controller can increment the parameter less than this delta if it needs to. This could be for several reasons:

1. Its parameter may be constrained to lie within a specific interval. It would not want to add a delta that took the parameter outside of this interval.

2. It was asked to calculate a constant partial derivative for a linkage that could be non-linear. Therefore the derivative may have only been an instantaneous approximation. Due to the locality of the IK solution, the controller might not want to allow a delta that was too large.

After the controller has applied the delta, it needs to indicate to the system how much of the delta was used.
Parameters
tThe time of the increment.
indexSpecifies the IK parameter to increment.
deltaThe delta to apply to the parameter. The controller can increment the parameter less than this delta if it needs to in order to accommodate a limit it has. This methods returns the amount that was actually incremented.
Returns
The amount the parameter was actually incremented. This allows the IK solver to know the value was not incremented the full amount.
Default Implementation:
{return 0.0f;}
Sample Code:
float QuatIncIKParam(Control *cont,TimeValue t,int index,float delta)
{
if ((float)fabs(delta)>MAX_IKROT) delta = MAX_IKROT * SGN(delta);
if (jp) {
float v=0.0f;
if (jp->Limited(index)) {
Quat q;
Interval valid;
cont->GetValue(t,&q,valid,CTRL_ABSOLUTE);
v = GetRotation(q,index);
}
delta = jp->ConstrainInc(index,v,delta);
}
Point3 a(0,0,0);
a[index] = 1.0f;
AngAxis aa(a,-delta);
cont->SetValue(t,&aa,FALSE,CTRL_RELATIVE);
return delta;
}
static float GetRotation(Quat& q,int axis)
{
Matrix3 tm;
q.MakeMatrix(tm);
MRow* t = tm.GetAddr();
int n = (axis+1)%3, nn = (axis+2)%3;
if (fabs(t[n][axis]) < fabs(t[nn][axis])) {
return (float)atan2(t[n][nn],t[n][n]);
}
else {
return -(float)atan2(t[nn][n],t[nn][nn]);
}
}
Definition: quat.h:40
virtual void SetValue(TimeValue t, void *val, int commit=1, GetSetMethod method=CTRL_ABSOLUTE)=0
BOOL Limited(int i)
Definition: interpik.h:232
CoreExport float ConstrainInc(int index, float v, float delta)
MRow * GetAddr()
void MakeMatrix(Matrix3 &mat, bool flag=false) const
@ CTRL_RELATIVE
Definition: control.h:1006
@ CTRL_ABSOLUTE
Definition: control.h:1006
float QuatIncIKParam(Control *cont, TimeValue t, int index, float delta)
float MRow[3]
Definition: matrix3.h:39
1812 {return 0.0f;}

◆ ClearIKParam()

virtual void ClearIKParam ( Interval  iv,
int  index 
)
inlinevirtual
Remarks
This method is called to have the controller delete its keys. If the user has the 'Clear Keys' check box checked when they press the 'Apply IK' button, this method is called to have the controller deletes keys in the given interval for the specified degree of freedom.
Parameters
ivThe interval over which the keys should be deleted.
indexSpecified the degree of freedom (parameter) that the keys should be deleted for.
Default Implementation:
{return;}
1821 {return;}

◆ InitIKJoints()

virtual void InitIKJoints ( InitJointData posData,
InitJointData rotData 
)
inlinevirtual
Remarks
This is an optional method that can be implemented by controllers that support IK to initialize their joint parameters based on data loaded from 3D Studio R4/ DOS files.
Parameters
posDataThe position data from the 3DS file. See Class InitJointData.
rotDataThe rotation data from the 3DS file.
Default Implementation:
{}
1830 {}

◆ GetIKJoints()

virtual BOOL GetIKJoints ( InitJointData posData,
InitJointData rotData 
)
inlinevirtual
Remarks
This method retrieves the IK joint parameter data from the UI.
Parameters
posDataPoints to the object to hold the position data. See Class InitJointData.
rotDataPoints to the object to hold the rotation data.
Returns
TRUE if the data was retrieved; otherwise FALSE.
Default Implementation:
{return FALSE;}
1837 {return FALSE;}

◆ GetDOFParams()

virtual BOOL GetDOFParams ( TimeValue  t,
Matrix3 ptm,
DOFParams dofs,
BOOL  nodeSel 
)
inlinevirtual
Remarks
The new IK system has some axes gizmos which show the degrees of freedom, etc. This method is called by the system.
Parameters
tThe current time.
ptmThe parent matrix.
dofsThis is the structure to be filled in. See Class DOFParams.
nodeSelTRUE if the node is currently selected; otherwise FALSE.
Returns
TRUE if the method is implemented; FALSE otherwise.
Default Implementation:
{return FALSE;}
1847 {return FALSE;}

◆ CreateLockKey()

virtual BOOL CreateLockKey ( TimeValue  t,
int  which 
)
inlinevirtual
Remarks
This method is called to create a locking key. This is a key that looks back to the previous key and creates a new key at the specified time which matches the previous key in value. It also adjusts the parameters for the key such that the value stays constant from the previous key to this key. For instance, the TCB controller will set the previous and new continuity to 0. The Bezier controller sets the out tangent type of the previous key to linear and the in tangent type of the new key to linear.
Parameters
tThe time to create the key.
whichSpecifies which type of key to create: 0 for position, 1 for rotation.
Returns
TRUE if the method is implemented; FALSE otherwise.
Default Implementation:
{return FALSE;}
1860 {return FALSE;}

◆ MirrorIKConstraints()

virtual void MirrorIKConstraints ( int  axis,
int  which,
BOOL  pasteMirror = FALSE 
)
inlinevirtual
Remarks
This method is called to mirror the specified IK constraints about the specified axis. When IK constraints are mirrored they need to be updated to reflect the new orientation. For instance, if you set the constraints for a left arm to bend only +90 degrees along one axis and then copied these to a right arm the joint would bend backwards. What you need to do is provides the appropriate compensation so the orientation is kept proper.
Parameters
axisSpecifies the axis of reflection: 0 for X, 1 for Y, 2 for Z.
whichSpecifies which type of constraints are being mirrored: 0 for position, 1 for rotation.
pasteMirrorTRUE if the mirror is being done as part of a paste operation; otherwise FALSE (for example if the mirror was being done with the mirror tool).
Returns
TRUE if the method is implemented; FALSE otherwise.
Default Implementation:
{}
1876 {}

◆ TerminateIK()

virtual BOOL TerminateIK ( )
inlinevirtual
Remarks
User can specify a node as a terminator. This method gives the associated controller the chance to specify that it's terminated.
Returns
TRUE if the method is implemented; FALSE otherwise.
Default Implementation:
{return FALSE;}
1882 {return FALSE;} // controllers can act as terminators.

◆ InitIKJoints2()

virtual void InitIKJoints2 ( InitJointData2 posData,
InitJointData2 rotData 
)
inlinevirtual
Remarks
This is an optional method that can be implemented by controllers that support IK to initialize their joint parameters based on data loaded from 3D Studio R4/ DOS files.
Parameters
posDataThe position data from the 3DS file. See Class InitJointData2.
rotDataThe rotation data from the 3DS file.
Default Implementation:
{}
1892 {}

◆ GetIKJoints2()

virtual BOOL GetIKJoints2 ( InitJointData2 posData,
InitJointData2 rotData 
)
inlinevirtual
Remarks
This method retrieves the IK joint parameter data from the UI.
Parameters
posDataPoints to the object to hold the position data. See Class InitJointData2.
rotDataPoints to the object to hold the rotation data.
Returns
TRUE if the data was retrieved; otherwise FALSE.
Default Implementation:
{return FALSE;}
1899 {return FALSE;}

◆ NodeIKParamsChanged()

virtual void NodeIKParamsChanged ( )
inlinevirtual
Remarks
This method is called on a transform controller when one of the node level IK parameters has been changed.
Default Implementation:
{}
Remarks
This method is called on a transform controller when one of the node level IK parameters has been changed
Default Implementation:
{}
1910 {}

◆ TMInvalidated()

virtual void TMInvalidated ( )
inlinevirtual
Remarks
This method is called in a transform controller when a node invalidates its TM cache
Default Implementation:
{}
1918 {}

◆ OKToBindToNode()

virtual BOOL OKToBindToNode ( INode node)
inlinevirtual
Remarks
This method lets a TM controller determine if it's OK to IK bind to a particular node.
Parameters
nodePoints to the node to check.
Returns
TRUE if it's okay to bind; FALSE if it's not.
Default Implementation:
{return TRUE;}
1927 {return TRUE;}

◆ CanCopyIKParams()

virtual BOOL CanCopyIKParams ( int  which)
inlinevirtual
Remarks
This method returns TRUE if the controller has IK parameters it can copy and FALSE otherwise.
Parameters
whichOne of the following values:

COPYPASTE_IKPOS
COPYPASTE_IKROT
Returns
TRUE if the controller can copy the specified IK parameters; otherwise FALSE.
Default Implementation:
{return FALSE;}
1941 {return FALSE;}

◆ CopyIKParams()

virtual IKClipObject* CopyIKParams ( int  which)
inlinevirtual
Remarks
This method is called to have the controller copy the specified IK parameters to an IKClipObject and return a pointer to it. The plug-in should derive a class from the IKClipObject, put its data in the class, and return a new instance of it. See Class IKClipObject.
Parameters
whichOne of the following values:

COPYPASTE_IKPOS
COPYPASTE_IKROT
Default Implementation:
{return NULL;}
1952 {return NULL;}

◆ CanPasteIKParams()

virtual BOOL CanPasteIKParams ( IKClipObject co,
int  which 
)
inlinevirtual
Remarks
Returns TRUE if the controller can paste the specified IK parameters; otherwise FALSE.
Parameters
coA pointer to the current IKClipObject in the clipboard. This class identifies the creator of the clip object. See Class IKClipObject. The plug-in should look at the IDs in the IKClipObject to make sure it matches this controller. If it does not, the plug-in should return FALSE.
whichOne of the following values:

COPYPASTE_IKPOS
COPYPASTE_IKROT
Returns
TRUE if the controller can paste the specified IK parameters; otherwise FALSE.
Default Implementation:
{return FALSE;}
1966 {return FALSE;}

◆ PasteIKParams()

virtual void PasteIKParams ( IKClipObject co,
int  which 
)
inlinevirtual
Remarks
This method is called to have the controller paste the specified IK parameters from the specified IKClipObject to itself.
Parameters
coA pointer to an IKClipObject. See Class IKClipObject.
whichOne of the following values:

COPYPASTE_IKPOS
COPYPASTE_IKROT
Default Implementation:
{}
1975 {}

◆ PinNodeChanged()

virtual RefResult PinNodeChanged ( RefMessage  message,
const Interval changeInt,
PartID partID 
)
inlinevirtual
Remarks
If a node is pinned to another node, and the node gets a NotifyRefChanged() message that its pinned node has changed, then this method is called on the transform controller of the node. Otherwise the controller wouldn't get notified since the controller doesn't have a reference to the pin node (but the node does). Most controllers don't really care, but the IK controller does.
Parameters
messageThe message that was sent.
changeIntThis is the interval of time over which the message is active. Currently, all controllers will receive FOREVER for this interval.
partIDThis contains information specific to the message passed in. Some messages don't use the partID at all. See Reference Messages and PartID for more information.
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.
Default Implementation:
{return REF_SUCCEED;}
2000 {return REF_SUCCEED;}

◆ CanApplyEaseMultCurves()

virtual BOOL CanApplyEaseMultCurves ( )
inlinevirtual
Remarks
This method determines if a controller may have ease or multiplier curves applied to it. This method defaults to returning TRUE, but can be implemented to return FALSE by a controller that does not wish to let ease or multiplier curves be applied to it.
Returns
TRUE to allow the application of ease and multiplier curves; otherwise FALSE.
Default Implementation:
{return TRUE;}

Reimplemented in LockableControl, and LockableStdControl.

2014 {return TRUE;}

◆ ApplyEase()

CoreExport TimeValue ApplyEase ( TimeValue  t,
Interval valid 
)
Remarks
Implemented by the System.

The controller calls this method to pipe the TimeValue passed through the ease curve to get the modified TimeValue.
Parameters
tThe time to have modified by the ease curve.
validThe interval into which the validity of the evaluated parameters is intersected.
Returns
The modified TimeValue.

◆ AppendEaseCurve()

CoreExport void AppendEaseCurve ( Control cont)
Remarks
Implemented by the System.

Adds an ease curve to the specified controller.
Parameters
contThe controller that the ease curve will be applied to.

◆ DeleteEaseCurve()

CoreExport void DeleteEaseCurve ( int  i)
Remarks
Implemented by the System.

Deletes the 'i-th' ease curve from the controller.
Parameters
iThe index of the ease curve to delete.

◆ GetEaseCurve()

CoreExport Control* GetEaseCurve ( int  i)
Remarks
Implemented by the System.

Returns the 'i-th' ease curve.
Parameters:
int i

The index of the ease curve to return.

◆ NumEaseCurves()

CoreExport int NumEaseCurves ( )
Remarks
Implemented by the System.

Returns the number of ease curves applied to the controller.

◆ GetMultVal()

CoreExport float GetMultVal ( TimeValue  t,
Interval valid 
)
Remarks
Implemented by the System.

Retrieves a floating point value that is the product of all the multiplier curves at the specified time.
Parameters
tThe time to retrieve the value.
validThe interval into which the validity of the evaluated parameters is intersected.
Returns
The product of all the multiplier curves applied to the controller.

◆ AppendMultCurve()

CoreExport void AppendMultCurve ( Control cont)
Remarks
Implemented by the System.

Adds a multiplier curve to the specified controller.
Parameters
contThe controller to have the multiplier curve added.

◆ DeleteMultCurve()

CoreExport void DeleteMultCurve ( int  i)
Remarks
Implemented by the System.

Deletes the 'i-th' multiplier curve from this controller.
Parameters
iThe index of the curve to delete.

◆ GetMultCurve()

CoreExport Control* GetMultCurve ( int  i)
Remarks
Implemented by the System.

Returns the 'i-th' mult curve.
Parameters:
int i

The index of the mult curve to return.

◆ NumMultCurves()

CoreExport int NumMultCurves ( )
Remarks
Implemented by the System.

Returns the number of multiplier curves assigned to the controller.

◆ NumRefs()

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.

Returns
The total number of references this plugin can hold. The default implementation is return 0.

Reimplemented from ReferenceMaker.

◆ GetReference()

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.

Parameters
i- The index of the reference to retrieve. Valid values are from 0 to NumRefs()-1.
Returns
The reference handle of the 'i-th' reference. Note that different calls to this method with the same 'i' value can result in different reference handles being retrieved, as the plugin changes the scene objects it references as its 'i-th' reference.

Reimplemented from ReferenceMaker.

◆ SetReference()

virtual CoreExport void SetReference ( int  i,
RefTargetHandle  rtarg 
)
protectedvirtual

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().

Parameters
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.

◆ NumSubs()

CoreExport int NumSubs ( )
virtual
Remarks
The system uses a virtual array mechanism to access the sub-anims of a plug-in. This method returns the total number of sub-anims maintained by the plug-in. If a plug-in is using a parameter block to manage its parameters it should just return 1 for all the parameters directed by the parameter block.
Returns
The number of sub-anims used by the plug-in.
Default Implementation:
{ return 0; }

Reimplemented from Animatable.

◆ SubAnim()

CoreExport Animatable* SubAnim ( int  i)
virtual
Remarks
This method returns a pointer to the 'i-th' sub-anim. If a plug-in is using a parameter block to manage all its parameters it should just return a pointer to the parameter block itself from this method. This method may return NULL so developers need to check the return value before calling other sub anim methods (such as SubAnimName()).
Parameters
iThis is the index of the sub-anim to return.
Default Implementation:
{ return NULL };

Reimplemented from Animatable.

◆ SubAnimName()

CoreExport MSTR SubAnimName ( int  i,
bool  localized = true 
)
overridevirtual
Remarks
This method returns the name of the 'i-th' sub-anim to appear in track view. The system has no idea what name to assign to the sub-anim (it only knows it by the virtual array index), so this method is called to retrieve the name to display. Developer need to make sure the 'i-th' SubAnim() is non-NULL or this method will fail.
Parameters
iThe index of the parameter name to return
localizedIf true, then the sub-anim name returned should be localized in the language 3ds Max is currently using. Otherwise it should be the sub-anim name in English. If a plugin does not provide localized string resources, it can disregard this parameter and always return the sub-anim name in English.
Returns
The name of the 'i-th' parameter.

Reimplemented from Animatable.

◆ GetInterface() [1/3]

CoreExport void* GetInterface ( ULONG  id)
virtual

Inherited from Animatable.

Returns a pointer to the interface.

Parameters
id- The id of the interface.
Returns
A Pointer to the Interface

Reimplemented from ReferenceTarget.

Reimplemented in LockableControl, and LockableStdControl.

◆ PaintFCurves()

CoreExport int PaintFCurves ( ParamDimensionBase dim,
HDC  hdc,
Rect rcGraph,
Rect rcPaint,
float  tzoom,
int  tscroll,
float  vzoom,
int  vscroll,
DWORD  flags 
)
virtual
Remarks
This method is called to draw the function curve of the anim.
Parameters
dimThe parameter dimension. See Class ParamDimensionBase.
hdcThe handle of the device context.
rcGraphThe entire rectangle of the inside of the graph region.
rcPaintThis is the rectangular region that needs to be repainted - the invalid region.
tzoomThe time zoom factor.
tscrollThe time scroll factor.
vzoomThe value zoom factor.
vscrollThe value scroll factor.
flagsOne or more of the following values which are filters for controllers with more than one curve:

PAINTCURVE_SHOWTANGENTS
Show the curve tangent handles.

PAINTCURVE_FROZEN
Show the curve in a frozen state. DISPLAY_XCURVE
DISPLAY_YCURVE
DISPLAY_ZCURVE
PAINTCURVE_GENCOLOR
Draw the curve in its standard color.

The following options are passed to float controllers indicating a sugested color for drawing:

PAINTCURVE_XCOLOR
Draw the curve in red.

PAINTCURVE_YCOLOR
Draw the curve in green.

PAINTCURVE_ZCOLOR
Draw the curve in blue.
Note
RGB controllers interpret X as red, Y as green and Z as blue.
Returns
A plug-in should always return 0.
Default Implementation:
{ return 0; }

Reimplemented from Animatable.

◆ GetFCurveExtents()

CoreExport int GetFCurveExtents ( ParamDimensionBase dim,
float &  min,
float &  max,
DWORD  flags 
)
virtual

This method is called to calculate the largest and smallest values of the anim.

The values max and min should be initialized before calling this function. A plugin implementing this function should not reset the values passed - in this way if max is passed with a larger value than the curve extents calculated for the current anim, the value of max will be unchanged.

Parameters
dim- The dimension of the anim.
[out]min- The smallest value. These are in the units given by the dimension. For example, if it was an angle parameter that was displayed in degrees, the units returned through min should be in degrees as well. A class should implement this method to not reset this value
[out]max- The largest value. These are in the units given by the dimension. For example, if it was an angle parameter that was displayed in degrees, the units returned through max should be in degrees as well.
flags- One or more of the following values which are filters for controllers with more than one curve:

DISPLAY_XCURVE
DISPLAY_YCURVE
DISPLAY_ZCURVE
Note
RGB controllers interpret X as red, Y as green and Z as blue.
Returns
If this method is processed, return nonzero; otherwise zero.

Reimplemented from Animatable.

◆ BaseClone()

virtual CoreExport void BaseClone ( ReferenceTarget from,
ReferenceTarget to,
RemapDir remap 
)
virtual
Remarks
Introduced an implementation in this the base class.

Reimplemented from ReferenceTarget.

◆ PostCloneNode()

virtual void PostCloneNode ( )
inlinevirtual
Remarks
This method is called on a transform controller after a node is cloned and the clone process has finished. This allows the controller to do any work it needs to after the clone is complete.
Default Implementation:
{}
2110 {}

◆ PreventNodeDeletion()

virtual BOOL PreventNodeDeletion ( )
inlinevirtual
Remarks
This method is called on TM controllers so that system driven controllers can prevent the Interface::DeleteNode() API from deleting them. Note that DeleteNode()has an optional parameter to override this so driver controllers can easily delete driven nodes if they want to.
Returns
TRUE to prevent deletion; FALSE to allow it.
Default Implementation:
{return FALSE;}
2122 {return FALSE;}

◆ EvalVisibility()

virtual CoreExport float EvalVisibility ( TimeValue  t,
View view,
Box3  pbox,
Interval valid 
)
virtual
Remarks
The Level of Detail utility lets you construct an object that alters its geometric complexity (or level of detail) based on its size in the rendered image. You do this by creating several versions of the same object – each with different levels of detail, grouping them as one, and then assigning the Level of Detail utility, which automatically creates a special LOD controller as a Visibility track. The LOD controller then hides and unhides the various objects in the group, depending on their size in the rendered scene.

This method is called on visibility float controllers with view related parameters. This is used by the Level of Detail controller to allow view dependent visibility.
Parameters
tThe time at which to evaluate.
viewThis class contains information about the view being rendered. This includes information such as the image width and height, the projection type, and matrices to convert between world to view and world to camera. See Class View.
pboxThe bounding box of the node that's being evaluated.
validThis interval should be updated to reflect the validity of the visibility controller. The interval into which the validity of the evaluated parameters is intersected.
Returns
The visibility of the object at the specified time.
Default Implementation:
The default implementation will simply call GetValue().

◆ VisibleInViewports()

virtual BOOL VisibleInViewports ( )
inlinevirtual
Remarks
This method is called on visibility controllers. This gives them the option to completely hide an object in the viewports.
Returns
TRUE if the object is visible in the viewport; FALSE if invisible.
Default Implementation:
{return TRUE;}
2157 {return TRUE;}

◆ CanInstanceController()

virtual BOOL CanInstanceController ( )
inlinevirtual
Remarks
Called on transform controllers or visibility controllers when a node is cloned and the user has chosen to instance
Returns

Default Implementation:
{return TRUE;}
2165 {return TRUE;}

◆ CloneControl()

CoreExport void CloneControl ( Control ctrl,
RemapDir remap 
)
Remarks
This method is implemented by the System. It should be called by any leaf controller's Clone() method so that ease and multiplier curves are cloned.
Parameters
ctrlPoints to the cloned controller (the new one).
remapThe RemapDir passed to this controller's Clone() method.
Sample Code:
{
ExprControl *ctrl = new ExprControl(this->type, *this);
CloneControl(ctrl,remap);
return ctrl;
}
CoreExport void CloneControl(Control *ctrl, RemapDir &remap)
A scene entity that is being owned and listened to by other scene entities.
Definition: ref.h:1844
virtual CoreExport RefTargetHandle Clone(RemapDir &remap)
This method is used by 3ds Max to clone an object.
For remapping references during a Clone.
Definition: ref.h:830

◆ Display()

virtual int Display ( TimeValue  t,
INode inode,
ViewExp vpt,
int  flags 
)
inlinevirtual
Remarks
This is called by the system to have the controller display its gizmo. When a controller is being edited in the Motion branch, this method is called to allow it to display any apparatus it may have in the scene. Note that Display() is only called on Transform Controllers. It is not called only any sub-controllers, for example it wouldn't be called on the position controller of a PRS transform controller.

In R4 and higher however the display method WILL be called on Position, Rotation and scale controllers as well.
Parameters
tThe time to display the object.
inodeThe node to display.
vptAn interface pointer that exposes methods the plug-in may call related to the viewports.
flagsSee Display Flags.
Returns
Nonzero if the item was displayed; otherwise 0. Default return value is -1, indicates this controller doesn't have display function.
Default Implementation:
{ return 0; }
2210 { return -1; };

◆ HitTest()

virtual int HitTest ( TimeValue  t,
INode inode,
int  type,
int  crossing,
int  flags,
IPoint2 p,
ViewExp vpt 
)
inlinevirtual
Remarks
This method is called to determine if the specified screen point intersects the controller gizmo. The method returns nonzero if the gizmo was hit; otherwise 0.
Parameters
tThe time to perform the hit test.
inodeA pointer to the node whose gizmo should be tested.
typeThe type of hit testing to perform. See Scene and Node Hit Test Types. for details.
crossingThe state of the crossing setting. If TRUE crossing selection is on.
flagsThe hit test flags. See Scene and Node Hit Testing Flags for details.
pThe screen point to test.
vptAn interface pointer that may be used to call methods associated with the viewports.
Returns
Nonzero if the controller gizmo was hit; otherwise 0.
Default Implementation:
{ return 0; }
2224 { return 0; }

◆ GetWorldBoundBox()

virtual void GetWorldBoundBox ( TimeValue  t,
INode inode,
ViewExp vpt,
Box3 box 
)
inlinevirtual
Remarks
This is the world space bounding box of the controllers gizmo.
Parameters
tThe time to retrieve the bounding box.
inodeThe node to calculate the bounding box for.
vptAn interface pointer that exposes portions of View3D that are exported for use by plug-ins.
boxThe returned bounding box.
Default Implementation:
{}
2234 {}

◆ ActivateSubobjSel()

virtual void ActivateSubobjSel ( int  level,
XFormModes modes 
)
inlinevirtual
Remarks
When the user changes the selection of the sub-object drop down, this method is called to notify the plug-in. This method should provide instances of a class derived from CommandMode to support move, rotate, non-uniform scale, uniform scale, and squash modes. These modes replace their object mode counterparts however the user still uses the move/rotate/scale tool buttons in the toolbar to activate them. If a certain level of sub-object selection does not support one or more of the modes NULL may be passed. If NULL is specified the corresponding toolbar button will be grayed out.
Parameters
levelThe sub-object selection level the command modes should be set to support. A level of 0 indicates object level selection. If level is greater than or equal to 1 the index refers to the types registered by the object in the order they appeared in the list when registered by Interface::RegisterSubObjectTypes(). See Class Interface.
modesThe command modes to support. See Class XFormModes.
Default Implementation:
{}
2253 {}

◆ SelectSubComponent()

virtual void SelectSubComponent ( CtrlHitRecord hitRec,
BOOL  selected,
BOOL  all,
BOOL  invert = FALSE 
)
inlinevirtual
Remarks
This method is called to change the selection state of the component identified by hitRec.
Parameters
hitRecIdentifies the component whose selected state should be modified. See Class CtrlHitRecord.
selectedTRUE if the item should be selected; FALSE if the item should be de-selected.
allTRUE if the entire object should be selected; FALSE if only the portion of the identified by hitRec.
invertThis is set to TRUE when all is also set to TRUE and the user is holding down the Shift key while region selecting in select mode. This indicates the items hit in the region should have their selection state inverted.
Default Implementation:
{}
2268 {}

◆ ClearSelection()

virtual void ClearSelection ( int  selLevel)
inlinevirtual
Remarks
This method is called to clear the selection for the given sub-object level. All sub-object elements of this type should be deselected.
Parameters
selLevelSpecifies the selection level to clear.
Default Implementation:
{}
2274 {}

◆ SubObjectIndex()

virtual int SubObjectIndex ( CtrlHitRecord hitRec)
inlinevirtual
Remarks
Implemented by the System.

Returns the index of the sub-object element identified by the CtrlHitRecord hitRec. The sub-object index identifies a sub-object component. The relationship between the index and the component is established by the controller. For example a controller may allow the user to select a group of footprints and these groups may be identified as group 0, group 1, group 2, etc. Given a hit record that identifies a footstep, the controller's implementation of this method would return the group index that the footprint belonged to.
Parameters
hitRecIdentifies the component whose index should be returned. See Class CtrlHitRecord.
Returns
The index of the sub-object element.
Default Implementation:
{return 0;}
2288 {return 0;}

◆ SelectAll()

virtual void SelectAll ( int  selLevel)
inlinevirtual
Remarks
This method is called to select every element of the given sub-object level. This will be called when the user chooses Select All from the 3ds Max Edit menu.
Parameters
selLevelSpecifies the selection level to select.
Default Implementation:
{}
2295 {}

◆ InvertSelection()

virtual void InvertSelection ( int  selLevel)
inlinevirtual
Remarks
This method is called to invert the specified sub-object level. If the element is selected it should be deselected. If it's deselected it should be selected. This will be called when the user chooses Select Invert from the 3ds Max Edit menu.
Parameters
selLevelSpecifies the selection level to invert.
Default Implementation:
{}
2303 {}

◆ GetSubObjectCenters()

virtual void GetSubObjectCenters ( SubObjAxisCallback cb,
TimeValue  t,
INode node 
)
inlinevirtual
Remarks
When the user is in a sub-object selection level, the system needs to get the reference coordinate system definition from the current controller being edited so that it can display the axes. This method specifies the position of the center. The plug-in enumerates its centers and calls the callback cb once for each. See Sub-Object Coordinate Systems.
Parameters
cbThe callback object whose methods may be called. See Class SubObjAxisCallback.
tThe time to enumerate the centers.
nodeA pointer to the node.
Default Implementation:
{}
2323 {}

◆ GetSubObjectTMs()

virtual void GetSubObjectTMs ( SubObjAxisCallback cb,
TimeValue  t,
INode node 
)
inlinevirtual
Remarks
When the user is in a sub-object selection level, the system needs to get the reference coordinate system definition from the current controller being edited so that it can display the axes. This method returns the axis system of the reference coordinate system. The plug-in enumerates its TMs and calls the callback cb once for each. See Sub-Object Coordinate Systems.
Parameters
cbThe callback object whose methods may be called. See Class SubObjAxisCallback.
tThe time to enumerate the TMs.
nodeA pointer to the node.
Default Implementation:
{}

2336 {}

◆ SubMove()

virtual void SubMove ( TimeValue  t,
Matrix3 partm,
Matrix3 tmAxis,
Point3 val,
BOOL  localOrigin = FALSE 
)
inlinevirtual
Remarks
When this method is called the plug-in should respond by moving its selected sub-object components.
Parameters
tThe time of the transformation.
partmThe 'parent' transformation matrix. This matrix represents a transformation that would take points in the controller's space and convert them into world space points.
tmAxisThe matrix that represents the axis system. This is the space in which the transformation is taking place.
valThis value is a vector with X, Y, and Z representing the movement along each axis.
localOriginWhen TRUE the transformation is occurring about the sub-object's local origin.
Default Implementation:
{}
2353 {}

◆ SubRotate()

virtual void SubRotate ( TimeValue  t,
Matrix3 partm,
Matrix3 tmAxis,
Quat val,
BOOL  localOrigin = FALSE 
)
inlinevirtual
Remarks
When this method is called the plug-in should respond by rotating its selected sub-object components.
Parameters:
TimeValue t

The time of the transformation.

Matrix3& partm

The 'parent' transformation matrix. This matrix represents a transformation that would take points in the controller's space and convert them into world space points.

Matrix3& tmAxis

The matrix that represents the axis system. This is the space in which the transformation is taking place.

Quat& val

The amount to rotate the selected components.

BOOL localOrigin=FALSE

When TRUE the transformation is occurring about the sub-object's local origin. Note: This information may be passed onto a transform controller (if there is one) so they may avoid generating 0 valued position keys for rotation and scales. For example if the user is rotating an item about anything other than its local origin then it will have to translate in addition to rotating to achieve the result. If a user creates an object, turns on the animate button, and rotates the object about the world origin, and then plays back the animation, the object does not do what the was done interactively. The object ends up in the same position, but it does so by both moving and rotating. Therefore both a position and a rotation key are created. If the user performs a rotation about the local origin however there is no need to create a position key since the object didn't move (it only rotated). So a transform controller can use this information to avoid generating 0 valued position keys for rotation and scales.
2384 {}

◆ SubScale()

virtual void SubScale ( TimeValue  t,
Matrix3 partm,
Matrix3 tmAxis,
Point3 val,
BOOL  localOrigin = FALSE 
)
inlinevirtual
Remarks
When this method is called the plug-in should respond by scaling its selected sub-object components.
Parameters
tThe time of the transformation.
partmThe 'parent' transformation matrix. This matrix represents a transformation that would take points in the modifier's space and convert them into world space points.
tmAxisThe matrix that represents the axis system. This is the space in which the transformation is taking place.
valThis value is a vector with X, Y, and Z representing the scale along X, Y, and Z respectively.
localOriginWhen TRUE the transformation is occurring about the sub-object's local origin. See the note above in the Rotate method.
2397 {}

◆ RescaleTime()

virtual BOOL RescaleTime ( Interval  oseg,
Interval  nseg 
)
inlinevirtual
Remarks
This method is called when the user rescales time in the time configuration dialog. If FALSE is returned from this method then Animatable::MapKeys() will be used to perform the scaling. Controllers can override this method to handle things like rescaling tangents that MapKeys() won't affect and return TRUE if they don't want MapKeys() to be called.
Parameters
osegThe old time segment.
nsegThe new time segment.
Default Implementation:
{return FALSE;}
2413 {return FALSE;}

◆ GetDrawPixelStep()

virtual int GetDrawPixelStep ( )
inlinevirtual
Remarks
Prior to R4 TrackView was using static defines to determines the number samples/pixel it used to draw and compute curve extents. Now a controller can override these defaults by implementing GetDrawPixelStep() and GetExtentTimeStep().

This method allows a control to get sampled at a different rate than what trackview does by default so the controller can speed up redraws. It returns the pixel sample rate for when the curve is drawn.
Default Implementation:
{return 5;}
2427 {return 5;}

◆ GetExtentTimeStep()

virtual int GetExtentTimeStep ( )
inlinevirtual
Remarks
Prior to R4 TrackView was using static defines to determines the number samples/pixel it used to draw and compute curve extents. Now a controller can override these defaults by implementing GetDrawPixelStep() and GetExtentTimeStep().

This method returns the ticks sample rate used when the curve is checked for its Y extents.
Default Implementation:
{return 40;}
2437 {return 40;}

◆ SvTraverseAnimGraph()

virtual CoreExport SvGraphNodeReference SvTraverseAnimGraph ( IGraphObjectManager gom,
Animatable owner,
int  id,
DWORD  flags 
)
virtual
Remarks
This method is available in release 3.0 and later only.

This method traverses the graph of objects in the 3ds Max scene, adding desired objects to the schematic view. Developers can specialize this behaviour by overriding this method and adding whatever objects are interesting to the schematic view. Objects are added to the schematic view by calling IGraphObjectManager::AddAnimatable(...). Reference lines are added to the schematic view by calling IGraphObjectManager::AddReference(...). Implementers of this method should call it recursively to process other objects in the scene.

See Class IGraphObjectManager.
Parameters
gomPoints to the schematic view window manager.
ownerThe owning animatable.
idThis is usually the sub-anim number (but can actually be any value the developer chooses).
flagsSee Flags for AddAnimatable() and SvTravereseAnimGraph().
Returns
A SvGraphNodeReference object.

Reimplemented from Animatable.

◆ SvGetName()

virtual CoreExport MSTR SvGetName ( IGraphObjectManager gom,
IGraphNode gNode,
bool  isBeingEdited 
)
virtual
Remarks
Returns the name of the object as it appears in the schematic view.
Parameters
gomPoints to the schematic view window manager.
gNodePoints to this node in the schematic view.
isBeingEditedTRUE if the item is being edited; FALSE if not.
Default Implementation:
{
Animatable *owner;
int subNum;
MSTR name;
owner = gNode->GetOwner();
subNum = gNode->GetID();
name = owner->SubAnimName(subNum);
return name;
}
Definition: Animatable.h:118
virtual MSTR SubAnimName(int i) MAX_SEALED
Definition: Animatable.h:650
Definition: strclass.h:738

Reimplemented from Animatable.

◆ SvHandleDoubleClick()

virtual CoreExport bool SvHandleDoubleClick ( IGraphObjectManager gom,
IGraphNode gNode 
)
virtual
Remarks
This method is available in release 3.0 and later only.

This method is called when this node is double-clicked in the schematic view.
Parameters
gomPoints to the schematic view window manager.
gNodePoints to the node in the schematic view.
Returns
true is handled; false if not interested in the event.
Default Implementation:
{ return false; }

Reimplemented from Animatable.

◆ SvCanInitiateLink()

virtual CoreExport bool SvCanInitiateLink ( IGraphObjectManager gom,
IGraphNode gNode 
)
virtual
Remarks
Returns true if this animatable can be the initiator of a link operation in the schematic view.
Parameters
gomPoints to the schematic view window manager.
gNodePoints to this node in the schematic view.

Reimplemented from Animatable.

◆ SvCanConcludeLink()

virtual CoreExport bool SvCanConcludeLink ( IGraphObjectManager gom,
IGraphNode gNode,
IGraphNode gNodeChild 
)
virtual
Remarks
Returns true if this animatable can be the receiver (parent) of a link operation in the schematic view.
Parameters
gomPoints to the schematic view window manager.
gNodePoints to this node in the schematic view.
gNodeChildPoints to the child node in the schematic view.
Default Implementation:
{ return false; }

Reimplemented from Animatable.

◆ SvLinkChild()

virtual CoreExport bool SvLinkChild ( IGraphObjectManager gom,
IGraphNode gNodeThis,
IGraphNode gNodeChild 
)
virtual
Remarks
This method is called to link this object to the gNodeChild passed.
Parameters
gomPoints to the schematic view window manager.
gNodeThisPoints to this node in the schematic view.
gNodeChildPoints to the child node in the schematic view.
Returns
true if linked; false if not.
Default Implementation:
{ return false; }

Reimplemented from Animatable.

◆ SvEditProperties()

virtual CoreExport bool SvEditProperties ( IGraphObjectManager gom,
IGraphNode gNode 
)
virtual
Remarks
This method is reserved for future use.
Default Implementation:
{ return false; }

Reimplemented from Animatable.

◆ GetInterface() [2/3]

virtual CoreExport void* GetInterface

Inherited from Animatable.

Returns a pointer to the interface.

Parameters
id- The id of the interface.
Returns
A Pointer to the Interface

◆ GetInterface() [3/3]

virtual CoreExport BaseInterface* GetInterface

Inherited from Animatable.

Returns a pointer to the Base Interface for the interface ID passed.

Parameters
id- The unique ID of the interface to get
Returns
A Pointer to the Interface