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/editors/animation | |
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/editors/animation')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index fb4c0ae0758..3701e9dc91c 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -162,7 +162,7 @@ bAction *ED_id_action_ensure(Main *bmain, ID *id) * so that users can't accidentally break actions by assigning them * to the wrong places */ - adt->action->idroot = GS(id->name); + BKE_animdata_action_ensure_idroot(id, adt->action); /* Tag depsgraph to be rebuilt to include time dependency. */ DEG_relations_tag_update(bmain); |