This reference page is linked to from the following overview topics: Animation Plug-ins, Lesson 3: the reference system, Lesson 4: Animation Controllers, Incremental Improvements, Plug-in Architecture, Plug-in Base Classes, Node Transformation Matrix, Transform Controller Coordinate Systems, PRS Controllers and Node Transformation Matrices, Light Parameters, Controller API Elements, Keyframe Key Data for the PRS Controller, Keyframe Data Access Classes and Methods, Procedural Controller Data Access, Hit Testing, Schematic View Relationships, IK Concepts, Sub-Object Coordinate Systems, Writing Animation Controller Plug-ins, Serializing Controllers, Control Virtual Methods, CTRL_RELATIVE and CTRL_ABSOLUTE, Undo and Redo in a Controller, Making Controllers Lockable, Ring Array Classes.
#include <control.h>
Public Member Functions |
|
CoreExport | Control () |
virtual | ~Control () |
virtual void | Copy (Control *from)=0 |
virtual void | CommitValue (TimeValue t) |
virtual void | RestoreValue (TimeValue t) |
virtual INode * | GetTarget () |
virtual RefResult | SetTarget (INode *targ) |
virtual Control * | GetPositionController () |
virtual Control * | GetRotationController () |
virtual Control * | GetScaleController () |
virtual BOOL | SetPositionController (Control *c) |
virtual BOOL | SetRotationController (Control *c) |
virtual BOOL | SetScaleController (Control *c) |
virtual Control * | GetXController () |
virtual Control * | GetYController () |
virtual Control * | GetZController () |
virtual Control * | GetWController () |
virtual Control * | GetRollController () |
virtual BOOL | SetRollController (Control *c) |
virtual BOOL | IsColorController () |
virtual DWORD | GetInheritanceFlags () |
virtual BOOL | SetInheritanceFlags (DWORD f, BOOL keepPos) |
virtual BOOL | IsLeaf () |
virtual int | IsKeyable () |
virtual BOOL | IsReplaceable () |
virtual BOOL | ChangeParents (TimeValue t, const Matrix3 &oldP, const Matrix3 &newP, const Matrix3 &tm) |
virtual void | GetValue (TimeValue t, void *val, Interval &valid, GetSetMethod method=CTRL_ABSOLUTE)=0 |
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) |
virtual BOOL | InheritsParentTransform () |
virtual int | GetORT (int type) |
virtual CoreExport void | SetORT (int ort, int type) |
virtual CoreExport void | EnableORTs (BOOL enable) |
CoreExport IOResult | Save (ISave *isave) |
CoreExport IOResult | Load (ILoad *iload) |
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 BOOL | CanCopyIKParams (int which) |
virtual IKClipObject * | CopyIKParams (int which) |
virtual BOOL | CanPasteIKParams (IKClipObject *co, int which) |
virtual void | PasteIKParams (IKClipObject *co, int which) |
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 RefResult | PinNodeChanged (RefMessage message, Interval changeInt, PartID &partID) |
virtual void | NodeIKParamsChanged () |
virtual void | TMInvalidated () |
virtual BOOL | OKToBindToNode (INode *node) |
virtual BOOL | CanApplyEaseMultCurves () |
CoreExport TimeValue | ApplyEase (TimeValue t, Interval &valid) |
CoreExport void | AppendEaseCurve (Control *cont) |
CoreExport void | DeleteEaseCurve (int i) |
CoreExport int | NumEaseCurves () |
CoreExport float | GetMultVal (TimeValue t, Interval &valid) |
CoreExport void | AppendMultCurve (Control *cont) |
CoreExport void | DeleteMultCurve (int i) |
CoreExport int | NumMultCurves () |
CoreExport int | NumRefs () |
Returns the total number of references this
ReferenceMaker can hold. |
|
CoreExport RefTargetHandle | GetReference (int i) |
Returns the 'i-th' reference. |
|
CoreExport int | NumSubs () |
CoreExport Animatable * | SubAnim (int i) |
CoreExport MSTR | SubAnimName (int i) |
CoreExport void * | GetInterface (ULONG id) |
Inherited from Animatable. |
|
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. |
|
virtual CoreExport void | BaseClone (ReferenceTarget *from, ReferenceTarget *to, RemapDir &remap) |
virtual void | PostCloneNode () |
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 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) |
virtual void | GetSubObjectCenters (SubObjAxisCallback *cb, TimeValue t, INode *node) |
virtual void | GetSubObjectTMs (SubObjAxisCallback *cb, TimeValue t, INode *node) |
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
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 BOOL | RescaleTime (Interval oseg, Interval nseg) |
virtual int | GetDrawPixelStep () |
virtual int | GetExtentTimeStep () |
Protected Member Functions |
|
virtual CoreExport void | SetReference (int i, RefTargetHandle rtarg) |
Stores a
ReferenceTarget as its 'i-th' reference`. |
CoreExport Control | ( | ) |
virtual ~Control | ( | ) | [inline, virtual] |
{};
virtual void Copy | ( | Control * | from | ) | [pure virtual] |
from | A pointer to the previous controller. |
virtual void CommitValue | ( | TimeValue | t | ) | [inline, virtual] |
t | Specifies the time to save the value. |
{}
virtual void RestoreValue | ( | TimeValue | t | ) | [inline, virtual] |
t | Specifies the time to restore the value. |
{}
virtual INode* GetTarget | ( | ) | [inline, virtual] |
{ return NULL; }
virtual RefResult SetTarget | ( | INode * | targ | ) | [inline, virtual] |
targ | The target node to store. |
{return REF_SUCCEED;}
virtual Control* GetPositionController | ( | ) | [inline, virtual] |
{return NULL;}
virtual Control* GetRotationController | ( | ) | [inline, virtual] |
{return NULL;}
virtual Control* GetScaleController | ( | ) | [inline, virtual] |
{return NULL;}
virtual BOOL SetPositionController | ( | Control * | c | ) | [inline, virtual] |
{return FALSE;}
virtual BOOL SetRotationController | ( | Control * | c | ) | [inline, virtual] |
{return FALSE;}
virtual BOOL SetScaleController | ( | Control * | c | ) | [inline, virtual] |
{return FALSE;}
virtual Control* GetXController | ( | ) | [inline, virtual] |
{return NULL;}
virtual Control* GetYController | ( | ) | [inline, virtual] |
{return NULL;}
virtual Control* GetZController | ( | ) | [inline, virtual] |
{return NULL;}
virtual Control* GetWController | ( | ) | [inline, virtual] |
{return NULL;}
virtual Control* GetRollController | ( | ) | [inline, virtual] |
{return NULL;}
virtual BOOL SetRollController | ( | Control * | c | ) | [inline, virtual] |
{return FALSE;}
virtual BOOL IsColorController | ( | ) | [inline, virtual] |
{return FALSE;}
virtual DWORD GetInheritanceFlags | ( | ) | [inline, virtual] |
{return INHERIT_ALL;}
virtual BOOL SetInheritanceFlags | ( | DWORD | f, |
BOOL | keepPos | ||
) | [inline, virtual] |
f | The 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 |
keepPos | If TRUE the position of the node should remain the same; otherwise the node may move. |
{return FALSE;} // return TRUE if TM controller supports inheritance
virtual BOOL IsLeaf | ( | ) | [inline, virtual] |
{return TRUE;}
virtual int IsKeyable | ( | ) | [inline, virtual] |
{return 1;}
virtual BOOL IsReplaceable | ( | ) | [inline, virtual] |
Reimplemented in LockableStdControl, and LockableControl.
{return TRUE;}
virtual BOOL ChangeParents | ( | TimeValue | t, |
const Matrix3 & | oldP, | ||
const Matrix3 & | newP, | ||
const Matrix3 & | tm | ||
) | [inline, virtual] |
t | The time of the change. |
oldP | The old parent matrix. |
newP | The new parent matrix. |
tm | The nodes current world transformation. |
INTERP_CONT_TEMPLATE BOOL InterpControl<INTERP_CONT_PARAMS>::ChangeParents(TimeValue t,const Matrix3& oldP,const Matrix3& newP,const Matrix3& tm) { if (SuperClassID()==CTRL_POSITION_CLASS_ID) { HoldTrack(); // Position controllers need their path counter rotated to // account for the new parent. Matrix3 rel = oldP * Inverse(newP); // Modify the controllers current value (the controllers cache) *((Point3*)(&curval)) = *((Point3*)(&curval)) * rel; // Then modify the keys... for (int i=0; i<keys.Count(); i++) { // All this casting keeps the compiler happy // for non-Point3 versions of this template. *((Point3*)(&keys[i].val)) = *((Point3*)(&keys[i].val)) * rel; } keys.KeysChanged(FALSE); ivalid.SetEmpty(); return TRUE; } else { return FALSE; } }
{return FALSE;}
virtual void GetValue | ( | TimeValue | t, |
void * | val, | ||
Interval & | valid, | ||
GetSetMethod | method =
CTRL_ABSOLUTE |
||
) | [pure virtual] |
t | Specifies the time to retrieve the value. |
val | This 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. Below is list of the
possible cases and how the value should be stored in each
case. float If method == CTRL_ABSOLUTE, *val points to a float. The controller should simply store the value. If method == CTRL_RELATIVE, *val points to a float. The controller should add its value to the existing floating point value. Point3 If method == CTRL_ABSOLUTE, *val points to a Point3. The controller should simply store the value. If method == CTRL_RELATIVE, *val points to a Point3. The controller should add its value to the existing Point3 value. Position If method == CTRL_ABSOLUTE, *val points to a Point3. The controller should simply store the value. If 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); Rotation If method == CTRL_ABSOLUTE, *val points to a Quat. The controller should simply store the value. If 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); Scale If method == CTRL_ABSOLUTE, *val points to a ScaleValue. The controller should simply store the value. If 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); Transform (Matrix3) If method == CTRL_ABSOLUTE, *val points to a Matrix3. The controller should simply store the value. Important: 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 useCTRL_ABSOLUTEto get the value. If 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. Important for Matrix3 Controllers: when SetValue() is called *val points to an instance of Class SetXFormPacket. See that class for more details on how it is used. |
valid | The validity interval to update. The controllers validity interval should be intersected with this interval. This updates the interval to reflect the interval of the controller. |
method | One 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. |
void StdControl::GetValue(TimeValue t, void *val, Interval &valid, GetSetMethod method) { Interval range = GetTimeRange(TIMERANGE_ALL); Interval wvalid = FOREVER, cvalid = FOREVER; void *ptr = val; int ort; float m; TimeValue oldTime = t; if (method==CTRL_RELATIVE) { ptr = CreateTempValue(); } // Grab the multiplier before the time warp. m = GetMultVal(t,valid); // Apply the time warp. t = ApplyEase(t,wvalid); if (t<=range.Start()) { ort = GetORT(ORT_BEFORE); } else { ort = GetORT(ORT_AFTER); } if (/startcomment*ort==ORT_CONSTANT*endcomment/TestAFlag(A_ORT_DISABLED) || range.Empty() || range.InInterval(t)) { GetValueLocalTime(t,ptr,cvalid); } else { switch (ort) { case ORT_CONSTANT: if (t<range.Start()) { GetValueLocalTime(range.Start(),ptr,cvalid,CTRL_ABSOLUTE); cvalid.Set(TIME_NegInfinity,range.Start()); } else { GetValueLocalTime(range.End(),ptr,cvalid,CTRL_ABSOLUTE); cvalid.Set(range.End(),TIME_PosInfinity); } break; case ORT_LOOP: case ORT_CYCLE: GetValueLocalTime(CycleTime(range,t),ptr, cvalid,CTRL_ABSOLUTE); break; case ORT_OSCILLATE: { int cycles = NumCycles(range,t); TimeValue tp = CycleTime(range,t); if (cycles&1) { tp = range.End()-(tp-range.Start()); } GetValueLocalTime(tp,ptr,cvalid,CTRL_ABSOLUTE); break; } case ORT_RELATIVE_REPEAT: case ORT_IDENTITY: case ORT_LINEAR: Extrapolate(range,t,ptr,cvalid,ort); break; } } if (m!=1.0f) { MultiplyValue(ptr,m); } if (method==CTRL_RELATIVE) { ApplyValue(val,ptr); DeleteTempValue(ptr); } if (ort!=ORT_CONSTANT) { cvalid.Set(oldTime,oldTime); } valid &= cvalid; valid &= wvalid; // Time warps can cause this to happen. if (valid.Empty()) valid.Set(oldTime,oldTime); }
Implemented in StdControl.
virtual void SetValue | ( | TimeValue | t, |
void * | val, | ||
int | commit = 1 , |
||
GetSetMethod | method =
CTRL_ABSOLUTE |
||
) | [pure virtual] |
t | Specifies the time to save the value. |
val | Points 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. |
commit | When 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. |
method | One 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. |
void StdControl::SetValue(TimeValue t, void *val, int commit, GetSetMethod method) { Interval range = GetTimeRange(TIMERANGE_ALL); Interval wvalid, mvalid; int ort; float m; // Grab the multiplier before the time warp. m = GetMultVal(t,mvalid); if (m!=1.0f && m!=0.0f) { MultiplyValue(val,1.0f/m); } // Apply the time warp. t = ApplyEase(t,wvalid); if (range.Empty()) { SetValueLocalTime(t,val,commit,method); return; } if (t<=range.Start()) { ort = GetORT(ORT_BEFORE); } else { ort = GetORT(ORT_AFTER); } if (TestAFlag(A_ORT_DISABLED)) ort = ORT_CONSTANT; switch (ort) { case ORT_LOOP: case ORT_CYCLE: SetValueLocalTime(CycleTime(range,t),val,commit,method); break; case ORT_OSCILLATE: { int cycles = NumCycles(range,t); if (cycles&1) { t = range.Duration() - CycleTime(range,t); } else { t = CycleTime(range,t); } SetValueLocalTime(t,val,commit,method); break; } // These ORTs aren't cyclic so we just set the value out of range. case ORT_RELATIVE_REPEAT: case ORT_CONSTANT: case ORT_IDENTITY: case ORT_LINEAR: SetValueLocalTime(t,val,commit,method); break; } }
Implemented in StdControl.
virtual CoreExport bool GetLocalTMComponents | ( | TimeValue | t, |
TMComponentsArg & | cmpts, | ||
Matrix3Indirect & | parentMatrix | ||
) | [virtual] |
t | The time at which to get the local TM components. |
cmpts | See Structure TMComponentsArgs. |
parentMatrix | The parent matrix. Note the definition: LocalMatrix = WorldMatrix * ParentWorldMatrix^(-1) |
Reimplemented in StdControl.
virtual BOOL InheritsParentTransform | ( | ) | [inline, virtual] |
{ return TRUE; }
virtual int GetORT | ( | int | type | ) | [inline, virtual] |
type | One of the following values: ORT_BEFORE - leading up to the pattern ORT_AFTER - beyond the key pattern |
{return (aflag>>(type==ORT_BEFORE?A_ORT_BEFORESHIFT:A_ORT_AFTERSHIFT))&A_ORT_MASK;}
virtual CoreExport void SetORT | ( | int | ort, |
int | type | ||
) | [virtual] |
ort | See outOfRangeTypes. |
type | One of the following values: ORT_BEFORE - leading up to the pattern ORT_AFTER - beyond the key pattern |
virtual CoreExport void EnableORTs | ( | BOOL | enable | ) | [virtual] |
enable | TRUE to enable ORTs; FALSE to disable. |
isave | This pointer may be used to call methods to write data to disk. See Class ISave. |
Reimplemented from ReferenceMaker.
iload | This pointer may be used to call methods to load data from disk. See Class ILoad. |
Reimplemented from ReferenceMaker.
virtual void EnumIKParams | ( | IKEnumCallback & | callback | ) | [inline, virtual] |
callback | This 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. |
void QuatEnumIKParams(Control *cont,IKEnumCallback &callback) { JointParams *jp = (JointParams*)cont->GetProperty(PROPID_JOINTPARAMS); for (int i=0; i<3; i++) { if (!jp || jp->Active(i)) { callback.proc(cont,i); } } }
{}
virtual BOOL CompDeriv | ( | TimeValue | t, |
Matrix3 & | ptm, | ||
IKDeriv & | derivs, | ||
DWORD | flags | ||
) | [inline, virtual] |
t | Specifies the time to compute the derivative. |
ptm | The parents transformation. |
derivs | This class provides methods the plug-in calls to set the derivatives. See Class IKDeriv. |
flags | One of the following values: POSITION_DERIV Indicates that derivs.DP() should be called. ROTATION_DERIV Indicates that derivs.DR() should be called. |
BOOL QuatCompDeriv(Control *cont,TimeValue t,Matrix3& ptm, IKDeriv& derivs,DWORD flags) { JointParams *jp = (JointParams*)cont->GetProperty(PROPID_JOINTPARAMS); 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; }
{return FALSE;}
virtual float IncIKParam | ( | TimeValue | t, |
int | index, | ||
float | delta | ||
) | [inline, virtual] |
t | The time of the increment. |
index | Specifies the IK parameter to increment. |
delta | The 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. |
float QuatIncIKParam(Control *cont,TimeValue t,int index,float delta) { JointParams *jp = (JointParams*)cont->GetProperty(PROPID_JOINTPARAMS); 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]); } }
{return 0.0f;}
virtual void ClearIKParam | ( | Interval | iv, |
int | index | ||
) | [inline, virtual] |
iv | The interval over which the keys should be deleted. |
index | Specified the degree of freedom (parameter) that the keys should be deleted for. |
{return;}
virtual BOOL CanCopyIKParams | ( | int | which | ) | [inline, virtual] |
which | One of the following values: COPYPASTE_IKPOS COPYPASTE_IKROT |
{return FALSE;}
virtual IKClipObject* CopyIKParams | ( | int | which | ) | [inline, virtual] |
which | One of the following values: COPYPASTE_IKPOS COPYPASTE_IKROT |
{return NULL;}
virtual BOOL CanPasteIKParams | ( | IKClipObject * | co, |
int | which | ||
) | [inline, virtual] |
co | A 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. |
which | One of the following values: COPYPASTE_IKPOS COPYPASTE_IKROT |
{return FALSE;}
virtual void PasteIKParams | ( | IKClipObject * | co, |
int | which | ||
) | [inline, virtual] |
co | A pointer to an IKClipObject. See Class IKClipObject. |
which | One of the following values: COPYPASTE_IKPOS COPYPASTE_IKROT |
{}
virtual void InitIKJoints | ( | InitJointData * | posData, |
InitJointData * | rotData | ||
) | [inline, virtual] |
posData | The position data from the 3DS file. See Class InitJointData. |
rotData | The rotation data from the 3DS file. |
{}
virtual BOOL GetIKJoints | ( | InitJointData * | posData, |
InitJointData * | rotData | ||
) | [inline, virtual] |
posData | Points to the object to hold the position data. See Class InitJointData. |
rotData | Points to the object to hold the rotation data. |
{return FALSE;}
virtual BOOL GetDOFParams | ( | TimeValue | t, |
Matrix3 & | ptm, | ||
DOFParams & | dofs, | ||
BOOL | nodeSel | ||
) | [inline, virtual] |
t | The current time. |
ptm | The parent matrix. |
dofs | This is the structure to be filled in. See Class DOFParams. |
nodeSel | TRUE if the node is currently selected; otherwise FALSE. |
{return FALSE;}
virtual BOOL CreateLockKey | ( | TimeValue | t, |
int | which | ||
) | [inline, virtual] |
t | The time to create the key. |
which | Specifies which type of key to create: 0 for position, 1 for rotation. |
{return FALSE;}
virtual void MirrorIKConstraints | ( | int | axis, |
int | which, | ||
BOOL | pasteMirror =
FALSE |
||
) | [inline, virtual] |
axis | Specifies the axis of reflection: 0 for X, 1 for Y, 2 for Z. |
which | Specifies which type of constraints are being mirrored: 0 for position, 1 for rotation. |
pasteMirror | TRUE 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). |
{}
virtual BOOL TerminateIK | ( | ) | [inline, virtual] |
{return FALSE;} // controllers can act as terminators.
virtual void InitIKJoints2 | ( | InitJointData2 * | posData, |
InitJointData2 * | rotData | ||
) | [inline, virtual] |
posData | The position data from the 3DS file. See Class InitJointData2. |
rotData | The rotation data from the 3DS file. |
{}
virtual BOOL GetIKJoints2 | ( | InitJointData2 * | posData, |
InitJointData2 * | rotData | ||
) | [inline, virtual] |
posData | Points to the object to hold the position data. See Class InitJointData2. |
rotData | Points to the object to hold the rotation data. |
{return FALSE;}
virtual RefResult PinNodeChanged | ( | RefMessage | message, |
Interval | changeInt, | ||
PartID & | partID | ||
) | [inline, virtual] |
message | The message that was sent. |
changeInt | This is the interval of time over which the message is active. Currently, all controllers will receive FOREVER for this interval. |
partID | This 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. |
{return REF_SUCCEED;}
virtual void NodeIKParamsChanged | ( | ) | [inline, virtual] |
{}
virtual void TMInvalidated | ( | ) | [inline, virtual] |
{}
virtual BOOL OKToBindToNode | ( | INode * | node | ) | [inline, virtual] |
node | Points to the node to check. |
{return TRUE;}
virtual BOOL CanApplyEaseMultCurves | ( | ) | [inline, virtual] |
Reimplemented in LockableStdControl, and LockableControl.
{return TRUE;}
CoreExport TimeValue ApplyEase | ( | TimeValue | t, |
Interval & | valid | ||
) |
t | The time to have modified by the ease curve. |
valid | The validity interval of the TimeValue returned. |
CoreExport void AppendEaseCurve | ( | Control * | cont | ) |
cont | The controller that the ease curve will be applied to. |
CoreExport void DeleteEaseCurve | ( | int | i | ) |
i | The index of the ease curve to delete. |
CoreExport int NumEaseCurves | ( | ) |
CoreExport float GetMultVal | ( | TimeValue | t, |
Interval & | valid | ||
) |
t | The time to retrieve the value. |
valid | The validity interval of the value. |
CoreExport void AppendMultCurve | ( | Control * | cont | ) |
cont | The controller to have the multiplier curve added. |
CoreExport void DeleteMultCurve | ( | int | i | ) |
i | The index of the curve to delete. |
CoreExport int NumMultCurves | ( | ) |
CoreExport int NumRefs | ( | ) | [virtual] |
Returns the total number of references this ReferenceMaker can hold.
The plugin implements this method to indicate the total number of of references it can make. This includes all references whether they are NULL (inactive) or non-NULL (active) at the time when this method is called. A plugin can hold a variable number of references, thus the return value of this method is not to be cached and reused by client code.
Reimplemented from ReferenceMaker.
CoreExport RefTargetHandle GetReference | ( | int | i | ) | [virtual] |
Returns the 'i-th' reference.
The plugin implements this method to return its 'i-th' reference. The plug-in simply keeps track of its references using an integer index for each one. This method is normally called by the system.
i | - The index of the reference to retrieve. Valid values are from 0 to NumRefs()-1. |
Reimplemented from ReferenceMaker.
virtual CoreExport void SetReference | ( | int | i, |
RefTargetHandle | rtarg | ||
) | [protected, virtual] |
Stores a ReferenceTarget as its 'i-th' reference`.
The plugin implements this method to store the reference handle passed to it as its 'i-th' reference. In its implementation of this method, the plugin should simply assign the reference handle passed in as a parameter to the member variable that holds the 'i-th' reference. Other reference handling methods such as ReferenceMaker::DeleteReference(), or ReferenceMaker::ReplaceReference() should not be called from within this method. The plugin itself or other plugins should not call this method directly. The system will call this method when a new reference is created or an existing one is replaced by calling ReferenceMaker::ReplaceReference().
i | - The index of the reference to store. Valid values are from 0 to NumRefs()-1. |
rtarg | - The reference handle to store. |
Reimplemented from ReferenceMaker.
CoreExport int NumSubs | ( | ) | [virtual] |
Reimplemented from Animatable.
CoreExport Animatable* SubAnim | ( | int | i | ) | [virtual] |
i | This is the index of the sub-anim to return. |
Reimplemented from Animatable.
CoreExport MSTR SubAnimName | ( | int | i | ) | [virtual] |
i | The index of the parameter name to return |
Reimplemented from Animatable.
CoreExport void* GetInterface | ( | ULONG | id | ) | [virtual] |
Inherited from Animatable.
Returns a pointer to the interface.
id | - The id of the interface. |
Reimplemented from ReferenceTarget.
Reimplemented in LockableStdControl, and LockableControl.
CoreExport int PaintFCurves | ( | ParamDimensionBase * | dim, |
HDC | hdc, | ||
Rect & | rcGraph, | ||
Rect & | rcPaint, | ||
float | tzoom, | ||
int | tscroll, | ||
float | vzoom, | ||
int | vscroll, | ||
DWORD | flags | ||
) | [virtual] |
dim | The parameter dimension. See Class ParamDimensionBase. |
hdc | The handle of the device context. |
rcGraph | The entire rectangle of the inside of the graph region. |
rcPaint | This is the rectangular region that needs to be repainted - the invalid region. |
tzoom | The time zoom factor. |
tscroll | The time scroll factor. |
vzoom | The value zoom factor. |
vscroll | The value scroll factor. |
flags | One 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. |
Reimplemented from Animatable.
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.
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 |
Reimplemented from Animatable.
virtual CoreExport void BaseClone | ( | ReferenceTarget * | from, |
ReferenceTarget * | to, | ||
RemapDir & | remap | ||
) | [virtual] |
Reimplemented from ReferenceTarget.
virtual void PostCloneNode | ( | ) | [inline, virtual] |
{}
virtual BOOL PreventNodeDeletion | ( | ) | [inline, virtual] |
{return FALSE;}
virtual CoreExport float EvalVisibility | ( | TimeValue | t, |
View & | view, | ||
Box3 | pbox, | ||
Interval & | valid | ||
) | [virtual] |
t | The time at which to evaluate. |
view | This 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. |
pbox | The bounding box of the node that's being evaluated. |
valid | This interval should be updated to reflect the validity of the visibility controller. |
virtual BOOL VisibleInViewports | ( | ) | [inline, virtual] |
{return TRUE;}
virtual BOOL CanInstanceController | ( | ) | [inline, virtual] |
{return TRUE;}
ctrl | Points to the cloned controller (the new one). |
remap | The RemapDir passed to this controller's Clone() method. |
RefTargetHandle Clone(RemapDir& remap) { ExprControl *ctrl = new ExprControl(this->type, *this); CloneControl(ctrl,remap); return ctrl; }
t | The time to display the object. |
inode | The node to display. |
vpt | An interface pointer that exposes methods the plug-in may call related to the viewports. |
flags | See List of Display Flags. |
{ return 0; };
virtual int HitTest | ( | TimeValue | t, |
INode * | inode, | ||
int | type, | ||
int | crossing, | ||
int | flags, | ||
IPoint2 * | p, | ||
ViewExp * | vpt | ||
) | [inline, virtual] |
t | The time to perform the hit test. |
inode | A pointer to the node whose gizmo should be tested. |
type | The type of hit testing to perform. See Scene and Node Hit Test Types. for details. |
crossing | The state of the crossing setting. If TRUE crossing selection is on. |
flags | The hit test flags. See Scene and Node Hit Testing Flags for details. |
p | The screen point to test. |
vpt | An interface pointer that may be used to call methods associated with the viewports. |
{ return 0; }
virtual void GetWorldBoundBox | ( | TimeValue | t, |
INode * | inode, | ||
ViewExp * | vpt, | ||
Box3 & | box | ||
) | [inline, virtual] |
t | The time to retrieve the bounding box. |
inode | The node to calculate the bounding box for. |
vpt | An interface pointer that exposes portions of View3D that are exported for use by plug-ins. |
box | The returned bounding box. |
{}
virtual void ActivateSubobjSel | ( | int | level, |
XFormModes & | modes | ||
) | [inline, virtual] |
level | The 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. |
modes | The command modes to support. See Class XFormModes. |
{}
virtual void SelectSubComponent | ( | CtrlHitRecord * | hitRec, |
BOOL | selected, | ||
BOOL | all, | ||
BOOL | invert =
FALSE |
||
) | [inline, virtual] |
hitRec | Identifies the component whose selected state should be modified. See Class CtrlHitRecord. |
selected | TRUE if the item should be selected; FALSE if the item should be de-selected. |
all | TRUE if the entire object should be selected; FALSE if only the portion of the identified by hitRec. |
invert | This 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. |
{}
virtual void ClearSelection | ( | int | selLevel | ) | [inline, virtual] |
selLevel | Specifies the selection level to clear. |
{}
virtual int SubObjectIndex | ( | CtrlHitRecord * | hitRec | ) | [inline, virtual] |
hitRec | Identifies the component whose index should be returned. See Class CtrlHitRecord. |
{return 0;}
virtual void SelectAll | ( | int | selLevel | ) | [inline, virtual] |
selLevel | Specifies the selection level to select. |
{}
virtual void InvertSelection | ( | int | selLevel | ) | [inline, virtual] |
selLevel | Specifies the selection level to invert. |
{}
virtual void GetSubObjectCenters | ( | SubObjAxisCallback * | cb, |
TimeValue | t, | ||
INode * | node | ||
) | [inline, virtual] |
cb | The callback object whose methods may be called. See Class SubObjAxisCallback. |
t | The time to enumerate the centers. |
node | A pointer to the node. |
{}
virtual void GetSubObjectTMs | ( | SubObjAxisCallback * | cb, |
TimeValue | t, | ||
INode * | node | ||
) | [inline, virtual] |
cb | The callback object whose methods may be called. See Class SubObjAxisCallback. |
t | The time to enumerate the TMs. |
node | A pointer to the node. |
{}
virtual void SubMove | ( | TimeValue | t, |
Matrix3 & | partm, | ||
Matrix3 & | tmAxis, | ||
Point3 & | val, | ||
BOOL | localOrigin =
FALSE |
||
) | [inline, virtual] |
t | The time of the transformation. |
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. |
tmAxis | The matrix that represents the axis system. This is the space in which the transformation is taking place. |
val | This value is a vector with X, Y, and Z representing the movement along each axis. |
localOrigin | When TRUE the transformation is occurring about the sub-object's local origin. |
{}
virtual void SubRotate | ( | TimeValue | t, |
Matrix3 & | partm, | ||
Matrix3 & | tmAxis, | ||
Quat & | val, | ||
BOOL | localOrigin =
FALSE |
||
) | [inline, virtual] |
{}
virtual void SubScale | ( | TimeValue | t, |
Matrix3 & | partm, | ||
Matrix3 & | tmAxis, | ||
Point3 & | val, | ||
BOOL | localOrigin =
FALSE |
||
) | [inline, virtual] |
t | The time of the transformation. |
partm | The 'parent' transformation matrix. This matrix represents a transformation that would take points in the modifier's space and convert them into world space points. |
tmAxis | The matrix that represents the axis system. This is the space in which the transformation is taking place. |
val | This value is a vector with X, Y, and Z representing the scale along X, Y, and Z respectively. |
localOrigin | When TRUE the transformation is occurring about the sub-object's local origin. See the note above in the Rotate method. |
{}
virtual CoreExport SvGraphNodeReference SvTraverseAnimGraph | ( | IGraphObjectManager * | gom, |
Animatable * | owner, | ||
int | id, | ||
DWORD | flags | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
owner | The owning animatable. |
id | This is usually the sub-anim number (but can actually be any value the developer chooses). |
flags | See List of Schematic %View AddAnimatable Flags. |
Reimplemented from Animatable.
virtual CoreExport MSTR SvGetName | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode, | ||
bool | isBeingEdited | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
gNode | Points to this node in the schematic view. |
isBeingEdited | TRUE if the item is being edited; FALSE if not. |
{ Animatable *owner; int subNum; MSTR name; owner = gNode->GetOwner(); subNum = gNode->GetID(); name = owner->SubAnimName(subNum); return name; }
Reimplemented from Animatable.
virtual CoreExport bool SvHandleDoubleClick | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
gNode | Points to the node in the schematic view. |
Reimplemented from Animatable.
virtual CoreExport bool SvCanInitiateLink | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
gNode | Points to this node in the schematic view. |
Reimplemented from Animatable.
virtual CoreExport bool SvCanConcludeLink | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode, | ||
IGraphNode * | gNodeChild | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
gNode | Points to this node in the schematic view. |
gNodeChild | Points to the child node in the schematic view. |
Reimplemented from Animatable.
virtual CoreExport bool SvLinkChild | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNodeThis, | ||
IGraphNode * | gNodeChild | ||
) | [virtual] |
gom | Points to the schematic view window manager. |
gNodeThis | Points to this node in the schematic view. |
gNodeChild | Points to the child node in the schematic view. |
Reimplemented from Animatable.
virtual CoreExport bool SvEditProperties | ( | IGraphObjectManager * | gom, |
IGraphNode * | gNode | ||
) | [virtual] |
Reimplemented from Animatable.
oseg | The old time segment. |
nseg | The new time segment. |
{return FALSE;}
virtual int GetDrawPixelStep | ( | ) | [inline, virtual] |
{return 5;}
virtual int GetExtentTimeStep | ( | ) | [inline, virtual] |
{return 40;}