diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-09-25 12:07:32 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-09-25 15:20:59 +0300 |
commit | 64583f3e8d0f337a977c9a90b874bee733a37402 (patch) | |
tree | 3356dd4b14ed5f0cbaf0236b2ac51f7f4dad1ec0 /source/blender/blenkernel/intern/action.c | |
parent | 5419f9a845ed58205ffbf38497ce9ff595499466 (diff) |
Animation: set Action `idroot` at assignment instead of just at evaluation
Actions are either locked to a specific ID type, or "floating". Actions
in the floating state are now locked when they are assigned to an ID block.
Previously (rB94b99b5d4a7c20cf2) this was done at evaluation time, which
caused various problems:
- The ID type was set on the evaluated copy, and inconsistently flushed
back to the original.
- A newly created Action could not be assigned to an Action constraint,
unless a depsgraph evaluation was be forced first.
This is now resolved by calling `BKE_animdata_set_action()` to set the
action (instead of direct assignment) where possible, and calling
`BKE_animdata_action_ensure_idroot()` otherwise.
Manifest Task: https://developer.blender.org/T80986
Diffstat (limited to 'source/blender/blenkernel/intern/action.c')
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 64a8ae15fd3..1ce0d07a135 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -47,6 +47,7 @@ #include "BLT_translation.h" #include "BKE_action.h" +#include "BKE_anim_data.h" #include "BKE_anim_visualization.h" #include "BKE_animsys.h" #include "BKE_armature.h" @@ -1817,6 +1818,7 @@ void what_does_obaction(Object *ob, workob->adt = &adt; adt.action = act; + BKE_animdata_action_ensure_idroot(&workob->id, act); /* execute effects of Action on to workob (or it's PoseChannels) */ BKE_animsys_evaluate_animdata(&workob->id, &adt, anim_eval_context, ADT_RECALC_ANIM, false); |