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:
-rw-r--r--source/blender/blenkernel/BKE_sequencer.h24
-rw-r--r--source/blender/blenkernel/intern/scene.c2
-rw-r--r--source/blender/blenkernel/intern/sequencer.c57
-rw-r--r--source/blender/editors/animation/anim_deps.c2
-rw-r--r--source/blender/editors/animation/anim_filter.c2
-rw-r--r--source/blender/editors/screen/screen_context.c6
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c28
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c4
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c142
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c28
-rw-r--r--source/blender/editors/transform/transform_conversions.c8
-rw-r--r--source/blender/makesrna/intern/rna_scene.c20
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c30
-rw-r--r--source/blender/makesrna/intern/rna_sequencer_api.c4
16 files changed, 190 insertions, 171 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h
index 598d1b681bc..decbf5d0d2a 100644
--- a/source/blender/blenkernel/BKE_sequencer.h
+++ b/source/blender/blenkernel/BKE_sequencer.h
@@ -170,6 +170,22 @@ struct ImBuf *give_ibuf_seq_direct(SeqRenderData context, float cfra, struct Seq
struct ImBuf *give_ibuf_seqbase(SeqRenderData context, float cfra, int chan_shown, struct ListBase *seqbasep);
void give_ibuf_prefetch_request(SeqRenderData context, float cfra, int chan_shown);
+
+/* **********************************************************************
+ * sequencer scene functions
+ * ********************************************************************** */
+struct Editing *BKE_sequencer_editing_get(struct Scene *scene, int alloc);
+struct Editing *BKE_sequencer_editing_ensure(struct Scene *scene);
+void BKE_sequencer_editing_free(struct Scene *scene);
+
+void BKE_sequencer_sort(struct Scene *scene);
+
+struct Sequence *BKE_sequencer_active_get(struct Scene *scene);
+int BKE_sequencer_active_get_pair(struct Scene *scene,
+ struct Sequence **seq_act, struct Sequence **seq_other);
+void BKE_sequencer_active_set(struct Scene *scene, struct Sequence *seq);
+
+
/* apply functions recursively */
int seqbase_recursive_apply(struct ListBase *seqbase, int (*apply_func)(struct Sequence *seq, void *), void *arg);
int seq_recursive_apply(struct Sequence *seq, int (*apply_func)(struct Sequence *, void *), void *arg);
@@ -179,14 +195,12 @@ int seq_recursive_apply(struct Sequence *seq, int (*apply_func)(struct Sequence
void seq_free_sequence(struct Scene *scene, struct Sequence *seq);
void seq_free_sequence_recurse(struct Scene *scene, struct Sequence *seq);
void seq_free_strip(struct Strip *strip);
-void seq_free_editing(struct Scene *scene);
+
void seq_free_clipboard(void);
-struct Editing *seq_give_editing(struct Scene *scene, int alloc);
const char *give_seqname(struct Sequence *seq);
void calc_sequence(struct Scene *scene, struct Sequence *seq);
void calc_sequence_disp(struct Scene *scene, struct Sequence *seq);
void reload_sequence_new_file(struct Scene *scene, struct Sequence * seq, int lock_range);
-void sort_seq(struct Scene *scene);
void build_seqar_cb(struct ListBase *seqbase, struct Sequence ***seqar, int *totseq,
int (*test_func)(struct Sequence * seq));
int evaluate_seq_frame(struct Scene *scene, int cfra);
@@ -296,10 +310,6 @@ void clear_scene_in_allseqs(struct Main *bmain, struct Scene *sce);
struct Sequence *get_seq_by_name(struct ListBase *seqbase, const char *name, int recursive);
-struct Sequence *seq_active_get(struct Scene *scene);
-void seq_active_set(struct Scene *scene, struct Sequence *seq);
-int seq_active_pair_get(struct Scene *scene, struct Sequence **seq_act, struct Sequence **seq_other);
-
/* api for adding new sequence strips */
typedef struct SeqLoadInfo {
int start_frame;
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 968f49357e6..f2b963a7edb 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -266,7 +266,7 @@ void BKE_scene_free(Scene *sce)
}
BLI_freelistN(&sce->base);
- seq_free_editing(sce);
+ BKE_sequencer_editing_free(sce);
BKE_free_animdata((ID *)sce);
BKE_keyingsets_free(&sce->keyingsets);
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index f36c123e227..9c3c1da5f55 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -216,13 +216,10 @@ void seq_free_sequence_recurse(Scene *scene, Sequence *seq)
}
-Editing *seq_give_editing(Scene *scene, int alloc)
+Editing *BKE_sequencer_editing_get(Scene *scene, int alloc)
{
- if (scene->ed == NULL && alloc) {
- Editing *ed;
-
- ed = scene->ed = MEM_callocN(sizeof(Editing), "addseq");
- ed->seqbasep = &ed->seqbase;
+ if (alloc) {
+ BKE_sequencer_editing_ensure(scene);
}
return scene->ed;
}
@@ -250,7 +247,19 @@ void seq_free_clipboard(void)
seqbase_clipboard.first = seqbase_clipboard.last = NULL;
}
-void seq_free_editing(Scene *scene)
+Editing *BKE_sequencer_editing_ensure(Scene *scene)
+{
+ if (scene->ed == NULL) {
+ Editing *ed;
+
+ ed = scene->ed = MEM_callocN(sizeof(Editing), "addseq");
+ ed->seqbasep = &ed->seqbase;
+ }
+
+ return scene->ed;
+}
+
+void BKE_sequencer_editing_free(Scene *scene)
{
Editing *ed = scene->ed;
MetaStack *ms;
@@ -754,11 +763,11 @@ void reload_sequence_new_file(Scene *scene, Sequence *seq, int lock_range)
calc_sequence(scene, seq);
}
-void sort_seq(Scene *scene)
+void BKE_sequencer_sort(Scene *scene)
{
/* all strips together per kind, and in order of y location ("machine") */
ListBase seqbase, effbase;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq, *seqt;
@@ -1075,7 +1084,7 @@ static int evaluate_seq_frame_gen(Sequence **seq_arr, ListBase *seqbase, int cfr
int evaluate_seq_frame(Scene *scene, int cfra)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq_arr[MAXSEQ + 1];
if (ed == NULL) return 0;
@@ -2530,7 +2539,7 @@ static ImBuf *seq_render_strip_stack(
ImBuf *give_ibuf_seq(SeqRenderData context, float cfra, int chanshown)
{
- Editing *ed = seq_give_editing(context.scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(context.scene, FALSE);
int count;
ListBase *seqbasep;
@@ -3007,7 +3016,7 @@ static int update_changed_seq_recurs(Scene *scene, Sequence *seq, Sequence *chan
void update_changed_seq_and_deps(Scene *scene, Sequence *changed_seq, int len_change, int ibuf_change)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
if (ed == NULL) return;
@@ -3254,7 +3263,7 @@ void seq_sound_init(Scene *scene, Sequence *seq)
Sequence *seq_foreground_frame_get(Scene *scene, int frame)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq, *best_seq = NULL;
int best_machine = -1;
@@ -3660,26 +3669,26 @@ Sequence *get_seq_by_name(ListBase *seqbase, const char *name, int recursive)
}
-Sequence *seq_active_get(Scene *scene)
+Sequence *BKE_sequencer_active_get(Scene *scene)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed == NULL) return NULL;
return ed->act_seq;
}
-void seq_active_set(Scene *scene, Sequence *seq)
+void BKE_sequencer_active_set(Scene *scene, Sequence *seq)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed == NULL) return;
ed->act_seq = seq;
}
-int seq_active_pair_get(Scene *scene, Sequence **seq_act, Sequence **seq_other)
+int BKE_sequencer_active_get_pair(Scene *scene, Sequence **seq_act, Sequence **seq_other)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
- *seq_act = seq_active_get(scene);
+ *seq_act = BKE_sequencer_active_get(scene);
if (*seq_act == NULL) {
return 0;
@@ -3718,7 +3727,7 @@ void seq_load_apply(Scene *scene, Sequence *seq, SeqLoadInfo *seq_load)
if (seq_load->flag & SEQ_LOAD_REPLACE_SEL) {
seq_load->flag |= SELECT;
- seq_active_set(scene, seq);
+ BKE_sequencer_active_set(scene, seq);
}
if (seq_load->flag & SEQ_LOAD_SOUND_CACHE) {
@@ -3785,7 +3794,7 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C); /* only for sound */
- Editing *ed = seq_give_editing(scene, TRUE);
+ Editing *ed = BKE_sequencer_editing_get(scene, TRUE);
bSound *sound;
Sequence *seq; /* generic strip vars */
@@ -4015,7 +4024,7 @@ void seqbase_dupli_recursive(Scene *scene, Scene *scene_to, ListBase *nseqbase,
{
Sequence *seq;
Sequence *seqn = NULL;
- Sequence *last_seq = seq_active_get(scene);
+ Sequence *last_seq = BKE_sequencer_active_get(scene);
for (seq = seqbase->first; seq; seq = seq->next) {
seq->tmp = NULL;
@@ -4033,7 +4042,7 @@ void seqbase_dupli_recursive(Scene *scene, Scene *scene_to, ListBase *nseqbase,
if (dupe_flag & SEQ_DUPE_CONTEXT) {
if (seq == last_seq) {
- seq_active_set(scene, seqn);
+ BKE_sequencer_active_set(scene, seqn);
}
}
}
diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c
index 1db4e7016eb..32cbbc79496 100644
--- a/source/blender/editors/animation/anim_deps.c
+++ b/source/blender/editors/animation/anim_deps.c
@@ -196,7 +196,7 @@ static void animchan_sync_fcurve(bAnimContext *UNUSED(ac), bAnimListElem *ale)
/* only affect if F-Curve involves sequence_editor.sequences */
if ((fcu->rna_path) && strstr(fcu->rna_path, "sequences_all")) {
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
char *seq_name;
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 2392b872031..2729396cb4a 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -882,7 +882,7 @@ static short skip_fcurve_selected_data(bDopeSheet *ads, FCurve *fcu, ID *owner_i
/* only consider if F-Curve involves sequence_editor.sequences */
if ((fcu->rna_path) && strstr(fcu->rna_path, "sequences_all")) {
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
char *seq_name;
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c
index ccc54a554e6..352039c5a61 100644
--- a/source/blender/editors/screen/screen_context.c
+++ b/source/blender/editors/screen/screen_context.c
@@ -357,7 +357,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
return 1;
}
else if (CTX_data_equals(member, "sequences")) {
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed) {
Sequence *seq;
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
@@ -368,7 +368,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
}
}
else if (CTX_data_equals(member, "selected_sequences")) {
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed) {
Sequence *seq;
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
@@ -381,7 +381,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
}
}
else if (CTX_data_equals(member, "selected_editable_sequences")) {
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed) {
Sequence *seq;
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 45687bf96a5..18769476118 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -585,7 +585,7 @@ static int tree_element_active_sequence(TreeElement *te, TreeStoreElem *UNUSED(t
static int tree_element_active_sequence_dup(Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tselem), int set)
{
Sequence *seq, *p;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
seq = (Sequence *)te->directdata;
if (set == 0) {
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 099e210a658..8a31305d65e 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1508,7 +1508,7 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
}
else if (soops->outlinevis == SO_SEQUENCE) {
Sequence *seq;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
int op;
if (ed == NULL)
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 6aa8d28bce2..2c3924e5407 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -106,7 +106,7 @@ static void sequencer_generic_invoke_path__internal(bContext *C, wmOperator *op,
{
if (RNA_struct_find_property(op->ptr, identifier)) {
Scene *scene = CTX_data_scene(C);
- Sequence *last_seq = seq_active_get(scene);
+ Sequence *last_seq = BKE_sequencer_active_get(scene);
if (last_seq && last_seq->strip && SEQ_HAS_PATH(last_seq)) {
char path[sizeof(last_seq->strip->dir)];
BLI_strncpy(path, last_seq->strip->dir, sizeof(path));
@@ -203,7 +203,7 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op)
static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, TRUE);
+ Editing *ed = BKE_sequencer_editing_get(scene, TRUE);
Scene *sce_seq;
@@ -239,11 +239,11 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
seq->scene_sound = sound_scene_add_scene_sound(scene, seq, start_frame, start_frame + seq->len, 0);
calc_sequence_disp(scene, seq);
- sort_seq(scene);
+ BKE_sequencer_sort(scene);
if (RNA_boolean_get(op->ptr, "replace_sel")) {
deselect_all_seq(scene);
- seq_active_set(scene, seq);
+ BKE_sequencer_active_set(scene, seq);
seq->flag |= SELECT;
}
@@ -302,7 +302,7 @@ void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot)
static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, TRUE);
+ Editing *ed = BKE_sequencer_editing_get(scene, TRUE);
MovieClip *clip;
@@ -338,11 +338,11 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op)
seqbase_unique_name_recursive(&ed->seqbase, seq);
calc_sequence_disp(scene, seq);
- sort_seq(scene);
+ BKE_sequencer_sort(scene);
if (RNA_boolean_get(op->ptr, "replace_sel")) {
deselect_all_seq(scene);
- seq_active_set(scene, seq);
+ BKE_sequencer_active_set(scene, seq);
seq->flag |= SELECT;
}
@@ -401,7 +401,7 @@ void SEQUENCER_OT_movieclip_strip_add(struct wmOperatorType *ot)
static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoadFunc seq_load_func)
{
Scene *scene = CTX_data_scene(C); /* only for sound */
- Editing *ed = seq_give_editing(scene, TRUE);
+ Editing *ed = BKE_sequencer_editing_get(scene, TRUE);
SeqLoadInfo seq_load;
Sequence *seq;
int tot_files;
@@ -453,7 +453,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
return OPERATOR_CANCELLED;
}
- sort_seq(scene);
+ BKE_sequencer_sort(scene);
seq_update_muting(ed);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -575,7 +575,7 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
/* cant use the generic function for this */
Scene *scene = CTX_data_scene(C); /* only for sound */
- Editing *ed = seq_give_editing(scene, TRUE);
+ Editing *ed = BKE_sequencer_editing_get(scene, TRUE);
SeqLoadInfo seq_load;
Sequence *seq;
@@ -616,7 +616,7 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
calc_sequence_disp(scene, seq);
- sort_seq(scene);
+ BKE_sequencer_sort(scene);
/* last active name */
strncpy(ed->act_imagedir, strip->dir, FILE_MAXDIR - 1);
@@ -678,7 +678,7 @@ void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot)
static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, TRUE);
+ Editing *ed = BKE_sequencer_editing_get(scene, TRUE);
Sequence *seq; /* generic strip vars */
Strip *strip;
@@ -779,11 +779,11 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
/* not sure if this is needed with update_changed_seq_and_deps.
* it was NOT called in blender 2.4x, but wont hurt */
- sort_seq(scene);
+ BKE_sequencer_sort(scene);
if (RNA_boolean_get(op->ptr, "replace_sel")) {
deselect_all_seq(scene);
- seq_active_set(scene, seq);
+ BKE_sequencer_active_set(scene, seq);
seq->flag |= SELECT;
}
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 38a5151590e..49fadf300e2 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1062,7 +1062,7 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar)
{
Scene *scene = CTX_data_scene(C);
View2D *v2d = &ar->v2d;
- Sequence *last_seq = seq_active_get(scene);
+ Sequence *last_seq = BKE_sequencer_active_get(scene);
int sel = 0, j;
float pixelx = (v2d->cur.xmax - v2d->cur.xmin) / (v2d->mask.xmax - v2d->mask.xmin);
@@ -1122,7 +1122,7 @@ static void seq_draw_sfra_efra(Scene *scene, View2D *v2d)
void draw_timeline_seq(const bContext *C, ARegion *ar)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
SpaceSeq *sseq = CTX_wm_space_seq(C);
View2D *v2d = &ar->v2d;
View2DScrollers *scrollers;
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index b021c233f8c..3d6fbb53e37 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -163,7 +163,7 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog
static void proxy_endjob(void *pjv)
{
ProxyJob *pj = pjv;
- Editing *ed = seq_give_editing(pj->scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(pj->scene, FALSE);
LinkData *link;
for (link = pj->queue.first; link; link = link->next) {
@@ -180,7 +180,7 @@ static void seq_proxy_build_job(const bContext *C)
wmJob *steve;
ProxyJob *pj;
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
ScrArea *sa = CTX_wm_area(C);
struct SeqIndexBuildContext *context;
LinkData *link;
@@ -233,9 +233,9 @@ void seq_rectf(Sequence *seq, rctf *rectf)
static void UNUSED_FUNCTION(change_plugin_seq) (Scene * scene, char *str) /* called from fileselect */
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
struct SeqEffectHandle sh;
- Sequence *last_seq = seq_active_get(scene);
+ Sequence *last_seq = BKE_sequencer_active_get(scene);
if (last_seq == NULL || last_seq->type != SEQ_PLUGIN) return;
@@ -255,7 +255,7 @@ static void UNUSED_FUNCTION(change_plugin_seq) (Scene * scene, char *str) /* cal
void boundbox_seq(Scene *scene, rctf *rect)
{
Sequence *seq;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
float min[2], max[2];
@@ -302,7 +302,7 @@ Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int se
{
/* sel - 0==unselected, 1==selected, -1==done care*/
Sequence *seq;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed == NULL) return NULL;
@@ -334,7 +334,7 @@ static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, i
{
/* sel - 0==unselected, 1==selected, -1==done care*/
Sequence *seq, *best_seq = NULL;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
int dist, best_dist;
best_dist = MAXFRAME * 2;
@@ -382,7 +382,7 @@ static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, i
Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[2])
{
Sequence *seq;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
float x, y;
float pixelx;
float handsize;
@@ -457,7 +457,7 @@ static int seq_is_predecessor(Sequence *pred, Sequence *seq)
void deselect_all_seq(Scene *scene)
{
Sequence *seq;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed == NULL) return;
@@ -489,13 +489,13 @@ void recurs_sel_seq(Sequence *seqm)
int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequence **selseq1, Sequence **selseq2, Sequence **selseq3, const char **error_str)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq1 = NULL, *seq2 = NULL, *seq3 = NULL, *seq;
*error_str = NULL;
if (!activeseq)
- seq2 = seq_active_get(scene);
+ seq2 = BKE_sequencer_active_get(scene);
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT) {
@@ -597,14 +597,14 @@ static Sequence *del_seq_find_replace_recurs(Scene *scene, Sequence *seq)
static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short deleteall)
{
Sequence *seq, *seqn;
- Sequence *last_seq = seq_active_get(scene);
+ Sequence *last_seq = BKE_sequencer_active_get(scene);
seq = lb->first;
while (seq) {
seqn = seq->next;
if ((seq->flag & flag) || deleteall) {
BLI_remlink(lb, seq);
- if (seq == last_seq) seq_active_set(scene, NULL);
+ if (seq == last_seq) BKE_sequencer_active_set(scene, NULL);
if (seq->type == SEQ_META) recurs_del_seq_flag(scene, &seq->seqbase, flag, 1);
seq_free_sequence(scene, seq);
}
@@ -839,7 +839,7 @@ static int cut_seq_list(Scene *scene, ListBase *old, ListBase *new, int cutframe
static int insert_gap(Scene *scene, int gap, int cfra)
{
Sequence *seq;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
int done = 0;
/* all strips >= cfra are shifted */
@@ -862,7 +862,7 @@ static int insert_gap(Scene *scene, int gap, int cfra)
static void UNUSED_FUNCTION(touch_seq_files) (Scene * scene)
{
Sequence *seq;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
char str[256];
/* touch all strips with movies */
@@ -894,7 +894,7 @@ static void UNUSED_FUNCTION(touch_seq_files) (Scene * scene)
static void set_filter_seq(Scene *scene)
{
Sequence *seq;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed == NULL) return;
@@ -918,8 +918,8 @@ static void set_filter_seq(Scene *scene)
static void UNUSED_FUNCTION(seq_remap_paths) (Scene * scene)
{
- Sequence *seq, *last_seq = seq_active_get(scene);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Sequence *seq, *last_seq = BKE_sequencer_active_get(scene);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
char from[FILE_MAX], to[FILE_MAX], stripped[FILE_MAX];
@@ -960,7 +960,7 @@ static void UNUSED_FUNCTION(seq_remap_paths) (Scene * scene)
static void UNUSED_FUNCTION(no_gaps) (Scene * scene)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
int cfra, first = 0, done;
@@ -1001,14 +1001,14 @@ static int seq_get_snaplimit(View2D *v2d)
/* Operator functions */
int sequencer_edit_poll(bContext *C)
{
- return (seq_give_editing(CTX_data_scene(C), FALSE) != NULL);
+ return (BKE_sequencer_editing_get(CTX_data_scene(C), FALSE) != NULL);
}
#if 0 /* UNUSED */
int sequencer_strip_poll(bContext *C)
{
Editing *ed;
- return (((ed = seq_give_editing(CTX_data_scene(C), FALSE)) != NULL) && (ed->act_seq != NULL));
+ return (((ed = BKE_sequencer_editing_get(CTX_data_scene(C), FALSE)) != NULL) && (ed->act_seq != NULL));
}
#endif
@@ -1016,13 +1016,13 @@ int sequencer_strip_has_path_poll(bContext *C)
{
Editing *ed;
Sequence *seq;
- return (((ed = seq_give_editing(CTX_data_scene(C), FALSE)) != NULL) && ((seq = ed->act_seq) != NULL) && (SEQ_HAS_PATH(seq)));
+ return (((ed = BKE_sequencer_editing_get(CTX_data_scene(C), FALSE)) != NULL) && ((seq = ed->act_seq) != NULL) && (SEQ_HAS_PATH(seq)));
}
int sequencer_view_poll(bContext *C)
{
SpaceSeq *sseq = CTX_wm_space_seq(C);
- Editing *ed = seq_give_editing(CTX_data_scene(C), FALSE);
+ Editing *ed = BKE_sequencer_editing_get(CTX_data_scene(C), FALSE);
if (ed && sseq && (sseq->mainb == SEQ_DRAW_IMG_IMBUF))
return 1;
@@ -1034,7 +1034,7 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
int snap_frame;
@@ -1084,7 +1084,7 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op)
}
/* as last: */
- sort_seq(scene);
+ BKE_sequencer_sort(scene);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -1125,7 +1125,7 @@ void SEQUENCER_OT_snap(struct wmOperatorType *ot)
static int sequencer_mute_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
int selected;
@@ -1172,7 +1172,7 @@ void SEQUENCER_OT_mute(struct wmOperatorType *ot)
static int sequencer_unmute_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
int selected;
@@ -1219,7 +1219,7 @@ void SEQUENCER_OT_unmute(struct wmOperatorType *ot)
static int sequencer_lock_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
@@ -1252,7 +1252,7 @@ void SEQUENCER_OT_lock(struct wmOperatorType *ot)
static int sequencer_unlock_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
@@ -1285,7 +1285,7 @@ void SEQUENCER_OT_unlock(struct wmOperatorType *ot)
static int sequencer_reload_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
int adjust_length = RNA_boolean_get(op->ptr, "adjust_length");
@@ -1331,7 +1331,7 @@ void SEQUENCER_OT_reload(struct wmOperatorType *ot)
static int sequencer_refresh_all_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
@@ -1355,7 +1355,7 @@ void SEQUENCER_OT_refresh_all(struct wmOperatorType *ot)
static int sequencer_reassign_inputs_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Sequence *seq1, *seq2, *seq3, *last_seq = seq_active_get(scene);
+ Sequence *seq1, *seq2, *seq3, *last_seq = BKE_sequencer_active_get(scene);
const char *error_msg;
if (!seq_effect_find_selected(scene, last_seq, last_seq->type, &seq1, &seq2, &seq3, &error_msg)) {
@@ -1385,10 +1385,10 @@ static int sequencer_reassign_inputs_exec(bContext *C, wmOperator *op)
static int sequencer_effect_poll(bContext *C)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed) {
- Sequence *last_seq = seq_active_get(scene);
+ Sequence *last_seq = BKE_sequencer_active_get(scene);
if (last_seq && (last_seq->type & SEQ_EFFECT)) {
return 1;
}
@@ -1416,7 +1416,7 @@ void SEQUENCER_OT_reassign_inputs(struct wmOperatorType *ot)
static int sequencer_swap_inputs_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Sequence *seq, *last_seq = seq_active_get(scene);
+ Sequence *seq, *last_seq = BKE_sequencer_active_get(scene);
if (last_seq->seq1 == NULL || last_seq->seq2 == NULL) {
BKE_report(op->reports, RPT_ERROR, "No valid inputs to swap");
@@ -1459,7 +1459,7 @@ static EnumPropertyItem prop_cut_types[] = {
static int sequencer_cut_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
int cut_side, cut_hard, cut_frame;
ListBase newlist;
@@ -1499,7 +1499,7 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op)
SEQ_END;
}
/* as last: */
- sort_seq(scene);
+ BKE_sequencer_sort(scene);
}
if (changed) {
@@ -1567,7 +1567,7 @@ static int apply_unique_name_cb(Sequence *seq, void *arg_pt)
static int sequencer_add_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
ListBase nseqbase = {NULL, NULL};
@@ -1624,12 +1624,12 @@ void SEQUENCER_OT_duplicate(wmOperatorType *ot)
static int sequencer_delete_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
MetaStack *ms;
int nothingSelected = TRUE;
- seq = seq_active_get(scene);
+ seq = BKE_sequencer_active_get(scene);
if (seq && seq->flag & SELECT) { /* avoid a loop since this is likely to be selected */
nothingSelected = FALSE;
}
@@ -1695,7 +1695,7 @@ void SEQUENCER_OT_delete(wmOperatorType *ot)
static int sequencer_offset_clear_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
/* for effects, try to find a replacement input */
@@ -1747,7 +1747,7 @@ void SEQUENCER_OT_offset_clear(wmOperatorType *ot)
static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq, *seq_new;
Strip *strip_new;
@@ -1811,7 +1811,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
}
/* as last: */
- sort_seq(scene);
+ BKE_sequencer_sort(scene);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -1843,8 +1843,8 @@ void SEQUENCER_OT_images_separate(wmOperatorType *ot)
static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
- Sequence *last_seq = seq_active_get(scene);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
+ Sequence *last_seq = BKE_sequencer_active_get(scene);
MetaStack *ms;
if (last_seq && last_seq->type == SEQ_META && last_seq->flag & SELECT) {
@@ -1856,7 +1856,7 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op))
ed->seqbasep = &last_seq->seqbase;
- seq_active_set(scene, NULL);
+ BKE_sequencer_active_set(scene, NULL);
}
else {
@@ -1876,7 +1876,7 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op))
for (seq = ed->seqbasep->first; seq; seq = seq->next)
calc_sequence(scene, seq);
- seq_active_set(scene, ms->parseq);
+ BKE_sequencer_active_set(scene, ms->parseq);
ms->parseq->flag |= SELECT;
recurs_sel_seq(ms->parseq);
@@ -1911,9 +1911,9 @@ void SEQUENCER_OT_meta_toggle(wmOperatorType *ot)
static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
- Sequence *seq, *seqm, *next, *last_seq = seq_active_get(scene);
+ Sequence *seq, *seqm, *next, *last_seq = BKE_sequencer_active_get(scene);
int channel_max = 1;
if (seqbase_isolated_sel_check(ed->seqbasep) == FALSE) {
@@ -1944,7 +1944,7 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
seqm->strip = MEM_callocN(sizeof(Strip), "metastrip");
seqm->strip->us = 1;
- seq_active_set(scene, seqm);
+ BKE_sequencer_active_set(scene, seqm);
if (seq_test_overlap(ed->seqbasep, seqm) ) shuffle_seq(ed->seqbasep, seqm, scene);
@@ -1987,9 +1987,9 @@ static int seq_depends_on_meta(Sequence *seq, Sequence *seqm)
static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
- Sequence *seq, *last_seq = seq_active_get(scene); /* last_seq checks ed==NULL */
+ Sequence *seq, *last_seq = BKE_sequencer_active_get(scene); /* last_seq checks ed==NULL */
if (last_seq == NULL || last_seq->type != SEQ_META)
return OPERATOR_CANCELLED;
@@ -2020,7 +2020,7 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
}
}
- sort_seq(scene);
+ BKE_sequencer_sort(scene);
seq_update_muting(ed);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -2225,7 +2225,7 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op))
View2D *v2d = UI_view2d_fromcontext(C);
ScrArea *area = CTX_wm_area(C);
bScreen *sc = CTX_wm_screen(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
int xmin = MAXFRAME * 2;
@@ -2300,7 +2300,7 @@ void SEQUENCER_OT_view_selected(wmOperatorType *ot)
static int find_next_prev_edit(Scene *scene, int cfra, int side)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq, *best_seq = NULL, *frame_seq = NULL;
int dist, best_dist;
@@ -2427,7 +2427,7 @@ static void swap_sequence(Scene *scene, Sequence *seqa, Sequence *seqb)
#if 0
static Sequence *sequence_find_parent(Scene *scene, Sequence *child)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *parent = NULL;
Sequence *seq;
@@ -2447,8 +2447,8 @@ static Sequence *sequence_find_parent(Scene *scene, Sequence *child)
static int sequencer_swap_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
- Sequence *active_seq = seq_active_get(scene);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
+ Sequence *active_seq = BKE_sequencer_active_get(scene);
Sequence *seq, *iseq;
int side = RNA_enum_get(op->ptr, "side");
@@ -2492,7 +2492,7 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op)
- sort_seq(scene);
+ BKE_sequencer_sort(scene);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -2524,7 +2524,7 @@ static int sequencer_rendersize_exec(bContext *C, wmOperator *UNUSED(op))
{
int retval = OPERATOR_CANCELLED;
Scene *scene = CTX_data_scene(C);
- Sequence *active_seq = seq_active_get(scene);
+ Sequence *active_seq = BKE_sequencer_active_get(scene);
StripElem *se = NULL;
if (active_seq == NULL)
@@ -2596,7 +2596,7 @@ static void seq_copy_del_sound(Scene *scene, Sequence *seq)
static int sequencer_copy_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
ListBase nseqbase = {NULL, NULL};
@@ -2660,7 +2660,7 @@ void SEQUENCER_OT_copy(wmOperatorType *ot)
static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, TRUE); /* create if needed */
+ Editing *ed = BKE_sequencer_editing_get(scene, TRUE); /* create if needed */
ListBase nseqbase = {NULL, NULL};
int ofs;
Sequence *iseq;
@@ -2716,7 +2716,7 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op)
Sequence *seq_other;
const char *error_msg;
- if (seq_active_pair_get(scene, &seq_act, &seq_other) == 0) {
+ if (BKE_sequencer_active_get_pair(scene, &seq_act, &seq_other) == 0) {
BKE_report(op->reports, RPT_ERROR, "Must select 2 strips");
return OPERATOR_CANCELLED;
}
@@ -2764,7 +2764,7 @@ void SEQUENCER_OT_swap_data(wmOperatorType *ot)
static int view_ghost_border_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
View2D *v2d = UI_view2d_fromcontext(C);
rctf rect;
@@ -2856,8 +2856,8 @@ static EnumPropertyItem prop_change_effect_input_types[] = {
static int sequencer_change_effect_input_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
- Sequence *seq = seq_active_get(scene);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
+ Sequence *seq = BKE_sequencer_active_get(scene);
Sequence **seq_1, **seq_2;
@@ -2914,8 +2914,8 @@ void SEQUENCER_OT_change_effect_input(struct wmOperatorType *ot)
static int sequencer_change_effect_type_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
- Sequence *seq = seq_active_get(scene);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
+ Sequence *seq = BKE_sequencer_active_get(scene);
const int new_type = RNA_enum_get(op->ptr, "type");
/* free previous effect and init new effect */
@@ -2975,8 +2975,8 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
- Sequence *seq = seq_active_get(scene);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
+ Sequence *seq = BKE_sequencer_active_get(scene);
const int is_relative_path = RNA_boolean_get(op->ptr, "relative_path");
if (seq->type == SEQ_IMAGE) {
@@ -3044,7 +3044,7 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op)
static int sequencer_change_path_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
Scene *scene = CTX_data_scene(C);
- Sequence *seq = seq_active_get(scene);
+ Sequence *seq = BKE_sequencer_active_get(scene);
RNA_string_set(op->ptr, "directory", seq->strip->dir);
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index be48b161737..a59570a09e1 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -164,11 +164,11 @@ void select_surround_from_last(Scene *scene)
static void UNUSED_FUNCTION(select_single_seq) (Scene * scene, Sequence * seq, int deselect_all) /* BRING BACK */
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (deselect_all)
deselect_all_seq(scene);
- seq_active_set(scene, seq);
+ BKE_sequencer_active_set(scene, seq);
if ((seq->type == SEQ_IMAGE) || (seq->type == SEQ_MOVIE)) {
if (seq->strip)
@@ -185,7 +185,7 @@ static void UNUSED_FUNCTION(select_single_seq) (Scene * scene, Sequence * seq, i
#if 0
static void select_neighbor_from_last(Scene *scene, int lr)
{
- Sequence *seq = seq_active_get(scene);
+ Sequence *seq = BKE_sequencer_active_get(scene);
Sequence *neighbor;
int change = 0;
if (seq) {
@@ -220,7 +220,7 @@ static int sequencer_de_select_all_exec(bContext *C, wmOperator *op)
int action = RNA_enum_get(op->ptr, "action");
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
if (action == SEL_TOGGLE) {
@@ -281,7 +281,7 @@ void SEQUENCER_OT_select_all(struct wmOperatorType *ot)
static int sequencer_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
@@ -318,7 +318,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
View2D *v2d = UI_view2d_fromcontext(C);
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
short extend = RNA_boolean_get(op->ptr, "extend");
short linked_handle = RNA_boolean_get(op->ptr, "linked_handle");
short left_right = RNA_boolean_get(op->ptr, "left_right");
@@ -406,7 +406,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
deselect_all_seq(scene);
if (seq) {
- seq_active_set(scene, seq);
+ BKE_sequencer_active_set(scene, seq);
if ((seq->type == SEQ_IMAGE) || (seq->type == SEQ_MOVIE)) {
if (seq->strip) {
@@ -557,7 +557,7 @@ void SEQUENCER_OT_select(wmOperatorType *ot)
/* run recursively to select linked */
static int select_more_less_seq__internal(Scene *scene, int sel, int linked)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq, *neighbor;
int change = 0;
int isel;
@@ -758,7 +758,7 @@ void SEQUENCER_OT_select_linked(wmOperatorType *ot)
static int sequencer_select_handles_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, 0);
+ Editing *ed = BKE_sequencer_editing_get(scene, 0);
Sequence *seq;
int sel_side = RNA_enum_get(op->ptr, "side");
@@ -808,8 +808,8 @@ void SEQUENCER_OT_select_handles(wmOperatorType *ot)
static int sequencer_select_active_side_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, 0);
- Sequence *seq_act = seq_active_get(scene);
+ Editing *ed = BKE_sequencer_editing_get(scene, 0);
+ Sequence *seq_act = BKE_sequencer_active_get(scene);
if (ed == NULL || seq_act == NULL)
return OPERATOR_CANCELLED;
@@ -846,7 +846,7 @@ void SEQUENCER_OT_select_active_side(wmOperatorType *ot)
static int sequencer_borderselect_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
View2D *v2d = UI_view2d_fromcontext(C);
Sequence *seq;
@@ -1150,8 +1150,8 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq)
static int sequencer_select_grouped_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Editing *ed = seq_give_editing(scene, 0);
- Sequence *seq, *actseq = seq_active_get(scene);
+ Editing *ed = BKE_sequencer_editing_get(scene, 0);
+ Sequence *seq, *actseq = BKE_sequencer_active_get(scene);
int type = RNA_enum_get(op->ptr, "type");
short changed = 0, extend;
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 3cd41edacf5..b457d22a712 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -2181,7 +2181,7 @@ void flushTransNodes(TransInfo *t)
void flushTransSeq(TransInfo *t)
{
- ListBase *seqbasep= seq_give_editing(t->scene, FALSE)->seqbasep; /* Editing null check already done */
+ ListBase *seqbasep= BKE_sequencer_editing_get(t->scene, FALSE)->seqbasep; /* Editing null check already done */
int a, new_frame, old_start;
TransData *td= NULL;
TransData2D *td2d= NULL;
@@ -3980,7 +3980,7 @@ static int SeqToTransData_Recursive(TransInfo *t, ListBase *seqbase, TransData *
static void freeSeqData(TransInfo *t)
{
- Editing *ed= seq_give_editing(t->scene, FALSE);
+ Editing *ed= BKE_sequencer_editing_get(t->scene, FALSE);
if (ed != NULL) {
ListBase *seqbasep= ed->seqbasep;
@@ -4086,7 +4086,7 @@ static void freeSeqData(TransInfo *t)
}
}
- sort_seq(t->scene);
+ BKE_sequencer_sort(t->scene);
}
else {
/* Cancelled, need to update the strips display */
@@ -4116,7 +4116,7 @@ static void createTransSeqData(bContext *C, TransInfo *t)
View2D *v2d= UI_view2d_fromcontext(C);
Scene *scene= t->scene;
- Editing *ed= seq_give_editing(t->scene, FALSE);
+ Editing *ed= BKE_sequencer_editing_get(t->scene, FALSE);
TransData *td = NULL;
TransData2D *td2d= NULL;
TransDataSeq *tdsq= NULL;
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 088d18ee6c2..f907e2f45b3 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -635,15 +635,6 @@ static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
iter->valid = (internal->link != NULL);
}
-static PointerRNA rna_Scene_sequence_editor_get(PointerRNA *ptr)
-{
- Scene *scene = (Scene *)ptr->data;
- /* mallocs an Editing (if it doesn't exist) so you can access
- * Scene.sequence_editor functions without having to manually
- * add a Sequence using the UI to create the SequenceEditor */
- return rna_pointer_inherit_refine(ptr, &RNA_SequenceEditor, seq_give_editing(scene, TRUE));
-}
-
static char *rna_RenderSettings_path(PointerRNA *UNUSED(ptr))
{
return BLI_sprintfN("render");
@@ -4168,7 +4159,9 @@ void RNA_def_scene(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
+
FunctionRNA *func;
+ PropertyRNA *parm;
static EnumPropertyItem audio_distance_model_items[] = {
{0, "NONE", 0, "None", "No distance attenuation"},
@@ -4362,10 +4355,17 @@ void RNA_def_scene(BlenderRNA *brna)
/* Sequencer */
prop = RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ed");
- RNA_def_property_pointer_funcs(prop, "rna_Scene_sequence_editor_get", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "SequenceEditor");
RNA_def_property_ui_text(prop, "Sequence Editor", "");
+ func = RNA_def_function(srna, "sequence_editor_create", "BKE_sequencer_editing_ensure");
+ RNA_def_function_ui_description(func, "Ensure sequence editor is valid in this scene");
+ parm = RNA_def_pointer(func, "sequence_editor", "SequenceEditor", "", "New sequence editor data or NULL");
+ RNA_def_function_return(func, parm);
+
+ func = RNA_def_function(srna, "sequence_editor_clear", "BKE_sequencer_editing_free");
+ RNA_def_function_ui_description(func, "Clear sequence editor in this scene");
+
/* Keying Sets */
prop = RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "keyingsets", NULL);
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 3791d0e1786..d64dd1a626e 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -73,7 +73,7 @@ static void meta_tmp_ref(Sequence *seq_par, Sequence *seq)
static void rna_SequenceEditor_sequences_all_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->id.data;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
meta_tmp_ref(NULL, ed->seqbase.first);
@@ -125,14 +125,14 @@ static void rna_SequenceEditor_elements_begin(CollectionPropertyIterator *iter,
static void rna_Sequence_frame_change_update(Scene *scene, Sequence *seq)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
ListBase *seqbase = seq_seqbase(&ed->seqbase, seq);
calc_sequence_disp(scene, seq);
if (seq_test_overlap(seqbase, seq)) {
shuffle_seq(seqbase, seq, scene); /* XXX - BROKEN!, uses context seqbasep */
}
- sort_seq(scene);
+ BKE_sequencer_sort(scene);
}
static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value)
@@ -212,7 +212,7 @@ static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
{
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->id.data;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
ListBase *seqbase = seq_seqbase(&ed->seqbase, seq);
seq->machine = value;
@@ -220,7 +220,7 @@ static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
if (seq_test_overlap(seqbase, seq) ) {
shuffle_seq(seqbase, seq, scene); /* XXX - BROKEN!, uses context seqbasep */
}
- sort_seq(scene);
+ BKE_sequencer_sort(scene);
}
/* properties that need to allocate structs */
@@ -304,7 +304,7 @@ static int transform_seq_cmp_cb(Sequence *seq, void *arg_pt)
static char *rna_SequenceTransform_path(PointerRNA *ptr)
{
Scene *scene = ptr->id.data;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
struct { Sequence *seq; void *transform; } data;
@@ -335,7 +335,7 @@ static int crop_seq_cmp_cb(Sequence *seq, void *arg_pt)
static char *rna_SequenceCrop_path(PointerRNA *ptr)
{
Scene *scene = ptr->id.data;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
struct { Sequence *seq; void *crop; } data;
@@ -575,7 +575,7 @@ static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
static void rna_Sequence_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed)
free_imbuf_seq(scene, &ed->seqbase, FALSE, TRUE);
@@ -583,7 +583,7 @@ static void rna_Sequence_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *U
static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
@@ -593,7 +593,7 @@ static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), Scene *scene,
static void rna_Sequence_mute_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
seq_update_muting(ed);
rna_Sequence_update(bmain, scene, ptr);
@@ -620,7 +620,7 @@ static int seqproxy_seq_cmp_cb(Sequence *seq, void *arg_pt)
static void rna_Sequence_tcindex_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
struct { Sequence *seq; void *seq_proxy; } data;
@@ -662,7 +662,7 @@ static int colbalance_seq_cmp_cb(Sequence *seq, void *arg_pt)
static char *rna_SequenceColorBalance_path(PointerRNA *ptr)
{
Scene *scene = ptr->id.data;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
struct { Sequence *seq; void *color_balance; } data;
@@ -682,7 +682,7 @@ static char *rna_SequenceColorBalance_path(PointerRNA *ptr)
static void rna_SequenceEditor_overlay_lock_set(PointerRNA *ptr, int value)
{
Scene *scene = ptr->id.data;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed == NULL)
return;
@@ -701,7 +701,7 @@ static void rna_SequenceEditor_overlay_lock_set(PointerRNA *ptr, int value)
static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->id.data;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed == NULL)
return scene->r.cfra;
@@ -716,7 +716,7 @@ static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr)
static void rna_SequenceEditor_overlay_frame_set(PointerRNA *ptr, int value)
{
Scene *scene = (Scene *)ptr->id.data;
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed == NULL)
return;
diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c
index 01b5aee2dde..440d2e56bfe 100644
--- a/source/blender/makesrna/intern/rna_sequencer_api.c
+++ b/source/blender/makesrna/intern/rna_sequencer_api.c
@@ -330,7 +330,7 @@ static StripElem *rna_SequenceElements_push(Sequence *seq, Main *bmain, const ch
StripElem *se;
for (scene = bmain->scene.first; scene; scene = scene->id.next) {
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed) {
for (seqn = ed->seqbase.first; seqn; seqn = seqn->next) {
if (seqn == seq)
@@ -362,7 +362,7 @@ static void rna_SequenceElements_pop(Sequence *seq, Main *bmain, ReportList *rep
}
for (scene = bmain->scene.first; scene; scene = scene->id.next) {
- Editing *ed = seq_give_editing(scene, FALSE);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
if (ed) {
for (seqn = ed->seqbase.first; seqn; seqn = seqn->next) {
if (seqn == seq)