#include <AlParamAction.h>
class AlParamAction : public AlAction
AlParamAction();
virtual ~AlParamAction();
virtual AlObject* copyWrapper() const;
virtual AlObjectType type() const;
virtual AlParamAction* asParamActionPtr();
AlKeyframe* firstKeyframe() const;
AlKeyframe* lastKeyframe() const;
statusCode addKeyframe( double, double, AlKeyframe *&, boolean = TRUE,
AlTangentType = kTangentFlat, AlTangentType = kTangentFlat
);
statusCode addKeyframe( double, double, AlKeyframe &, boolean = TRUE,
AlTangentType = kTangentFlat, AlTangentType = kTangentFlat
);
statusCode addKeyframe( double, double, boolean = TRUE, AlTangentType =
kTangentFlat, AlTangentType = kTangentFlat );
int numberOfKeyframes() const;
statusCode applyIteratorToKeyframes( AlIterator*, int& );
statusCode addKeyframeRange( int, double*, double*, boolean = TRUE,
AlTangentType* = NULL, AlTangentType* = NULL );
statusCode deleteKeyframeRange( double, double );
In order to create an AlParamAction, you must have at least one valid, created AlKeyframe that will be the first keyframe of the action. After the AlParamAction is created, you can add other keyframes to the AlParamAction. Note that two AlKeyframes cannot have the same location. If you add a keyframe to the action that has the same location as an existing keyframe of the action, the existing keyframe will be deleted. Since an AlKeyframe is created at (0, 0), you cannot create a bunch of AlKeyframes, add them to the AlParamAction, and then modify their locations later, because the AlParamAction will only have one keyframe (the others will have been deleted as each successive keyframe with the same location is added to the AlParamAction). You must set the location of the AlKeyframe before adding it to the AlParamAction.
If you copy an AlParamAction, all the keyframes (and the keyframes' streams) will also be copied. If you delete an AlParamAction, all its Keyframes will be deleted.
An example loop may look like
AlKeyframe key;
for( int i =0; i < 100; i++ )
{
param->addKeyframe( i, 1, key, ....)
}
< value - the value of the keyframe
> Alkeyframe &kf - the resulting keyframe
< intan - the in tangent for the keyframe
< outtan - the out tangent for the keyframe
< recompute - recompute the tangents of neighboring keyframes
sInvalidArgument - kf was NULL
sFailure - key frame not added
Below is an example code fragment
Alkeyframe *key1, *key2, *key3;
param->addKeyframe( 0, 1, key1, ....
param->addKeyframe( 1, 1, key2, ....
param->addKeyframe( 2, 1, key3, ....
...
delete key1;
delete key2;
delete key3;
< value - the value of the keyframe
> Alkeyframe* &kf - the resulting keyframe
< intan - the in tangent for the keyframe
< outtan - the out tangent for the keyframe
< recompute - recompute the tangents of neighboring keyframes
sInvalidArgument - kf was NULL
sFailure - key frame not added
< value - the value of the keyframe
< intan - the in tangent for the keyframe
< outtan - the out tangent for the keyframe
< recompute - recompute the tangents of neighboring keyframes
sFailure - operation failed to complete normally.
sInsufficientMemory - there wasn't enough memory to complete the operation.
int AlParamAction::numberOfKeyframes() const
Arguments
< iter - the iterator to be applied to each keyframe Return codes
sSuccess - the application of the iterator terminated normally statusCode AlParamAction::deleteKeyframeRange( double minValue, double maxValue )
Description
This method deletes all keyframes whose "time"s are greater or equal to the "minValue" given, and less or equal to than the "maxValue" given. Arguments
< minValue - min. time value to delete keyframes from Return codes
sSuccess - operation completed normally statusCode AlParamAction::addKeyframeRange( int size, double location[], double value[], boolean recompute, AlTangentType intan[], AlTangentType outtan[])
Description
This method adds a block of keyframes to the parameter curve's list keyframes. If the parameter curve already has a keyframe at the same location as one of the added keyframes, then the method will fail. If this object does not yet reference an actual Parameter Curve, a new curve will be created.If intan and outan are NULL, kTangentFlat is assumed. Arguments
< size - size of input arrays Return codes
sSuccess - operation completed normally