Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-08-31 04:46:46 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-08-31 05:06:47 +0300
commitaabe6e3b457f1d4f1b860ed510bf2630a818465e (patch)
treeb32fca731f1e3e036de1f0d887b4b86644320512 /source/blender/editors/space_nla/nla_buttons.c
parent65739ded542728a6dcca892fe42e20ab7da7ad28 (diff)
Context: add "active_nla_track" & "active_nla_strip" context members
Selection was already accessible but not active. Add utility functions: - ANIM_nla_context_track to access the active track, following the convention of ANIM_nla_context_strip. - ANIM_nla_context_*_ptr versions of these functions, needed to for creating context members to access the ID pointer. Part of fix for T90723.
Diffstat (limited to 'source/blender/editors/space_nla/nla_buttons.c')
-rw-r--r--source/blender/editors/space_nla/nla_buttons.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c
index d019573bf93..215e865d194 100644
--- a/source/blender/editors/space_nla/nla_buttons.c
+++ b/source/blender/editors/space_nla/nla_buttons.c
@@ -185,10 +185,31 @@ bool nla_panel_context(const bContext *C,
return (found != 0);
}
+bool ANIM_nla_context_track_ptr(const bContext *C, PointerRNA *r_ptr)
+{
+ return nla_panel_context(C, NULL, r_ptr, NULL);
+}
+
+bool ANIM_nla_context_strip_ptr(const bContext *C, PointerRNA *r_ptr)
+{
+ return nla_panel_context(C, NULL, NULL, r_ptr);
+}
+
+NlaTrack *ANIM_nla_context_track(const bContext *C)
+{
+ PointerRNA track_ptr;
+ if (!ANIM_nla_context_track_ptr(C, &track_ptr)) {
+ return NULL;
+ }
+ NlaTrack *track = track_ptr.data;
+
+ return track;
+}
+
NlaStrip *ANIM_nla_context_strip(const bContext *C)
{
PointerRNA strip_ptr;
- if (!nla_panel_context(C, NULL, NULL, &strip_ptr)) {
+ if (!ANIM_nla_context_strip_ptr(C, &strip_ptr)) {
return NULL;
}
NlaStrip *strip = strip_ptr.data;