From b9049411a8bdc61e2acfa9fba1d3084c63f45ccb Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Thu, 18 May 2023 18:08:27 +0200 Subject: [PATCH 1/2] I18n: disambiguate more "A" and "B" messages In dd32dac60f, the "A" and "B" input socket from the Mix node were disambiguated, so as not to confuse them with Alpha and Blue. These messages are used in other nodes and elsewhere in the same sense, so this commit adds translation contexts to these occurrences as well. Pull Request: https://projects.blender.org/blender/blender/pulls/108051 --- .../blender/editors/animation/fmodifier_ui.c | 4 ++-- .../nodes/function/nodes/node_fn_compare.cc | 24 +++++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index de09b1baa67..69518d251e4 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -397,8 +397,8 @@ static void generator_panel_draw(const bContext *C, Panel *panel) uiLayoutColumn(split, false); uiLayout *title_col = uiLayoutColumn(split, false); uiLayout *title_row = uiLayoutRow(title_col, true); - uiItemL(title_row, IFACE_("A"), ICON_NONE); - uiItemL(title_row, IFACE_("B"), ICON_NONE); + uiItemL(title_row, CTX_IFACE_(BLT_I18NCONTEXT_ID_ACTION, "A"), ICON_NONE); + uiItemL(title_row, CTX_IFACE_(BLT_I18NCONTEXT_ID_ACTION, "B"), ICON_NONE); } uiLayout *first_row = uiLayoutRow(col, true); diff --git a/source/blender/nodes/function/nodes/node_fn_compare.cc b/source/blender/nodes/function/nodes/node_fn_compare.cc index 931483657c6..f9ae0c3e10a 100644 --- a/source/blender/nodes/function/nodes/node_fn_compare.cc +++ b/source/blender/nodes/function/nodes/node_fn_compare.cc @@ -7,6 +7,8 @@ #include "BLI_string.h" #include "BLI_string_utf8.h" +#include "BLT_translation.h" + #include "UI_interface.h" #include "UI_resources.h" @@ -23,20 +25,22 @@ NODE_STORAGE_FUNCS(NodeFunctionCompare) static void node_declare(NodeDeclarationBuilder &b) { b.is_function_node(); - b.add_input("A").min(-10000.0f).max(10000.0f); - b.add_input("B").min(-10000.0f).max(10000.0f); + b.add_input("A").min(-10000.0f).max(10000.0f).translation_context( + BLT_I18NCONTEXT_ID_NODETREE); + b.add_input("B").min(-10000.0f).max(10000.0f).translation_context( + BLT_I18NCONTEXT_ID_NODETREE); - b.add_input("A", "A_INT"); - b.add_input("B", "B_INT"); + b.add_input("A", "A_INT").translation_context(BLT_I18NCONTEXT_ID_NODETREE); + b.add_input("B", "B_INT").translation_context(BLT_I18NCONTEXT_ID_NODETREE); - b.add_input("A", "A_VEC3"); - b.add_input("B", "B_VEC3"); + b.add_input("A", "A_VEC3").translation_context(BLT_I18NCONTEXT_ID_NODETREE); + b.add_input("B", "B_VEC3").translation_context(BLT_I18NCONTEXT_ID_NODETREE); - b.add_input("A", "A_COL"); - b.add_input("B", "B_COL"); + b.add_input("A", "A_COL").translation_context(BLT_I18NCONTEXT_ID_NODETREE); + b.add_input("B", "B_COL").translation_context(BLT_I18NCONTEXT_ID_NODETREE); - b.add_input("A", "A_STR"); - b.add_input("B", "B_STR"); + b.add_input("A", "A_STR").translation_context(BLT_I18NCONTEXT_ID_NODETREE); + b.add_input("B", "B_STR").translation_context(BLT_I18NCONTEXT_ID_NODETREE); b.add_input("C").default_value(0.9f); b.add_input("Angle").default_value(0.0872665f).subtype(PROP_ANGLE); From 9692262b9d9bd8a56412b09def60ba5bc51e48b5 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 22 May 2023 13:59:41 +0200 Subject: [PATCH 2/2] Fix #108122: onion skin disappears after scrubbing timeline This was broken in 037b3f87bd58e003d8fe8ca725dfa59969657e6c. --- source/blender/editors/animation/anim_ops.c | 48 ++++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 04e9122c994..22c9217dc35 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -203,16 +203,13 @@ static void change_frame_seq_preview_begin(bContext *C, const wmEvent *event, Sp } } -static void change_frame_seq_preview_end(bContext *C, SpaceSeq *sseq) +static void change_frame_seq_preview_end(SpaceSeq *sseq) { BLI_assert(sseq != NULL); UNUSED_VARS_NDEBUG(sseq); if (ED_sequencer_special_preview_get() != NULL) { ED_sequencer_special_preview_clear(); } - - Scene *scene = CTX_data_scene(C); - WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene); } static bool use_sequencer_snapping(bContext *C) @@ -260,6 +257,36 @@ static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event return OPERATOR_RUNNING_MODAL; } +static bool need_extra_redraw_after_scrubbing_ends(bContext *C) +{ + if (CTX_wm_space_seq(C)) { + /* During scrubbing in the sequencer, a preview of the final video might be drawn. After + * scrubbing, the actual result should be shown again. */ + return true; + } + wmWindowManager *wm = CTX_wm_manager(C); + Object *object = CTX_data_active_object(C); + if (object && object->type == OB_GPENCIL_LEGACY) { + LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { + bScreen *screen = WM_window_get_active_screen(win); + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + SpaceLink *sl = (SpaceLink *)area->spacedata.first; + if (sl->spacetype == SPACE_VIEW3D) { + View3D *v3d = (View3D *)sl; + if ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) { + if (v3d->gp_flag & V3D_GP_SHOW_ONION_SKIN) { + /* Grease pencil onion skin is not drawn during scrubbing. Redraw is necessary after + * scrubbing ends to show onion skin again. */ + return true; + } + } + } + } + } + } + return false; +} + static void change_frame_cancel(bContext *C, wmOperator *UNUSED(op)) { bScreen *screen = CTX_wm_screen(C); @@ -267,7 +294,12 @@ static void change_frame_cancel(bContext *C, wmOperator *UNUSED(op)) SpaceSeq *sseq = CTX_wm_space_seq(C); if (sseq != NULL) { - change_frame_seq_preview_end(C, sseq); + change_frame_seq_preview_end(sseq); + } + + if (need_extra_redraw_after_scrubbing_ends(C)) { + Scene *scene = CTX_data_scene(C); + WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene); } } @@ -323,7 +355,11 @@ static int change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event) SpaceSeq *sseq = CTX_wm_space_seq(C); if (sseq != NULL) { - change_frame_seq_preview_end(C, sseq); + change_frame_seq_preview_end(sseq); + } + if (need_extra_redraw_after_scrubbing_ends(C)) { + Scene *scene = CTX_data_scene(C); + WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene); } }