From b511fbea6d3e0185f8ba39405bc9f71dab7a5f20 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 8 Jul 2010 10:03:29 +0000 Subject: Sequencer display overlay option, this can show a border area from another time to help compare for color grading. - Okey sets the border in the display. - Okey resets the frame offset in the sequencer timeline. - ghost icon in the header can enable/disable. - frame offset can be relative or absolute (lock icon) Not very happy that this commit adds a call to BKE_animsys_evaluate_animdata(scene, ...) in do_build_seq_array_recursively() without this the offset frames dont have fcurves applied. Though we will need something like this for prefetch frames to work too. --- source/blender/makesrna/intern/rna_sequencer.c | 65 ++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'source/blender/makesrna/intern/rna_sequencer.c') diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index c8b7299b539..0c60f04c2c2 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -521,6 +521,55 @@ static char *rna_SequenceColorBalance_path(PointerRNA *ptr) return BLI_strdup(""); } +static void rna_SequenceEditor_overlay_lock_set(PointerRNA *ptr, int value) +{ + Scene *scene= ptr->id.data; + Editing *ed= seq_give_editing(scene, FALSE); + + if(ed==NULL) + return; + + /* 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; + } + 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; + } +} + +static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr) +{ + Scene *scene= (Scene *)ptr->id.data; + Editing *ed= seq_give_editing(scene, FALSE); + + if(ed==NULL) + return scene->r.cfra; + + if(ed->over_flag & SEQ_EDIT_OVERLAY_ABS) + return ed->over_cfra - scene->r.cfra; + else + return ed->over_ofs; + +} + +static void rna_SequenceEditor_overlay_frame_set(PointerRNA *ptr, int value) +{ + Scene *scene= (Scene *)ptr->id.data; + Editing *ed= seq_give_editing(scene, FALSE); + + if(ed==NULL) + return; + + + if(ed->over_flag & SEQ_EDIT_OVERLAY_ABS) + ed->over_cfra= (scene->r.cfra + value); + else + ed->over_ofs= value; +} + #else static void rna_def_strip_element(BlenderRNA *brna) @@ -887,6 +936,22 @@ static void rna_def_editor(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "act_seq"); RNA_def_property_flag(prop, PROP_EDITABLE); + prop= RNA_def_property(srna, "show_overlay", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_SHOW); + RNA_def_property_ui_text(prop, "Draw Axes", "Partial overlay ontop of the sequencer"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); + + prop= RNA_def_property(srna, "overlay_lock", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_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); + + /* access to fixed and relative frame */ + prop= RNA_def_property(srna, "overlay_frame", PROP_INT, PROP_NONE); + RNA_def_property_ui_text(prop, "Overlay Offset", ""); + RNA_def_property_int_funcs(prop, "rna_SequenceEditor_overlay_frame_get", "rna_SequenceEditor_overlay_frame_set", NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); RNA_def_property_ui_text(prop, "Active Strip", "Sequencers active strip"); } -- cgit v1.2.3