Module Key :: Class KeyBlock
[frames] | no frames]

Class KeyBlock

The KeyBlock object

Each Key object has a list of KeyBlocks attached, each KeyBlock representing a keyframe.

Instance Methods
 
getData()
Get the data of a KeyBlock, as a list of data items.
Instance Variables
float curval
Current value of the corresponding IpoCurve.
varies data
The data of the KeyBlock (see getData).
string name
The name of the Keyblock.
float pos
The position of the keyframe.
float slidermax
The maximum value for the action slider.
float slidermin
The minimum value for the action slider.
string vgroup
The assigned VGroup for the Key Block.
Method Details

getData()

 

Get the data of a KeyBlock, as a list of data items. Each item will have a different data format depending on the type of this Key.

Note that prior to 2.45 the behaviour of this function was different (and very wrong). Old scripts might need to be updated.

  • Mesh keys have a list of Vectors objects in the data block.
  • Lattice keys have a list of Vectors objects in the data block.
  • Curve keys return either a list of tuples, eacn containing four Vectors (if the curve is a Bezier curve), or otherwise just a list of Vectors.

    For bezier keys, the first three vectors in the tuple are the Bezier triple vectors, while the fourth vector's first element is the curve tilt (the other two elements are reserved and are currently unused).

    For non-Bezier keys, the first three elements of the returned vector is the curve handle point, while the fourth element is the tilt.

A word on relative shape keys; relative shape keys are not actually stored as offsets to the base shape key (like you'd expect). Instead, each shape key stores an entire model (actually the state of the mesh vertices after exiting editmode with any given key active).

The additive offset for a shape key is calculated (when needed) by comparing the shape key with its base key, which is always the very first in the keyblock list.


Instance Variable Details

curval

Current value of the corresponding IpoCurve. Read-only.
Type:
float

data

The data of the KeyBlock (see getData). This attribute is read-only.
Type:
varies

name

The name of the Keyblock. Truncated to 32 characters.
Type:
string

slidermax

The maximum value for the action slider. Value is clamped to the range [-10.0,10.0].
Type:
float

slidermin

The minimum value for the action slider. Value is clamped to the range [-10.0,10.0].
Type:
float