Expose `BKE_pose_apply_action_blend` and a simplified pose backup system
to RNA. This will make it possible to easily create some interactive
tools in Python for pose blending.
When creating a backup via this API, it is stored on the
`Object::runtime` struct. Any backup that was there before is freed
first. This way the Python code doesn't need access to the actual
`PoseBackup *`, simplifying memory management.
The limitation of having only a single backup shouldn't be too
problematic, as it is meant for things like interactive manipulation of
the current pose. Typical use looks like:
- Interactive operator starts, and creates a backup of the current pose.
- While the operator is running:
- The pose backup is restored, so that the next steps always use the
same reference pose.
- Depending on user input, determine a blend factor.
- Blend some pose from the pose library into the current pose.
- On confirmation, leave the pose as-is.
- On cancellation, restore the backup.
- Free the backup.
`BKE_pose_apply_action_blend` is exposed to RNA to make the above
possible.
An alternative approach would be to rely on the operator redo system.
However, since for poses this would use the global undo, it can get
prohibitively slow. This change is to make it easier to prototype
things; further into the future the undo system for poses should be
improved, but that's an entire project on its own.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D16900
4.7 KiB
4.7 KiB