Python

The following methods are available when scripting the action actuator from python.

getAction()

Returns a string containing the name of action currently associated with this actuator.

getBlendin()

Returns a floating-point number indicating the number of blending frames currently specified for this actuator.

getEnd()

Returns a floating-point number specifying the last frame of the action.

getFrame()

Returns a floating-point number indicating the current frame of playback.

getPriority()

Returns an integer specifying the current priority of this actuator.

getProperty()

Returns a string indicating the name of the property to be used for "Property-Driven Playback".

getStart()

Returns a floating-point number specifying the first frame of the action.

setAction(action, reset)

Expects a string action specifying the name of the action to be associated with this actuator. If the action does not exist in the file, the state of the actuator is not changed.

If the optional parameter reset is set to 1, this method will reset the blending timer to 0. If the reset is set to 0 this method leaves the blending timer alone. If reset is not specified, the blending timer will be automatically reset. Calling this method does not however, change the start and end frames of the action. These may need to be set using setStart and setEnd

setBlendin(blendin)

Expects a positive floating-point number blendin specifying the number of transition frames to generate when switching to this action.

setBlendtime(blendtime)

Expects a floating-point number blendtime in the range between 0.0 and 1.0. This can be used to directly manipulate the internal timer that is used when generating transitions. Setting a blendtime of 0.0 means that the result pose will be 100% based on the last known frame of animation. Setting a value of 1.0 means that the pose will be 100% based on the new action.

setChannel(channelname, matrix)

Accepts a string channelname specifying the name of a valid action channel or bone name, and a 4x4 matrix (a list of four lists of four floats each) specifying an overriding transformation matrix for that bone. Note that the transformations are in local bone space (i.e. the matrix is an offset from the bone's rest position).

This function will override the data contained in the action (if any) for one frame only. On the subsequent frame, the action will revert to its normal course, unless the channel name passed to setChannel is not specified in the action. If you wish to override the action for more than one frame, this method must be called on each frame.

Note that the override specified in this method will take priority over all other actuators.

setEnd(end)

Accepts a floating-point number end, which specifies what the last frame of the action should be.

setFrame(frame)

Passing a floating-point number frame allows the script to directly manipulate the actuator's current frame. This is low-level functionality for advanced use only. The preferred method is to use Property-Driven Playback mode.

setPriority(priority)

Passing an integer priority allows the script to set the priority for this actuator. Actuators with lower priority values will override actuators with higher numbers.

setProperty(propertyname)

This method accepts a string propertyname and uses it to specify the property used for Property-Driven-Playback. Note that if the actuator is not set to use Property-Playback, setting this value will have no effect.

setStart(start)

To specify the starting frame of the action, pass a floating-point number start to this method.