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/makesdna/DNA_anim_types.h | |
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/makesdna/DNA_anim_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_anim_types.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index 858daaac47c..7cb9978f768 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -1047,8 +1047,12 @@ typedef struct AnimOverride { * See blenkernel/intern/anim_sys.c for details. */ typedef struct AnimData { - /** active action - acts as the 'tweaking track' for the NLA */ + /** + * Active action - acts as the 'tweaking track' for the NLA. + * Either use BKE_animdata_set_action() to set this, or call BKE_animdata_action_ensure_idroot() + * after setting. */ bAction *action; + /** temp-storage for the 'real' active action (i.e. the one used before the tweaking-action * took over to be edited in the Animation Editors) */ |