diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2021-05-03 00:03:00 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2021-11-24 15:58:32 +0300 |
commit | 5d59b38605d61b2aeabfa1cb572b5a0d9158424b (patch) | |
tree | 82b0a19eb0e5dd7290ae81c10427082576d8dfb5 /source/blender/editors/include | |
parent | 057cb7e5e77bcf932882292a774156b5d8c90ab4 (diff) |
Animation: allow manually setting the intended playback range for actions.
Some operations, e.g. adding a new action strip to NLA, require
knowing the active frame range of an action. However, currently it
can only be deduced by scanning the keyframes of the curves within
it. This is not ideal if e.g. curves are staggered for overlap.
As suggested by Nathan Vegdahl in comments to T54724, this patch adds
Action properties that allow manually specifying its active frame range.
The settings are exposed via a panel in the Dopesheet and Action Editor.
When enabled, the range is highlighted in the background using a striped
fill to distinguish it from the solid filled regular playback range.
When set, the frame range is used when adding or updating NLA tracks,
and by add-ons using `Action.frame_range`, e.g. FBX exporter.
Differential Revision: https://developer.blender.org/D11803
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/ED_anim_api.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 5d5d9140a24..cab4c18211d 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -676,6 +676,10 @@ void ANIM_draw_previewrange(const struct bContext *C, struct View2D *v2d, int en /* main call to draw normal frame range indicators */ void ANIM_draw_framerange(struct Scene *scene, struct View2D *v2d); +/* Draw manually set intended playback frame range indicators for the action. */ +void ANIM_draw_action_framerange( + struct AnimData *adt, struct bAction *action, struct View2D *v2d, float ymin, float ymax); + /* ************************************************* */ /* F-MODIFIER TOOLS */ @@ -864,7 +868,8 @@ void ED_operatormacros_action(void); /* XXX: Should we be doing these here, or at all? */ /* Action Editor - Action Management */ -struct AnimData *ED_actedit_animdata_from_context(struct bContext *C, struct ID **r_adt_id_owner); +struct AnimData *ED_actedit_animdata_from_context(const struct bContext *C, + struct ID **r_adt_id_owner); void ED_animedit_unlink_action(struct bContext *C, struct ID *id, struct AnimData *adt, |