From 4a7c5d3d3d2cd0b29bc753235f954bca3759ca3d Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 19 Mar 2024 14:05:42 +0100 Subject: [PATCH] Fix #119534: Action Editor empty channels region without active action Caused by a96f1208cc72 For `SPACE_ACTION` (`SACTCONT_ACTION`), `actedit_get_context` will return true, but `ANIM_animdata_context_getdata` also checks the `bAnimContext` data [which in this case is the action], so will **not** return true. As a result we are skipping drawing the background and the search, which is now done again. Pull Request: https://projects.blender.org/blender/blender/pulls/119621 --- .../blender/editors/space_action/space_action.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source/blender/editors/space_action/space_action.cc b/source/blender/editors/space_action/space_action.cc index 8df31fcd1cd..bca5bd1f35b 100644 --- a/source/blender/editors/space_action/space_action.cc +++ b/source/blender/editors/space_action/space_action.cc @@ -283,15 +283,20 @@ static void action_channel_region_draw(const bContext *C, ARegion *region) { /* draw entirely, view changes should be handled here */ bAnimContext ac; - if (!ANIM_animdata_get_context(C, &ac)) { + const bool has_valid_animcontext = ANIM_animdata_get_context(C, &ac); + + /* clear and setup matrix */ + UI_ThemeClearColor(TH_BACK); + + /* channel filter next to scrubbing area */ + ED_time_scrub_channel_search_draw(C, region, ac.ads); + + if (!has_valid_animcontext) { return; } View2D *v2d = ®ion->v2d; - /* clear and setup matrix */ - UI_ThemeClearColor(TH_BACK); - ListBase anim_data = {nullptr, nullptr}; /* Build list of channels to draw. */ const eAnimFilter_Flags filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | @@ -305,9 +310,6 @@ static void action_channel_region_draw(const bContext *C, ARegion *region) UI_view2d_view_ortho(v2d); draw_channel_names((bContext *)C, &ac, region, anim_data); - /* channel filter next to scrubbing area */ - ED_time_scrub_channel_search_draw(C, region, ac.ads); - /* reset view matrix */ UI_view2d_view_restore(C);