diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-10-18 07:47:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-10-18 07:47:28 +0300 |
commit | e538b2c3a38f130787ca604b0e0182a74e9d6976 (patch) | |
tree | 60fa8f77f52e132d55d62d09cff1be5c4297fd2c /source | |
parent | c5a13ffcb4b98bbd46dca7637051a966d18cd46f (diff) |
Cleanup: internal sequencer naming for overlays
- Rename RNA SpaceSeq.show_strip_overlay to show_overlays
matching the 3D View, the term "strip" was misleading as this is used
for the preview as well.
- Rename various RNA overlay settings to overlay_frame
since "Frame Offset" is a specific feature, avoid having both
Editor.show_overlay and SpaceSeq.show_overlays.
- Rename Editing `over_*` -> `overlay_frame_*` in DNA,
as well as flags.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_buttons.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 25 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_view.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/space_sequencer.c | 15 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_sequence_types.h | 14 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 12 | ||||
-rw-r--r-- | source/blender/makesdna/intern/dna_rename_defs.h | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 32 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 16 |
9 files changed, 68 insertions, 58 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_buttons.c b/source/blender/editors/space_sequencer/sequencer_buttons.c index f0940cd9f55..4ece7f6a481 100644 --- a/source/blender/editors/space_sequencer/sequencer_buttons.c +++ b/source/blender/editors/space_sequencer/sequencer_buttons.c @@ -78,9 +78,10 @@ static void metadata_panel_context_draw(const bContext *C, Panel *panel) SpaceSeq *space_sequencer = CTX_wm_space_seq(C); /* NOTE: We can only reliably show metadata for the original (current) * frame when split view is used. */ - const bool show_split = (scene->ed && (scene->ed->over_flag & SEQ_EDIT_USE_FRAME_OVERLAY) && + const bool show_split = (scene->ed && + (scene->ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_SHOW) && (space_sequencer->mainb == SEQ_DRAW_IMG_IMBUF)); - if (show_split && space_sequencer->overlay_type == SEQ_DRAW_OVERLAY_REFERENCE) { + if (show_split && (space_sequencer->overlay_frame_type == SEQ_OVERLAY_FRAME_TYPE_REFERENCE)) { return; } /* NOTE: We disable multiview for drawing, since we don't know what is the diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 922b6b251ed..7117323c214 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1862,15 +1862,15 @@ static void sequencer_preview_get_rect(rctf *preview, sequencer_display_size(scene, viewrect); BLI_rctf_init(preview, -1.0f, 1.0f, -1.0f, 1.0f); - if (draw_overlay && sseq->overlay_type == SEQ_DRAW_OVERLAY_RECT) { + if (draw_overlay && (sseq->overlay_frame_type == SEQ_OVERLAY_FRAME_TYPE_RECT)) { preview->xmax = v2d->tot.xmin + - (fabsf(BLI_rctf_size_x(&v2d->tot)) * scene->ed->over_border.xmax); + (fabsf(BLI_rctf_size_x(&v2d->tot)) * scene->ed->overlay_frame_rect.xmax); preview->xmin = v2d->tot.xmin + - (fabsf(BLI_rctf_size_x(&v2d->tot)) * scene->ed->over_border.xmin); + (fabsf(BLI_rctf_size_x(&v2d->tot)) * scene->ed->overlay_frame_rect.xmin); preview->ymax = v2d->tot.ymin + - (fabsf(BLI_rctf_size_y(&v2d->tot)) * scene->ed->over_border.ymax); + (fabsf(BLI_rctf_size_y(&v2d->tot)) * scene->ed->overlay_frame_rect.ymax); preview->ymin = v2d->tot.ymin + - (fabsf(BLI_rctf_size_y(&v2d->tot)) * scene->ed->over_border.ymin); + (fabsf(BLI_rctf_size_y(&v2d->tot)) * scene->ed->overlay_frame_rect.ymin); } else if (draw_backdrop) { float aspect = BLI_rcti_size_x(®ion->winrct) / (float)BLI_rcti_size_y(®ion->winrct); @@ -1958,8 +1958,8 @@ static void sequencer_draw_display_buffer(const bContext *C, rctf canvas; sequencer_preview_get_rect(&preview, scene, region, sseq, draw_overlay, draw_backdrop); - if (draw_overlay && sseq->overlay_type == SEQ_DRAW_OVERLAY_RECT) { - canvas = scene->ed->over_border; + if (draw_overlay && (sseq->overlay_frame_type == SEQ_OVERLAY_FRAME_TYPE_RECT)) { + canvas = scene->ed->overlay_frame_rect; } else { BLI_rctf_init(&canvas, 0.0f, 1.0f, 0.0f, 1.0f); @@ -2207,7 +2207,8 @@ void sequencer_draw_preview(const bContext *C, UI_view2d_view_ortho(v2d); /* Draw background. */ - if (!draw_backdrop && (!draw_overlay || sseq->overlay_type == SEQ_DRAW_OVERLAY_REFERENCE)) { + if (!draw_backdrop && + (!draw_overlay || (sseq->overlay_frame_type == SEQ_OVERLAY_FRAME_TYPE_REFERENCE))) { sequencer_preview_clear(); if (sseq->flag & SEQ_USE_ALPHA) { @@ -2685,9 +2686,9 @@ static void draw_cache_view(const bContext *C) /* Draw sequencer timeline. */ static void draw_overlap_frame_indicator(const struct Scene *scene, const View2D *v2d) { - int overlap_frame = (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) ? - scene->ed->over_cfra : - scene->r.cfra + scene->ed->over_ofs; + int overlap_frame = (scene->ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_ABS) ? + scene->ed->overlay_frame_abs : + scene->r.cfra + scene->ed->overlay_frame_ofs; uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR); @@ -2807,7 +2808,7 @@ void draw_timeline_seq_display(const bContext *C, ARegion *region) if (scene->ed != NULL) { UI_view2d_view_ortho(v2d); draw_cache_view(C); - if (scene->ed->over_flag & SEQ_EDIT_USE_FRAME_OVERLAY) { + if (scene->ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_SHOW) { draw_overlap_frame_indicator(scene, v2d); } UI_view2d_view_restore(C); diff --git a/source/blender/editors/space_sequencer/sequencer_view.c b/source/blender/editors/space_sequencer/sequencer_view.c index 981f793c896..79593b0bbb0 100644 --- a/source/blender/editors/space_sequencer/sequencer_view.c +++ b/source/blender/editors/space_sequencer/sequencer_view.c @@ -380,7 +380,7 @@ static int view_ghost_border_exec(bContext *C, wmOperator *op) CLAMP(rect.xmax, 0.0f, 1.0f); CLAMP(rect.ymax, 0.0f, 1.0f); - scene->ed->over_border = rect; + scene->ed->overlay_frame_rect = rect; WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 3ed8b35c9bf..c876bf7d483 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -783,25 +783,26 @@ static void sequencer_preview_region_draw(const bContext *C, ARegion *region) wmWindowManager *wm = CTX_wm_manager(C); const bool draw_overlay = sseq->flag & SEQ_SHOW_OVERLAY; const bool draw_frame_overlay = (scene->ed && - (scene->ed->over_flag & SEQ_EDIT_USE_FRAME_OVERLAY) && + (scene->ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_SHOW) && draw_overlay); const bool is_playing = ED_screen_animation_playing(wm); - if (!draw_frame_overlay || sseq->overlay_type != SEQ_DRAW_OVERLAY_REFERENCE) { + if (!(draw_frame_overlay && (sseq->overlay_frame_type == SEQ_OVERLAY_FRAME_TYPE_REFERENCE))) { sequencer_draw_preview(C, scene, region, sseq, scene->r.cfra, 0, false, false); } - if (draw_frame_overlay && sseq->overlay_type != SEQ_DRAW_OVERLAY_CURRENT) { + if (draw_frame_overlay && sseq->overlay_frame_type != SEQ_OVERLAY_FRAME_TYPE_CURRENT) { int over_cfra; - if (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) { - over_cfra = scene->ed->over_cfra; + if (scene->ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_ABS) { + over_cfra = scene->ed->overlay_frame_abs; } else { - over_cfra = scene->r.cfra + scene->ed->over_ofs; + over_cfra = scene->r.cfra + scene->ed->overlay_frame_ofs; } - if (over_cfra != scene->r.cfra || sseq->overlay_type != SEQ_DRAW_OVERLAY_RECT) { + if ((over_cfra != scene->r.cfra) || + (sseq->overlay_frame_type != SEQ_OVERLAY_FRAME_TYPE_RECT)) { sequencer_draw_preview( C, scene, region, sseq, scene->r.cfra, over_cfra - scene->r.cfra, true, false); } diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index e363ed5ddfd..af01bb76680 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -289,9 +289,11 @@ typedef struct Editing { /** 1024 = FILE_MAX. */ char proxy_dir[1024]; - int over_ofs, over_cfra; - int over_flag, proxy_storage; - rctf over_border; + int proxy_storage; + + int overlay_frame_ofs, overlay_frame_abs; + int overlay_frame_flag; + rctf overlay_frame_rect; struct SeqCache *cache; @@ -502,9 +504,9 @@ typedef struct SequencerScopes { #define SELECT 1 -/* Editor->over_flag */ -#define SEQ_EDIT_USE_FRAME_OVERLAY 1 -#define SEQ_EDIT_OVERLAY_ABS 2 +/** #Editor.overlay_frame_flag */ +#define SEQ_EDIT_OVERLAY_FRAME_SHOW 1 +#define SEQ_EDIT_OVERLAY_FRAME_ABS 2 #define SEQ_STRIP_OFSBOTTOM 0.05f #define SEQ_STRIP_OFSTOP 0.95f diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index ff06e88ab39..a75f52a5036 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -642,7 +642,7 @@ typedef struct SpaceSeq { float zoom DNA_DEPRECATED; /** See SEQ_VIEW_* below. */ char view; - char overlay_type; + char overlay_frame_type; /** Overlay an image of the editing on below the strips. */ char draw_flag; char gizmo_flag; @@ -740,11 +740,11 @@ enum { }; /* SpaceSeq.mainb */ -typedef enum eSpaceSeq_OverlayType { - SEQ_DRAW_OVERLAY_RECT = 0, - SEQ_DRAW_OVERLAY_REFERENCE = 1, - SEQ_DRAW_OVERLAY_CURRENT = 2, -} eSpaceSeq_OverlayType; +typedef enum eSpaceSeq_OverlayFrameType { + SEQ_OVERLAY_FRAME_TYPE_RECT = 0, + SEQ_OVERLAY_FRAME_TYPE_REFERENCE = 1, + SEQ_OVERLAY_FRAME_TYPE_CURRENT = 2, +} eSpaceSeq_OverlayFrameType; /** \} */ diff --git a/source/blender/makesdna/intern/dna_rename_defs.h b/source/blender/makesdna/intern/dna_rename_defs.h index 2feebbfd4f4..9b8bfb5af15 100644 --- a/source/blender/makesdna/intern/dna_rename_defs.h +++ b/source/blender/makesdna/intern/dna_rename_defs.h @@ -73,6 +73,10 @@ DNA_STRUCT_RENAME_ELEM(Curve, len_wchar, len_char32) DNA_STRUCT_RENAME_ELEM(Camera, clipend, clip_end) DNA_STRUCT_RENAME_ELEM(Camera, clipsta, clip_start) DNA_STRUCT_RENAME_ELEM(Collection, dupli_ofs, instance_offset) +DNA_STRUCT_RENAME_ELEM(Editing, over_border, overlay_frame_rect) +DNA_STRUCT_RENAME_ELEM(Editing, over_cfra, overlay_frame_abs) +DNA_STRUCT_RENAME_ELEM(Editing, over_flag, overlay_frame_flag) +DNA_STRUCT_RENAME_ELEM(Editing, over_ofs, overlay_frame_ofs) DNA_STRUCT_RENAME_ELEM(FluidDomainSettings, cache_frame_pause_guiding, cache_frame_pause_guide) DNA_STRUCT_RENAME_ELEM(FluidDomainSettings, guiding_alpha, guide_alpha) DNA_STRUCT_RENAME_ELEM(FluidDomainSettings, guiding_beta, guide_beta) @@ -92,6 +96,7 @@ DNA_STRUCT_RENAME_ELEM(Object, restrictflag, visibility_flag) DNA_STRUCT_RENAME_ELEM(ParticleSettings, dup_group, instance_collection) DNA_STRUCT_RENAME_ELEM(ParticleSettings, dup_ob, instance_object) DNA_STRUCT_RENAME_ELEM(ParticleSettings, dupliweights, instance_weights) +DNA_STRUCT_RENAME_ELEM(SpaceSeq, overlay_type, overlay_frame_type) DNA_STRUCT_RENAME_ELEM(Text, name, filepath) DNA_STRUCT_RENAME_ELEM(ThemeSpace, scrubbing_background, time_scrub_background) DNA_STRUCT_RENAME_ELEM(ThemeSpace, show_back_grad, background_type) diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index c9bcd5e0a0d..cc302c4dd89 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -1121,13 +1121,13 @@ static void rna_SequenceEditor_overlay_lock_set(PointerRNA *ptr, bool value) } /* convert from abs to relative and back */ - if ((ed->over_flag & SEQ_EDIT_OVERLAY_ABS) == 0 && value) { - ed->over_cfra = scene->r.cfra + ed->over_ofs; - ed->over_flag |= SEQ_EDIT_OVERLAY_ABS; + if ((ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_ABS) == 0 && value) { + ed->overlay_frame_abs = scene->r.cfra + ed->overlay_frame_ofs; + ed->overlay_frame_flag |= SEQ_EDIT_OVERLAY_FRAME_ABS; } - else if ((ed->over_flag & SEQ_EDIT_OVERLAY_ABS) && !value) { - ed->over_ofs = ed->over_cfra - scene->r.cfra; - ed->over_flag &= ~SEQ_EDIT_OVERLAY_ABS; + else if ((ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_ABS) && !value) { + ed->overlay_frame_ofs = ed->overlay_frame_abs - scene->r.cfra; + ed->overlay_frame_flag &= ~SEQ_EDIT_OVERLAY_FRAME_ABS; } } @@ -1140,11 +1140,11 @@ static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr) return scene->r.cfra; } - if (ed->over_flag & SEQ_EDIT_OVERLAY_ABS) { - return ed->over_cfra - scene->r.cfra; + if (ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_ABS) { + return ed->overlay_frame_abs - scene->r.cfra; } else { - return ed->over_ofs; + return ed->overlay_frame_ofs; } } @@ -1157,11 +1157,11 @@ static void rna_SequenceEditor_overlay_frame_set(PointerRNA *ptr, int value) return; } - if (ed->over_flag & SEQ_EDIT_OVERLAY_ABS) { - ed->over_cfra = (scene->r.cfra + value); + if (ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_ABS) { + ed->overlay_frame_abs = (scene->r.cfra + value); } else { - ed->over_ofs = value; + ed->overlay_frame_ofs = value; } } @@ -2113,14 +2113,14 @@ static void rna_def_editor(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Strip", "Sequencer's active strip"); - prop = RNA_def_property(srna, "show_overlay", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_USE_FRAME_OVERLAY); + prop = RNA_def_property(srna, "show_overlay_frame", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "overlay_frame_flag", SEQ_EDIT_OVERLAY_FRAME_SHOW); RNA_def_property_ui_text( prop, "Show Overlay", "Partial overlay on top of the sequencer with a frame offset"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); - prop = RNA_def_property(srna, "use_overlay_lock", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_ABS); + prop = RNA_def_property(srna, "use_overlay_frame_lock", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "overlay_frame_flag", SEQ_EDIT_OVERLAY_FRAME_ABS); RNA_def_property_ui_text(prop, "Overlay Lock", ""); RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_overlay_lock_set"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 8f9d4addd30..3255bc30d4c 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -5531,10 +5531,10 @@ static void rna_def_space_sequencer(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; - static const EnumPropertyItem overlay_type_items[] = { - {SEQ_DRAW_OVERLAY_RECT, "RECTANGLE", 0, "Rectangle", "Show rectangle area overlay"}, - {SEQ_DRAW_OVERLAY_REFERENCE, "REFERENCE", 0, "Reference", "Show reference frame only"}, - {SEQ_DRAW_OVERLAY_CURRENT, "CURRENT", 0, "Current", "Show current frame only"}, + static const EnumPropertyItem overlay_frame_type_items[] = { + {SEQ_OVERLAY_FRAME_TYPE_RECT, "RECTANGLE", 0, "Rectangle", "Show rectangle area overlay"}, + {SEQ_OVERLAY_FRAME_TYPE_REFERENCE, "REFERENCE", 0, "Reference", "Show reference frame only"}, + {SEQ_OVERLAY_FRAME_TYPE_CURRENT, "CURRENT", 0, "Current", "Show current frame only"}, {0, NULL, 0, NULL, NULL}, }; @@ -5654,9 +5654,9 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Grease Pencil", "Grease Pencil data for this Preview region"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); - prop = RNA_def_property(srna, "overlay_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "overlay_type"); - RNA_def_property_enum_items(prop, overlay_type_items); + prop = RNA_def_property(srna, "overlay_frame_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "overlay_frame_type"); + RNA_def_property_enum_items(prop, overlay_frame_type_items); RNA_def_property_ui_text(prop, "Overlay Type", "Overlay display method"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); @@ -5692,7 +5692,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); /* Overlay settings. */ - prop = RNA_def_property(srna, "show_strip_overlay", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_OVERLAY); RNA_def_property_ui_text(prop, "Show Overlay", ""); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); |