Animation Envelopes

An example of using the Animation Envelopes within the Python environment can be found in the Layout Tool Class example script called “split_bone.py”.

class lwsdk.LWEnvelopeFuncs(*args)

Bases: object

Proxy of C++ PCore::LWEnvelopeFuncs class

 copy(LWEnvelopeID to, LWEnvelopeID _from) → LWError

Copy an envelope. This is meant to be called from within a Handler's inst_copy() callback. Please refer to Handler Interfaces.

 create(LWChanGroupID group, char name, int type) → LWEnvelopeID

Create a new envelope. The type defines how the envelope's values are interpreted and displayed to the user in the graph editor. It can be one of the following:

lwsdk.LWET_FLOAT
lwsdk.LWET_DISTANCE
lwsdk.LWET_PERCENT
lwsdk.LWET_ANGLE

 createGroup(LWChanGroupID parent, char name) → LWChanGroupID

Create a new envelope group. An envelope group is just a way to organize related envelopes.

 createKey(LWEnvelopeID env, LWTime keytime, double value) → LWEnvKeyframeID

Create a new key in an envelope.

 destroy(LWEnvelopeID env)

Destroy an envelope created using LWEnvelopeFuncs::create().

 destroyGroup(LWChanGroupID group)

Destroy an envelope group created using LWEnvelopeFuncs::createGroup().

 destroyKey(LWEnvelopeID env, LWEnvKeyframeID key)

Delete a key in an envelope.

 edit(LWChanGroupID group, LWEnvelopeID env, int flags, void data) → int

Open the graph editor window and allow the user to edit the envelope. The flags and data arguments are currently unused.

 egGet(LWEnvelopeID env, LWChanGroupID group, int tag) → PyObject

Get a value associated with an envelope. In addition to the value types defined for LWEnvelopeFuncs::egSet(), you can use lwsdk.LWENVTAG_KEYCOUNT to get the number of keys defined for the envelope. The result is true (non-zero) if the function succeeds and false (0) if it fails.

 egSet(LWEnvelopeID env, LWChanGroupID group, int tag, int val) → int

Set a value associated with the envelope. The result is true (non-zero) if the function succeeds and false (0) if it fails.

lwsdk.LWENVTAG_VISIBLE
    Invisible envelopes won't appear in the graph editor. You can use these to store internal
    variables. The value for this tag is an integer containing true (1) or false (0).

lwsdk.LWENVTAG_PREBEHAVE
lwsdk.LWENVTAG_POSTBEHAVE
    Pre- and post-behavior setting, an integer corresponding to the options in the graph editor:
        0 - Reset
        1 - Constant
        2 - Repeat
        3 - Oscillate
        4 - Offset Repeat
        5 - Linear

 envAge(LWEnvelopeID env) → int

Returns an integer containing the number of times the envelope has been changed.

 evaluate(LWEnvelopeID env, LWTime attime) → double

Returns the interpolated value of the envelope.

 findKey(LWEnvelopeID env, LWTime keytime) → LWEnvKeyframeID

Returns the key for a given time.

 keyGet(LWEnvelopeID env, LWEnvKeyframeID key, LWKeyTag tag) → PyObject

Get a value associated with a key. The result is true (non-zero) if the function succeeds and false (0) if it fails. The tags are the same as those for LWEnvelopeFuncs::keySet(), along with lwsdk.LWKEY_TIME, the time of the key.

 keySet(LWEnvelopeID env, LWEnvKeyframeID key, LWKeyTag tag, PyObject val) → int

Set a value associated with a key. This can be the value of the key itself, the shape of the key, or one of the interpolation parameters. The result is true (non-zero) if the function succeeds and false (0) if it fails. The tag describing the value can be one of the following:

lwsdk.LWKEY_VALUE
    The value of the key.

lwsdk.LWKEY_SHAPE
    The curve type, an integer corresponding to the options in the graph editor:
        0 - TCB (Kochanek-Bartels)
        1 - Hermite
        2 - 1D Bezier (obsolete, equivalent to Hermit)
        3 - Linear
        4 - Stepped
        5 - 2D Bezier

lwsdk.LWKEY_TENSION
lwsdk.LWKEY_CONTINUITY
lwsdk.LWKEY_BIAS
    The Kochanek-Bartels blending parameters.

lwsdk.LWKEY_PARAM_0
lwsdk.LWKEY_PARAM_1
lwsdk.LWKEY_PARAM_2
lwsdk.LWKEY_PARAM_3
    The curve parameters. These are the Hermite coefficients for Hermite curves,
    and the incoming and outgoing tangents for 2D Bezier curves.

 load(LWEnvelopeID env, LWLoadState load) → LWError

Load an envelope. This is meant to be called from within a Handler's inst_load() callback. Please refer to Handler Interfaces.

 nextKey(LWEnvelopeID env, LWEnvKeyframeID key) → LWEnvKeyframeID

Returns the next key in the envelope.

 prevKey(LWEnvelopeID env, LWEnvKeyframeID key) → LWEnvKeyframeID

Returns the previous key in the envelope.

renameGroup(self, LWChanGroupID group, char name)
 save(LWEnvelopeID env, LWSaveState save) → LWError

Save an envelope. This is meant to be called from within a Handler's inst_save() callback. Please refer to Handler Interfaces.

 setEnvEvent(LWEnvelopeID env, LWEnvEventFunc func, void data) → int

!! NOT IMPLEMENTED !!

Previous topic

Dynamic Monitor

Next topic

Channel Information

This Page