Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-07-08 14:03:29 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-07-08 14:03:29 +0400
commitb511fbea6d3e0185f8ba39405bc9f71dab7a5f20 (patch)
treeee404999004e76ccc6ff941d62b4d62d7afae69a /source/blender/editors/space_sequencer/sequencer_edit.c
parentff51a96d58f423a686cc9b195f0bf2361625fb1a (diff)
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.
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_edit.c')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 75774043c68..19b8e9d7a79 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -1117,6 +1117,15 @@ int sequencer_edit_poll(bContext *C)
return (seq_give_editing(CTX_data_scene(C), FALSE) != NULL);
}
+int sequencer_view_poll(bContext *C)
+{
+ SpaceSeq *sseq= CTX_wm_space_seq(C);
+ Editing *ed= seq_give_editing(CTX_data_scene(C), FALSE);
+ if (ed && sseq && (sseq->mainb == SEQ_DRAW_IMG_IMBUF))
+ return 1;
+
+ return 0;
+}
/* snap operator*/
static int sequencer_snap_exec(bContext *C, wmOperator *op)
@@ -2723,3 +2732,62 @@ void SEQUENCER_OT_swap_data(wmOperatorType *ot)
/* properties */
}
+/* borderselect operator */
+static int view_ghost_border_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+ Editing *ed= seq_give_editing(scene, FALSE);
+ View2D *v2d= UI_view2d_fromcontext(C);
+
+ rctf rect;
+
+ /* convert coordinates of rect to 'tot' rect coordinates */
+ UI_view2d_region_to_view(v2d, RNA_int_get(op->ptr, "xmin"), RNA_int_get(op->ptr, "ymin"), &rect.xmin, &rect.ymin);
+ UI_view2d_region_to_view(v2d, RNA_int_get(op->ptr, "xmax"), RNA_int_get(op->ptr, "ymax"), &rect.xmax, &rect.ymax);
+
+ if(ed==NULL)
+ return OPERATOR_CANCELLED;
+
+ rect.xmin /= (float)(ABS(v2d->tot.xmax - v2d->tot.xmin));
+ rect.ymin /= (float)(ABS(v2d->tot.ymax - v2d->tot.ymin));
+
+ rect.xmax /= (float)(ABS(v2d->tot.xmax - v2d->tot.xmin));
+ rect.ymax /= (float)(ABS(v2d->tot.ymax - v2d->tot.ymin));
+
+ rect.xmin+=0.5;
+ rect.xmax+=0.5;
+ rect.ymin+=0.5;
+ rect.ymax+=0.5;
+
+ CLAMP(rect.xmin, 0.0f, 1.0f);
+ CLAMP(rect.ymin, 0.0f, 1.0f);
+ CLAMP(rect.xmax, 0.0f, 1.0f);
+ CLAMP(rect.ymax, 0.0f, 1.0f);
+
+ scene->ed->over_border= rect;
+
+ WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+
+ return OPERATOR_FINISHED;
+}
+
+/* ****** Border Select ****** */
+void SEQUENCER_OT_view_ghost_border(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Border Offset View";
+ ot->idname= "SEQUENCER_OT_view_ghost_border";
+ ot->description="Enable border select mode";
+
+ /* api callbacks */
+ ot->invoke= WM_border_select_invoke;
+ ot->exec= view_ghost_border_exec;
+ ot->modal= WM_border_select_modal;
+ ot->poll= sequencer_view_poll;
+
+ /* flags */
+ ot->flag= 0;
+
+ /* rna */
+ WM_operator_properties_gesture_border(ot, FALSE);
+}