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”.
Bases: object
Proxy of C++ PCore::LWEnvelopeFuncs class
Copy an envelope. This is meant to be called from within a Handler's inst_copy()
callback. Please refer to Handler Interfaces.
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
Create a new envelope group. An envelope group is just a way to organize related envelopes.
Create a new key in an envelope.
Destroy an envelope created using LWEnvelopeFuncs::create()
.
Destroy an envelope group created using LWEnvelopeFuncs::createGroup()
.
Delete a key in an envelope.
Open the graph editor window and allow the user to edit the envelope. The flags
and data
arguments are currently unused.
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.
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
Returns an integer containing the number of times the envelope has been changed.
Returns the interpolated value of the envelope.
Returns the key for a given time.
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.
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 an envelope. This is meant to be called from within a Handler's inst_load()
callback. Please refer to Handler Interfaces.
Returns the next key in the envelope.
Returns the previous key in the envelope.
Save an envelope. This is meant to be called from within a Handler's inst_save()
callback. Please refer to Handler Interfaces.
!! NOT IMPLEMENTED !!