diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_sequencer.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 65 |
1 files changed, 65 insertions, 0 deletions
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"); } |