ItemMotionHandler
ItemMotionInterface
Motion handlers apply procedural translation, rotation and scaling to an item. They can
be associated with any item in a scene that can be keyframed (objects, lights, cameras,
bones).
Handler Activation Function
XCALL_( int ) MyItemMotion( long version, GlobalFunc *global,
LWItemMotionHandler *local, void *serverData );
The local argument to a motion handler's activation function is an
LWItemMotionHandler.
typedef struct st_LWItemMotionHandler {
LWInstanceFuncs *inst;
LWItemFuncs *item;
void (*evaluate) (LWInstance, const LWItemMotionAccess *);
unsigned int (*flags) (LWInstance);
} LWItemMotionHandler;
The first two members of this structure are standard handler
functions. In addition to these, a motion handler provides an evaluation function and
a flags function.
- evaluate( instance, access )
- This is where the motion handler does its work. LightWave calls the evaluation function
at every point in the animation at which an item's motion parameters need to be
calculated. The access structure, described below, tells you the item being animated and
the frame and time of the evaluation, and provides functions to set motion parameters for
the current time and to get the item's motion parameters for any time.
flags( instance )
- Not sure what the flags are yet.
Interface Activation Function
XCALL_( int ) MyInterface( long version, GlobalFunc *global,
??? *???, void *serverData );
TBD.
Filter Access
This is the access structure passed to the evaluation function. The data members are
read-only. The functions provide the means to get and set motion parameters.
typedef struct st_LWItemMotionAccess {
LWItemID item;
LWFrame frame;
LWTime time;
void (*getParam) (LWItemParam, LWTime, LWDVector);
void (*setParam) (LWItemParam, const LWDVector);
} LWItemMotionAccess;
- item
- The ID for the item to be affected by the procedural motion.
frame
- This is set to the current instant for which the motion should be evaluated.
time
- This is set to the current instant for which the motion should be evaluated.
getParam( param, lwtime, vec )
- Returns a motion parameter for the item at any given time. Only the POSITION, ROTATION
and SCALING parameters may be queried.
setParam( param, vec )
- Used by the evaluation function to set the computed motion of the item at the current
time. Only the POSITION, ROTATION and SCALING parameters may be set.
|