From b3ba41ecd1e1ed1cbb28b9fe90efb3c4f4e596c8 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Tue, 4 May 2021 18:17:16 +0200 Subject: Fix missing background of buttons after reports Reports would change the active emboss of the Block, to make some of its buttons appear without background. But it didn't reset it so that buttons added afterwards wouldn't use the correct embossing. --- source/blender/editors/interface/interface_templates.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/editors') diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index caeb52ab7e9..0484565ee2e 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -6830,6 +6830,7 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) uiLayout *ui_abs = uiLayoutAbsolute(layout, false); uiBlock *block = uiLayoutGetBlock(ui_abs); + eUIEmbossType previous_emboss = UI_block_emboss_get(block); UI_fontstyle_set(&style->widgetlabel); int width = BLF_width(style->widgetlabel.uifont_id, report->message, report->len); @@ -6904,6 +6905,8 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) width + UI_UNIT_X, UI_UNIT_Y, "Show in Info Log"); + + UI_block_emboss_set(block, previous_emboss); } void uiTemplateInputStatus(uiLayout *layout, struct bContext *C) -- cgit v1.2.3 From d28c46183d8890114784692d0ebee27d4cc2cff9 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Tue, 4 May 2021 20:20:15 +0200 Subject: Fix missing header & footer toggle chevrons in Spreadsheet The little chevron tab to open a hidden region wouldn't show up in the Spreadsheet editor. Cause was an incorrect GPU-scissor usage: While drawing regions, the scissors should be kept enabled, just the scissor rectangle should be updated - and afterwards reset to what it was before. --- .../editors/space_spreadsheet/spreadsheet_draw.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_draw.cc b/source/blender/editors/space_spreadsheet/spreadsheet_draw.cc index d6379c740e8..b911c80fa63 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_draw.cc +++ b/source/blender/editors/space_spreadsheet/spreadsheet_draw.cc @@ -142,7 +142,9 @@ static void draw_left_column_content(const int scroll_offset_y, ARegion *region, const SpreadsheetDrawer &drawer) { - GPU_scissor_test(true); + int old_scissor[4]; + GPU_scissor_get(old_scissor); + GPU_scissor(0, 0, drawer.left_column_width, region->winy - drawer.top_row_height); uiBlock *left_column_block = UI_block_begin(C, region, __func__, UI_EMBOSS_NONE); @@ -165,7 +167,7 @@ static void draw_left_column_content(const int scroll_offset_y, UI_block_end(C, left_column_block); UI_block_draw(C, left_column_block); - GPU_scissor_test(false); + GPU_scissor(UNPACK4(old_scissor)); } static void draw_top_row_content(const bContext *C, @@ -173,7 +175,9 @@ static void draw_top_row_content(const bContext *C, const SpreadsheetDrawer &drawer, const int scroll_offset_x) { - GPU_scissor_test(true); + int old_scissor[4]; + GPU_scissor_get(old_scissor); + GPU_scissor(drawer.left_column_width + 1, region->winy - drawer.top_row_height, region->winx - drawer.left_column_width, @@ -200,7 +204,7 @@ static void draw_top_row_content(const bContext *C, UI_block_end(C, first_row_block); UI_block_draw(C, first_row_block); - GPU_scissor_test(false); + GPU_scissor(UNPACK4(old_scissor)); } static void draw_cell_contents(const bContext *C, @@ -209,7 +213,9 @@ static void draw_cell_contents(const bContext *C, const int scroll_offset_x, const int scroll_offset_y) { - GPU_scissor_test(true); + int old_scissor[4]; + GPU_scissor_get(old_scissor); + GPU_scissor(drawer.left_column_width + 1, 0, region->winx - drawer.left_column_width, @@ -248,7 +254,7 @@ static void draw_cell_contents(const bContext *C, UI_block_end(C, cells_block); UI_block_draw(C, cells_block); - GPU_scissor_test(false); + GPU_scissor(UNPACK4(old_scissor)); } static void update_view2d_tot_rect(const SpreadsheetDrawer &drawer, -- cgit v1.2.3 From 9576612d45dc062c85ec66250e2c9824ea4026a5 Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Wed, 5 May 2021 07:19:30 +0200 Subject: VSE: Set view transform based on strip colorspace In some cases, users start video editing work from General template, where Filmic view transform is chosen by default. Currently, this causes issue when working with sRGB footage, which are not properly decoded into linear working space and final render looks miscolored. When adding first strip, check it's colorspace and if it corresponds to colorspace for byte images, ensure that view transform is set to default value, which is Standard. Reviewed By: brecht Differential Revision: https://developer.blender.org/D11151 --- .../editors/space_sequencer/sequencer_add.c | 46 +++++++++++++++++----- 1 file changed, 37 insertions(+), 9 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 0b0c43d3417..ebd615e5f33 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -95,6 +95,7 @@ typedef struct SequencerAddData { #define SEQPROP_NOPATHS (1 << 2) #define SEQPROP_NOCHAN (1 << 3) #define SEQPROP_FIT_METHOD (1 << 4) +#define SEQPROP_VIEW_TRANSFORM (1 << 4) static const EnumPropertyItem scale_fit_methods[] = { {SEQ_SCALE_TO_FIT, "FIT", 0, "Scale to Fit", "Scale image to fit within the canvas"}, @@ -152,6 +153,14 @@ static void sequencer_generic_props__internal(wmOperatorType *ot, int flag) "Fit Method", "Scale fit method"); } + + if (flag & SEQPROP_VIEW_TRANSFORM) { + ot->prop = RNA_def_boolean(ot->srna, + "set_view_transform", + true, + "Set view transform", + "Set appropriate view transform based on media colorspace"); + } } static void sequencer_generic_invoke_path__internal(bContext *C, @@ -284,6 +293,11 @@ static void load_data_init_from_operator(SeqLoadData *load_data, bContext *C, wm load_data->flags |= SEQ_LOAD_MOVIE_SYNC_FPS; } + if ((prop = RNA_struct_find_property(op->ptr, "set_view_transform")) && + RNA_property_boolean_get(op->ptr, prop)) { + load_data->flags |= SEQ_LOAD_SET_VIEW_TRANSFORM; + } + if ((prop = RNA_struct_find_property(op->ptr, "use_multiview")) && RNA_property_boolean_get(op->ptr, prop)) { if (op->customdata) { @@ -368,8 +382,23 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } +static void sequencer_disable_one_time_properties(bContext *C, wmOperator *op) +{ + Editing *ed = SEQ_editing_get(CTX_data_scene(C), false); + /* Disable following properties if there are any existing strips, unless overridden by user. */ + if (ed && ed->seqbasep && ed->seqbasep->first) { + if (RNA_struct_find_property(op->ptr, "use_framerate")) { + RNA_boolean_set(op->ptr, "use_framerate", false); + } + if (RNA_struct_find_property(op->ptr, "set_view_transform")) { + RNA_boolean_set(op->ptr, "set_view_transform", false); + } + } +} + static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event) { + sequencer_disable_one_time_properties(C, op); if (!RNA_struct_property_is_set(op->ptr, "scene")) { return WM_enum_search_invoke(C, op, event); } @@ -702,13 +731,9 @@ static int sequencer_add_movie_strip_invoke(bContext *C, { PropertyRNA *prop; Scene *scene = CTX_data_scene(C); - Editing *ed = SEQ_editing_get(scene, false); - /* Only enable "use_framerate" if there aren't any existing strips, unless overridden by user. - */ - if (ed && ed->seqbasep && ed->seqbasep->first) { - RNA_boolean_set(op->ptr, "use_framerate", false); - } + sequencer_disable_one_time_properties(C, op); + RNA_enum_set(op->ptr, "fit_method", SEQ_tool_settings_fit_method_get(scene)); /* This is for drag and drop. */ @@ -777,7 +802,8 @@ void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot) WM_FILESEL_SHOW_PROPS | WM_FILESEL_DIRECTORY, FILE_DEFAULTDISPLAY, FILE_SORT_DEFAULT); - sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME | SEQPROP_FIT_METHOD); + sequencer_generic_props__internal( + ot, SEQPROP_STARTFRAME | SEQPROP_FIT_METHOD | SEQPROP_VIEW_TRANSFORM); RNA_def_boolean(ot->srna, "sound", true, "Sound", "Load sound with the movie"); RNA_def_boolean(ot->srna, "use_framerate", @@ -1055,6 +1081,8 @@ static int sequencer_add_image_strip_invoke(bContext *C, PropertyRNA *prop; Scene *scene = CTX_data_scene(C); + sequencer_disable_one_time_properties(C, op); + const SequencerToolSettings *tool_settings = scene->toolsettings->sequencer_tool_settings; RNA_enum_set(op->ptr, "fit_method", tool_settings->fit_method); @@ -1102,8 +1130,8 @@ void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot) WM_FILESEL_SHOW_PROPS | WM_FILESEL_DIRECTORY, FILE_DEFAULTDISPLAY, FILE_SORT_DEFAULT); - sequencer_generic_props__internal(ot, - SEQPROP_STARTFRAME | SEQPROP_ENDFRAME | SEQPROP_FIT_METHOD); + sequencer_generic_props__internal( + ot, SEQPROP_STARTFRAME | SEQPROP_ENDFRAME | SEQPROP_FIT_METHOD | SEQPROP_VIEW_TRANSFORM); RNA_def_boolean(ot->srna, "use_placeholders", -- cgit v1.2.3