Reference/Release Notes/2.80/Python API/Animation API

= Blender 2.80: Animation & Rigging API =

Fix in PoseBone.bone Behavior
The `PoseBone.bone` property now correctly sets `id_data` of its result to the Armature ID, instead of keeping it pointing at the armature Object.

2.7x

2.8x

The main consequence is that now `object.pose.bones[...].bone.driver_add` correctly adds the driver to `object.data.animation_data` instead of `object.animation_data`.

Bone Matrix Utilities

 * Bone and PoseBone have new utility methods for bone roll math and B-Bone shape.
 * `Bone.MatrixFromAxisRoll`
 * `Bone.AxisRollFromMatrix`
 * `pose_bone.bbone_segment_matrix`
 * `pose_bone.compute_bbone_handles`


 * Bone provides access to the parent-child transformation math with arbitrary matrices.
 * `bone.convert_local_to_pose`

Keyframing Utilities

 * Added method for conversion between strip and scene time for NLA tweak mode.
 * `anim_data.nla_tweak_strip_time_to_scene`
 * Added more flags for use in `object.keyframe_insert`.
 * `INSERTKEY_REPLACE`, `INSERTKEY_AVAILABLE`, `INSERTKEY_CYCLE_AWARE`
 * Added a new `fcurve.is_empty` property for easily detecting when the curve contributes no animation due to lack of keyframes or useful modifiers, and should be deleted.
 * Such curves are now ignored by animation evaluation code, so this cleanup can be safely postponed until the end of a complex editing operator, even if it changes the current frame or otherwise triggers evaluation.

Misc

 * Hook Modifier now provides direct access to the bound vertex index array.
 * `hook.vertex_indices`, `hook.vertex_indices_set`


 * New method to delete all Shape Keys of an object at once.
 * `object.shape_key_clear`


 * New utility for creating a custom property with default value, limits and other UI settings in one call.
 * `from rna_prop_ui import rna_idprop_ui_create`