There are number of changes here (as separate commits) which are
making motion paths way faster for animators working on animation
training here in the studio.
One implemented direction of speedup here is building a dependency
graph from a given subset of IDs. This is more clean implementation
of filtering API which existed during Spring project but which later
on got reverted due to design conflicts with other areas.
This new approach has way smaller footprint and faster graph
construction as well, which opens a door for updating motion path in
several threads (multi-threading is not yet implemented, still need
to be careful about it due to increasing memory footprint).
Another direction which is implemented in this patchset is to only
update frame range of motion path which is changed due to user
transform as an opposite of old behavior when the entire motion path
would have been updated after translating a single bone.
This is happening based on a keyframes for motion path target.
Calculation of such range is a bit tricky and is not yet optimal
and is done as following:
- For every motion path target we iterate over f-curves and calculate frame range between 2nd keyframes counted from the current frame (if acceleration smoothing is enabled it is 4th keyframes).
- We choose widest range from the ranges of individual f-curves.
Ideally, we would only consider f-curves which are affected by the
auto-keying feature. This can be implemented later on based on the
changes in this patchset.
With the current animation file for training moving bone in pose
mode with motion path enabled brings update from 11 sec to 0.7 sec.
Extra speedup is possible if the acceleration smoothing on f-curves
is disabled (it's not something our animators want anyway) and in
that case the update time goes down to 0.4 sec.