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>2012-06-07 23:24:49 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-07 23:24:49 +0400
commit36db2a2cff58d3bd3dd0f7e8e0d2fbec36e32412 (patch)
tree5430539bfad43c3bcbae3ee54d6a0f458a67a43a /source/blender/editors/space_sequencer/space_sequencer.c
parent186f542b791a97ea151bcc9a28b6a7edcfdb358b (diff)
initial support for editing masks in the sequencer, currently only draw the mask.
Diffstat (limited to 'source/blender/editors/space_sequencer/space_sequencer.c')
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index cc59a05b781..3643f92d334 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -33,6 +33,7 @@
#include <stdio.h>
#include "DNA_scene_types.h"
+#include "DNA_mask_types.h"
#include "MEM_guardedalloc.h"
@@ -380,6 +381,29 @@ static void sequencer_dropboxes(void)
/* ************* end drop *********** */
+const char *sequencer_context_dir[] = {"edit_mask", NULL};
+
+static int sequencer_context(const bContext *C, const char *member, bContextDataResult *result)
+{
+ Scene *scene = CTX_data_scene(C);
+
+ if (CTX_data_dir(member)) {
+ CTX_data_dir_set(result, sequencer_context_dir);
+
+ return TRUE;
+ }
+ else if (CTX_data_equals(member, "edit_mask")) {
+ Sequence *seq_act = BKE_sequencer_active_get(scene);
+ if (seq_act && seq_act->type == SEQ_TYPE_MASK && seq_act->mask) {
+ CTX_data_id_pointer_set(result, &seq_act->mask->id);
+ }
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
/* add handlers, stuff you only do once or on area/region changes */
static void sequencer_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar)
{
@@ -545,6 +569,7 @@ void ED_spacetype_sequencer(void)
st->duplicate = sequencer_duplicate;
st->operatortypes = sequencer_operatortypes;
st->keymap = sequencer_keymap;
+ st->context = sequencer_context;
st->dropboxes = sequencer_dropboxes;
st->refresh = sequencer_refresh;
@@ -597,4 +622,3 @@ void ED_spacetype_sequencer(void)
sequencer_view3d_cb = ED_view3d_draw_offscreen_imbuf_simple;
}
}
-