alias_api.AlParamAction

class alias_api.AlParamAction

Bases: AlAction

Basic interface to derived class of actions for parameter curve actions.

An AlParamAction is derived from an AlAction. This particular action has a list of AlKeyframes which are CVs on a Poon-Ross spline. This spline is basically a Hermite-linear spline. That is, it is a Hermite in y (the vertical axis) and a linear in x (the horizontal axis).

In order to create an AlParamAction, you must have at least one valid, created AlKeyframe which 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, since 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.

add_keyframe(self: alias_api.AlParamAction, location: typing.SupportsFloat, value: typing.SupportsFloat, recompute: typing.SupportsInt = True, intan: alias_api.AlTangentType = <AlTangentType.TangentFlat: 2>, outtan: alias_api.AlTangentType = <AlTangentType.TangentFlat: 2>) int

This method adds a keyframe to the parameter curve’s list of keyframes. If the parameter curve already has another keyframe at the same location as this keyframe, then the existing keyframe at this location will be deleted and replaced with this keyframe. If this object does not yet reference an actual Parameter Curve, a new curve will be created.

Parameters
  • location (float) – the time value for the keyframe

  • value (float) – the value of the keyframe

  • recompute – recompute the tangents of neighboring keyframes

  • intan (AlTangentType) – the in tangent for the keyframe

  • outtan (AlTangentType) – the out tangent for the keyframe

Returns

The status code result of the operation: Success - operation completed normally. Failure - operation failed to complete normally. InsufficientMemory - there wasn’t enough memory to complete the operation.

Return type

AlStatusCode

add_keyframe_range(self: alias_api.AlParamAction, location: std::vector<double, std::allocator<double> >, value: std::vector<double, std::allocator<double> >, recompute: bool, intan: alias_api.VectorAlTangentType = VectorAlTangentType[], outtan: alias_api.VectorAlTangentType = VectorAlTangentType[]) int

This method adds a block of keyframes to the parameter curve’s list of 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 None, TangentFlat is assumed.

The size of location, value, intan (if not None), and outtan (if not None) must all be the same size.

Parameters
  • location (List[float]) – array of keyframe locations (time values)

  • value (List[float]) – array of keyframe values

  • recompute (bool) – recompute tangents of neighboring keyframes

  • intan (List[AlTangentType]) – array of the in-tangents for keyframes

  • outtan (List[AlTangentType]) – array of the out-tangents for keyframes

Returns

The status code result of the operation: Success - operation completed normally InvalidArgument - one of the arguments was None or invalid InsufficientMemory - ran out of memory ObjectAlreadyPresent - a keyframe already exists in given location Failure - could not create action

Return type

AlStatusCode

apply_iterator_to_keyframes(self: alias_api.AlParamAction, iter: AlIterator) tuple[int, int]

Apply the given AlIterator to all keyframes in the action. The second argument will be set to the return value of the last application of the iterator’s function. See the AlIterator class for more information. :param iter: the iterator to be applied to each keyframe :type iter: AlIterator

Returns

A tuple containing: (1) the status of the application of the iterator

Success - the application of the iterator terminated normally Failure - the application of the iterator terminated abnormally InvalidArgument - the iterator was None. InvalidObject - the action was invalid

  1. the return value of the last application of the iterator’s function

Return type

tuple<AlStatusCode, int>

copy_wrapper(self: alias_api.AlParamAction) alias_api.AlObject

Returns a duplicate of this wrapper object, pointing to the same object.

delete_keyframe_range(self: alias_api.AlParamAction, min_value: SupportsFloat, max_value: SupportsFloat) int

This method deletes all keyframes whose “time”s are greater or equal to the “min_value” given, and less or equal to than the “max_value” given.

Parameters
  • min_value (float) – min. time value to delete keyframes from

  • max_value (float) – max. time value to delete keyframes up to

Returns

The status code result of the operation: Success - operation completed normally. Failure - operation failed to complete normally. InvalidObject - the action was invalid.

Return type

AlStatusCode

first_keyframe(self: alias_api.AlParamAction) alias_api.AlKeyframe

This method returns the first keyframe of this parameter curve action.

last_keyframe(self: alias_api.AlParamAction) alias_api.AlKeyframe

This method returns the last keyframe of this parameter curve action.

number_of_keyframes(self: alias_api.AlParamAction) int

Returns the number of keyframes in this action, or -1 if the call fails.

type(self: alias_api.AlParamAction) alias_api.AlObjectType

Returns the class identifier ‘ParamActionType’.