2011-02-23 10:52:22 +00:00
|
|
|
/*
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): Blender Foundation, 2003-2009, Campbell Barton
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
2011-02-27 20:29:51 +00:00
|
|
|
/** \file blender/editors/space_sequencer/sequencer_select.c
|
|
|
|
|
* \ingroup spseq
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <math.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
#ifndef WIN32
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#else
|
|
|
|
|
#include <io.h>
|
|
|
|
|
#endif
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
|
|
#include "BLI_blenlib.h"
|
2009-11-10 20:43:45 +00:00
|
|
|
#include "BLI_math.h"
|
2011-01-07 18:36:47 +00:00
|
|
|
#include "BLI_utildefines.h"
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
|
|
|
|
|
|
#include "BKE_context.h"
|
2011-09-28 14:12:27 +00:00
|
|
|
#include "BKE_report.h"
|
2009-12-13 14:56:45 +00:00
|
|
|
#include "BKE_sequencer.h"
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
#include "WM_api.h"
|
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
|
|
|
|
#include "RNA_define.h"
|
|
|
|
|
|
|
|
|
|
/* for menu/popup icons etc etc*/
|
|
|
|
|
|
|
|
|
|
#include "ED_types.h"
|
|
|
|
|
#include "ED_screen.h"
|
|
|
|
|
|
|
|
|
|
#include "UI_view2d.h"
|
|
|
|
|
|
|
|
|
|
/* own include */
|
|
|
|
|
#include "sequencer_intern.h"
|
2010-10-16 08:03:28 +00:00
|
|
|
static void *find_nearest_marker(int UNUSED(d1), int UNUSED(d2)) {return NULL;}
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
2011-02-14 17:55:27 +00:00
|
|
|
static void select_surrounding_handles(Scene *scene, Sequence *test) /* XXX BRING BACK */
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
{
|
|
|
|
|
Sequence *neighbor;
|
|
|
|
|
|
2009-02-15 17:24:09 +00:00
|
|
|
neighbor=find_neighboring_sequence(scene, test, SEQ_SIDE_LEFT, -1);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
if (neighbor) {
|
|
|
|
|
neighbor->flag |= SELECT;
|
|
|
|
|
recurs_sel_seq(neighbor);
|
|
|
|
|
neighbor->flag |= SEQ_RIGHTSEL;
|
|
|
|
|
}
|
2009-02-15 17:24:09 +00:00
|
|
|
neighbor=find_neighboring_sequence(scene, test, SEQ_SIDE_RIGHT, -1);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
if (neighbor) {
|
|
|
|
|
neighbor->flag |= SELECT;
|
|
|
|
|
recurs_sel_seq(neighbor);
|
|
|
|
|
neighbor->flag |= SEQ_LEFTSEL;
|
|
|
|
|
}
|
|
|
|
|
test->flag |= SELECT;
|
|
|
|
|
}
|
2009-02-15 17:24:09 +00:00
|
|
|
|
|
|
|
|
/* used for mouse selection and for SEQUENCER_OT_select_active_side() */
|
|
|
|
|
static void select_active_side(ListBase *seqbase, int sel_side, int channel, int frame)
|
|
|
|
|
{
|
|
|
|
|
Sequence *seq;
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
for (seq= seqbase->first; seq; seq=seq->next) {
|
|
|
|
|
if (channel==seq->machine) {
|
2009-02-15 17:24:09 +00:00
|
|
|
switch(sel_side) {
|
|
|
|
|
case SEQ_SIDE_LEFT:
|
|
|
|
|
if (frame > (seq->startdisp)) {
|
|
|
|
|
seq->flag &= ~(SEQ_RIGHTSEL|SEQ_LEFTSEL);
|
|
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SEQ_SIDE_RIGHT:
|
|
|
|
|
if (frame < (seq->startdisp)) {
|
|
|
|
|
seq->flag &= ~(SEQ_RIGHTSEL|SEQ_LEFTSEL);
|
|
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SEQ_SIDE_BOTH:
|
|
|
|
|
seq->flag &= ~(SEQ_RIGHTSEL|SEQ_LEFTSEL);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-14 20:46:18 +00:00
|
|
|
/* used for mouse selection and for SEQUENCER_OT_select_active_side() */
|
|
|
|
|
static void select_linked_time(ListBase *seqbase, Sequence *seq_link)
|
|
|
|
|
{
|
|
|
|
|
Sequence *seq;
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
for (seq= seqbase->first; seq; seq=seq->next) {
|
|
|
|
|
if (seq_link->machine != seq->machine) {
|
2009-11-14 20:46:18 +00:00
|
|
|
int left_match = (seq->startdisp == seq_link->startdisp) ? 1:0;
|
|
|
|
|
int right_match = (seq->enddisp == seq_link->enddisp) ? 1:0;
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (left_match && right_match) {
|
2009-11-14 20:46:18 +00:00
|
|
|
/* a direct match, copy the selection settinhs */
|
|
|
|
|
seq->flag &= ~(SELECT|SEQ_LEFTSEL|SEQ_RIGHTSEL);
|
|
|
|
|
seq->flag |= seq_link->flag & (SELECT|SEQ_LEFTSEL|SEQ_RIGHTSEL);
|
|
|
|
|
|
|
|
|
|
recurs_sel_seq(seq);
|
|
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
else if (seq_link->flag & SELECT && (left_match || right_match)) {
|
2009-11-14 20:46:18 +00:00
|
|
|
|
|
|
|
|
/* clear for reselection */
|
|
|
|
|
seq->flag &= ~(SEQ_LEFTSEL|SEQ_RIGHTSEL);
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (left_match && seq_link->flag & SEQ_LEFTSEL)
|
2009-11-14 20:46:18 +00:00
|
|
|
seq->flag |= SELECT|SEQ_LEFTSEL;
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (right_match && seq_link->flag & SEQ_RIGHTSEL)
|
2009-11-14 20:46:18 +00:00
|
|
|
seq->flag |= SELECT|SEQ_RIGHTSEL;
|
|
|
|
|
|
|
|
|
|
recurs_sel_seq(seq);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
#if 0 // BRING BACK
|
|
|
|
|
void select_surround_from_last(Scene *scene)
|
|
|
|
|
{
|
|
|
|
|
Sequence *seq=get_last_seq(scene);
|
|
|
|
|
|
|
|
|
|
if (seq==NULL)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
select_surrounding_handles(scene, seq);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
2011-08-15 16:18:04 +00:00
|
|
|
static void UNUSED_FUNCTION(select_single_seq)(Scene *scene, Sequence *seq, int deselect_all) /* BRING BACK */
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
{
|
2009-01-28 22:36:34 +00:00
|
|
|
Editing *ed= seq_give_editing(scene, FALSE);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (deselect_all)
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
deselect_all_seq(scene);
|
2010-06-21 17:37:50 +00:00
|
|
|
seq_active_set(scene, seq);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if ((seq->type==SEQ_IMAGE) || (seq->type==SEQ_MOVIE)) {
|
|
|
|
|
if (seq->strip)
|
2011-09-26 18:51:10 +00:00
|
|
|
BLI_strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
else if (seq->type==SEQ_SOUND) {
|
|
|
|
|
if (seq->strip)
|
2011-09-26 18:51:10 +00:00
|
|
|
BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
seq->flag|= SELECT;
|
|
|
|
|
recurs_sel_seq(seq);
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-17 22:34:41 +00:00
|
|
|
#if 0
|
2011-02-14 17:55:27 +00:00
|
|
|
static void select_neighbor_from_last(Scene *scene, int lr)
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
{
|
2010-06-21 17:37:50 +00:00
|
|
|
Sequence *seq= seq_active_get(scene);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
Sequence *neighbor;
|
|
|
|
|
int change = 0;
|
|
|
|
|
if (seq) {
|
|
|
|
|
neighbor=find_neighboring_sequence(scene, seq, lr, -1);
|
|
|
|
|
if (neighbor) {
|
|
|
|
|
switch (lr) {
|
2009-02-15 17:24:09 +00:00
|
|
|
case SEQ_SIDE_LEFT:
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
neighbor->flag |= SELECT;
|
|
|
|
|
recurs_sel_seq(neighbor);
|
|
|
|
|
neighbor->flag |= SEQ_RIGHTSEL;
|
|
|
|
|
seq->flag |= SEQ_LEFTSEL;
|
|
|
|
|
break;
|
2009-02-15 17:24:09 +00:00
|
|
|
case SEQ_SIDE_RIGHT:
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
neighbor->flag |= SELECT;
|
|
|
|
|
recurs_sel_seq(neighbor);
|
|
|
|
|
neighbor->flag |= SEQ_LEFTSEL;
|
|
|
|
|
seq->flag |= SEQ_RIGHTSEL;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
change = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (change) {
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-02-17 22:34:41 +00:00
|
|
|
#endif
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
/* (de)select operator */
|
2012-01-14 07:23:57 +00:00
|
|
|
static int sequencer_de_select_all_exec(bContext *C, wmOperator *op)
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
{
|
2012-01-14 07:23:57 +00:00
|
|
|
int action = RNA_enum_get(op->ptr, "action");
|
|
|
|
|
|
|
|
|
|
Scene *scene = CTX_data_scene(C);
|
|
|
|
|
Editing *ed = seq_give_editing(scene, FALSE);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
Sequence *seq;
|
2009-01-28 22:36:34 +00:00
|
|
|
|
2012-01-14 07:23:57 +00:00
|
|
|
if (action == SEL_TOGGLE) {
|
|
|
|
|
action = SEL_SELECT;
|
|
|
|
|
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
|
|
|
|
|
if (seq->flag & SEQ_ALLSEL) {
|
|
|
|
|
action = SEL_DESELECT;
|
|
|
|
|
break;
|
|
|
|
|
}
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-01-14 07:23:57 +00:00
|
|
|
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
|
|
|
|
|
switch (action) {
|
|
|
|
|
case SEL_SELECT:
|
|
|
|
|
seq->flag &= ~(SEQ_LEFTSEL + SEQ_RIGHTSEL);
|
|
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
break;
|
|
|
|
|
case SEL_DESELECT:
|
|
|
|
|
seq->flag &= ~SEQ_ALLSEL;
|
|
|
|
|
break;
|
|
|
|
|
case SEL_INVERT:
|
|
|
|
|
if (seq->flag & SEQ_ALLSEL) {
|
|
|
|
|
seq->flag &= ~SEQ_ALLSEL;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
seq->flag &= ~(SEQ_LEFTSEL + SEQ_RIGHTSEL);
|
|
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
}
|
|
|
|
|
break;
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
}
|
2009-12-08 13:57:51 +00:00
|
|
|
|
2012-01-14 07:23:57 +00:00
|
|
|
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
|
|
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
2012-01-14 07:23:57 +00:00
|
|
|
void SEQUENCER_OT_select_all(struct wmOperatorType *ot)
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->name = "(De)select All";
|
|
|
|
|
ot->idname = "SEQUENCER_OT_select_all";
|
|
|
|
|
ot->description = "Select or deselect all strips";
|
2009-09-12 17:16:12 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->exec = sequencer_de_select_all_exec;
|
|
|
|
|
ot->poll = sequencer_edit_poll;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
|
|
|
|
/* flags */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
2012-01-14 07:23:57 +00:00
|
|
|
|
|
|
|
|
WM_operator_properties_select_all(ot);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* (de)select operator */
|
2010-10-15 01:36:14 +00:00
|
|
|
static int sequencer_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
{
|
|
|
|
|
Scene *scene= CTX_data_scene(C);
|
2009-01-28 22:36:34 +00:00
|
|
|
Editing *ed= seq_give_editing(scene, FALSE);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
Sequence *seq;
|
2009-01-28 22:36:34 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
for (seq= ed->seqbasep->first; seq; seq=seq->next) {
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
if (seq->flag & SELECT) {
|
2010-06-24 10:04:18 +00:00
|
|
|
seq->flag &= ~SEQ_ALLSEL;
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2009-10-18 21:32:03 +00:00
|
|
|
seq->flag &= ~(SEQ_LEFTSEL+SEQ_RIGHTSEL);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-12-08 13:57:51 +00:00
|
|
|
|
2010-06-18 04:39:32 +00:00
|
|
|
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
2009-07-08 21:31:28 +00:00
|
|
|
void SEQUENCER_OT_select_inverse(struct wmOperatorType *ot)
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->name = "Select Inverse";
|
|
|
|
|
ot->idname = "SEQUENCER_OT_select_inverse";
|
|
|
|
|
ot->description = "Select unselected strips";
|
2009-09-12 17:16:12 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->exec = sequencer_select_inverse_exec;
|
|
|
|
|
ot->poll = sequencer_edit_poll;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
|
|
|
|
/* flags */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
|
|
|
|
{
|
|
|
|
|
View2D *v2d= UI_view2d_fromcontext(C);
|
|
|
|
|
Scene *scene= CTX_data_scene(C);
|
2009-01-28 22:36:34 +00:00
|
|
|
Editing *ed= seq_give_editing(scene, FALSE);
|
2009-02-15 17:24:09 +00:00
|
|
|
short extend= RNA_boolean_get(op->ptr, "extend");
|
2009-10-19 12:27:40 +00:00
|
|
|
short linked_handle= RNA_boolean_get(op->ptr, "linked_handle");
|
|
|
|
|
short left_right= RNA_boolean_get(op->ptr, "left_right");
|
2009-11-14 20:46:18 +00:00
|
|
|
short linked_time= RNA_boolean_get(op->ptr, "linked_time");
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
2009-10-19 11:39:57 +00:00
|
|
|
Sequence *seq,*neighbor, *act_orig;
|
|
|
|
|
int hand,sel_side;
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
TimeMarker *marker;
|
2009-01-28 22:36:34 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ed==NULL)
|
2009-01-28 22:36:34 +00:00
|
|
|
return OPERATOR_CANCELLED;
|
2009-02-15 17:24:09 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
marker=find_nearest_marker(SCE_MARKERS, 1); //XXX - dummy function for now
|
|
|
|
|
|
2011-05-20 07:40:05 +00:00
|
|
|
seq= find_nearest_seq(scene, v2d, &hand, event->mval);
|
2009-11-14 20:46:18 +00:00
|
|
|
|
|
|
|
|
// XXX - not nice, Ctrl+RMB needs to do left_right only when not over a strip
|
2012-03-24 06:38:07 +00:00
|
|
|
if (seq && linked_time && left_right)
|
2009-11-14 20:46:18 +00:00
|
|
|
left_right= FALSE;
|
|
|
|
|
|
|
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
if (marker) {
|
|
|
|
|
int oldflag;
|
|
|
|
|
/* select timeline marker */
|
2009-10-19 11:39:57 +00:00
|
|
|
if (extend) {
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
oldflag= marker->flag;
|
|
|
|
|
if (oldflag & SELECT)
|
|
|
|
|
marker->flag &= ~SELECT;
|
|
|
|
|
else
|
|
|
|
|
marker->flag |= SELECT;
|
|
|
|
|
}
|
|
|
|
|
else {
|
2010-04-24 10:08:07 +00:00
|
|
|
/* deselect_markers(0, 0); */ /* XXX, in 2.4x, seq selection used to deselect all, need to re-thnik this for 2.5 */
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
marker->flag |= SELECT;
|
|
|
|
|
}
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
}
|
|
|
|
|
else if (left_right) {
|
2009-10-19 12:27:40 +00:00
|
|
|
/* use different logic for this */
|
|
|
|
|
float x;
|
|
|
|
|
deselect_all_seq(scene);
|
2011-05-24 05:22:58 +00:00
|
|
|
UI_view2d_region_to_view(v2d, event->mval[0], event->mval[1], &x, NULL);
|
2009-10-19 12:27:40 +00:00
|
|
|
|
|
|
|
|
SEQP_BEGIN(ed, seq) {
|
|
|
|
|
if (x < CFRA) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (seq->enddisp < CFRA) {
|
2009-10-19 12:27:40 +00:00
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
recurs_sel_seq(seq);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (seq->startdisp > CFRA) {
|
2009-10-19 12:27:40 +00:00
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
recurs_sel_seq(seq);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
SEQ_END
|
2010-03-31 07:22:18 +00:00
|
|
|
|
|
|
|
|
{
|
|
|
|
|
SpaceSeq *sseq= CTX_wm_space_seq(C);
|
|
|
|
|
if (sseq && sseq->flag & SEQ_MARKER_TRANS) {
|
2010-12-03 12:30:59 +00:00
|
|
|
TimeMarker *tmarker;
|
2010-03-31 07:22:18 +00:00
|
|
|
|
2010-12-03 12:30:59 +00:00
|
|
|
for (tmarker= scene->markers.first; tmarker; tmarker= tmarker->next) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if ( ((x < CFRA) && tmarker->frame < CFRA) ||
|
2010-12-03 12:30:59 +00:00
|
|
|
((x >= CFRA) && tmarker->frame >= CFRA)
|
2010-03-31 07:22:18 +00:00
|
|
|
) {
|
2010-12-03 12:30:59 +00:00
|
|
|
tmarker->flag |= SELECT;
|
2010-03-31 07:22:18 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2010-12-03 12:30:59 +00:00
|
|
|
tmarker->flag &= ~SELECT;
|
2010-03-31 07:22:18 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2009-11-14 20:46:18 +00:00
|
|
|
// seq= find_nearest_seq(scene, v2d, &hand, mval);
|
|
|
|
|
|
2009-10-19 11:39:57 +00:00
|
|
|
act_orig= ed->act_seq;
|
2009-02-15 17:24:09 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (extend == 0 && linked_handle==0)
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
deselect_all_seq(scene);
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (seq) {
|
2010-06-21 17:37:50 +00:00
|
|
|
seq_active_set(scene, seq);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
if ((seq->type == SEQ_IMAGE) || (seq->type == SEQ_MOVIE)) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (seq->strip) {
|
2011-09-26 18:51:10 +00:00
|
|
|
BLI_strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
}
|
|
|
|
|
else
|
2009-08-09 21:16:39 +00:00
|
|
|
if (seq->type == SEQ_SOUND) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (seq->strip) {
|
2011-09-26 18:51:10 +00:00
|
|
|
BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (extend && (seq->flag & SELECT) && ed->act_seq == act_orig ) {
|
2009-02-15 17:24:09 +00:00
|
|
|
switch(hand) {
|
|
|
|
|
case SEQ_SIDE_NONE:
|
2009-10-19 12:27:40 +00:00
|
|
|
if (linked_handle==0)
|
2010-06-24 10:04:18 +00:00
|
|
|
seq->flag &= ~SEQ_ALLSEL;
|
2009-02-15 17:24:09 +00:00
|
|
|
break;
|
|
|
|
|
case SEQ_SIDE_LEFT:
|
|
|
|
|
seq->flag ^= SEQ_LEFTSEL;
|
|
|
|
|
break;
|
|
|
|
|
case SEQ_SIDE_RIGHT:
|
|
|
|
|
seq->flag ^= SEQ_RIGHTSEL;
|
|
|
|
|
break;
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
seq->flag |= SELECT;
|
2012-03-24 06:38:07 +00:00
|
|
|
if (hand==SEQ_SIDE_LEFT) seq->flag |= SEQ_LEFTSEL;
|
|
|
|
|
if (hand==SEQ_SIDE_RIGHT) seq->flag |= SEQ_RIGHTSEL;
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
|
2009-10-19 12:27:40 +00:00
|
|
|
/* On Alt selection, select the strip and bordering handles */
|
|
|
|
|
if (linked_handle && !ELEM(hand, SEQ_SIDE_LEFT, SEQ_SIDE_RIGHT)) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (extend==0) deselect_all_seq(scene);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
select_surrounding_handles(scene, seq);
|
2009-02-13 14:16:56 +00:00
|
|
|
}
|
2009-10-19 12:27:40 +00:00
|
|
|
else if (linked_handle && ELEM(hand, SEQ_SIDE_LEFT, SEQ_SIDE_RIGHT) && (seq->flag & SELECT)) {
|
2009-02-15 17:24:09 +00:00
|
|
|
/*
|
|
|
|
|
* First click selects adjacent handles on that side.
|
|
|
|
|
* Second click selects all strips in that direction.
|
|
|
|
|
* If there are no adjacent strips, it just selects all in that direction.
|
|
|
|
|
*/
|
2009-10-19 12:27:40 +00:00
|
|
|
sel_side= hand;
|
2009-02-15 17:24:09 +00:00
|
|
|
neighbor=find_neighboring_sequence(scene, seq, sel_side, -1);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
if (neighbor) {
|
2009-02-15 17:24:09 +00:00
|
|
|
switch (sel_side) {
|
|
|
|
|
case SEQ_SIDE_LEFT:
|
|
|
|
|
if ((seq->flag & SEQ_LEFTSEL) && (neighbor->flag & SEQ_RIGHTSEL)) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (extend==0) deselect_all_seq(scene);
|
2009-02-15 17:24:09 +00:00
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
|
|
|
|
|
select_active_side(ed->seqbasep, SEQ_SIDE_LEFT, seq->machine, seq->startdisp);
|
2012-03-24 06:38:07 +00:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (extend==0) deselect_all_seq(scene);
|
2009-02-15 17:24:09 +00:00
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
neighbor->flag |= SELECT;
|
|
|
|
|
recurs_sel_seq(neighbor);
|
|
|
|
|
neighbor->flag |= SEQ_RIGHTSEL;
|
|
|
|
|
seq->flag |= SEQ_LEFTSEL;
|
|
|
|
|
}
|
|
|
|
|
break;
|
2009-02-15 17:24:09 +00:00
|
|
|
case SEQ_SIDE_RIGHT:
|
|
|
|
|
if ((seq->flag & SEQ_RIGHTSEL) && (neighbor->flag & SEQ_LEFTSEL)) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (extend==0) deselect_all_seq(scene);
|
2009-02-15 17:24:09 +00:00
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
|
|
|
|
|
select_active_side(ed->seqbasep, SEQ_SIDE_RIGHT, seq->machine, seq->startdisp);
|
2012-03-24 06:38:07 +00:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (extend==0) deselect_all_seq(scene);
|
2009-02-15 17:24:09 +00:00
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
neighbor->flag |= SELECT;
|
|
|
|
|
recurs_sel_seq(neighbor);
|
|
|
|
|
neighbor->flag |= SEQ_LEFTSEL;
|
|
|
|
|
seq->flag |= SEQ_RIGHTSEL;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (extend==0) deselect_all_seq(scene);
|
2009-02-15 17:24:09 +00:00
|
|
|
select_active_side(ed->seqbasep, sel_side, seq->machine, seq->startdisp);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
recurs_sel_seq(seq);
|
2009-11-14 20:46:18 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (linked_time) {
|
2009-11-14 20:46:18 +00:00
|
|
|
select_linked_time(ed->seqbasep, seq);
|
|
|
|
|
}
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* marker transform */
|
|
|
|
|
#if 0 // XXX probably need to redo this differently for 2.5
|
|
|
|
|
if (marker) {
|
2011-05-12 16:47:36 +00:00
|
|
|
int mval[2], xo, yo;
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
// getmouseco_areawin(mval);
|
|
|
|
|
xo= mval[0];
|
|
|
|
|
yo= mval[1];
|
|
|
|
|
|
2012-03-24 07:52:14 +00:00
|
|
|
while (get_mbut()) {
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
// getmouseco_areawin(mval);
|
2012-03-24 06:38:07 +00:00
|
|
|
if (abs(mval[0]-xo)+abs(mval[1]-yo) > 4) {
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
transform_markers('g', 0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2010-06-18 04:39:32 +00:00
|
|
|
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
|
2009-12-08 13:57:51 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
/* allowing tweaks */
|
2009-01-28 22:36:34 +00:00
|
|
|
return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SEQUENCER_OT_select(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->name = "Activate/Select";
|
|
|
|
|
ot->idname = "SEQUENCER_OT_select";
|
|
|
|
|
ot->description = "Select a strip (last selected becomes the \"active strip\")";
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->invoke = sequencer_select_invoke;
|
|
|
|
|
ot->poll = ED_operator_sequencer_active;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
|
|
|
|
/* flags */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
/* properties */
|
2011-09-19 12:26:20 +00:00
|
|
|
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection");
|
|
|
|
|
RNA_def_boolean(ot->srna, "linked_handle", 0, "Linked Handle", "Select handles next to the active strip");
|
2012-03-18 07:38:51 +00:00
|
|
|
/* for animation this is an enum but atm having an enum isn't useful for us */
|
2011-09-19 12:26:20 +00:00
|
|
|
RNA_def_boolean(ot->srna, "left_right", 0, "Left/Right", "Select based on the current frame side the cursor is on");
|
|
|
|
|
RNA_def_boolean(ot->srna, "linked_time", 0, "Linked Time", "Select other strips at the same time");
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-17 06:39:13 +00:00
|
|
|
/* run recursively to select linked */
|
2011-09-28 05:53:40 +00:00
|
|
|
static int select_more_less_seq__internal(Scene *scene, int sel, int linked)
|
|
|
|
|
{
|
2009-01-28 22:36:34 +00:00
|
|
|
Editing *ed= seq_give_editing(scene, FALSE);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
Sequence *seq, *neighbor;
|
|
|
|
|
int change=0;
|
|
|
|
|
int isel;
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ed==NULL) return 0;
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
if (sel) {
|
|
|
|
|
sel = SELECT;
|
|
|
|
|
isel = 0;
|
2012-03-24 06:38:07 +00:00
|
|
|
}
|
|
|
|
|
else {
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
sel = 0;
|
|
|
|
|
isel = SELECT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!linked) {
|
|
|
|
|
/* if not linked we only want to touch each seq once, newseq */
|
2012-03-24 06:38:07 +00:00
|
|
|
for (seq= ed->seqbasep->first; seq; seq= seq->next) {
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
seq->tmp = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
for (seq= ed->seqbasep->first; seq; seq= seq->next) {
|
|
|
|
|
if ((int)(seq->flag & SELECT) == sel) {
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
if ((linked==0 && seq->tmp)==0) {
|
|
|
|
|
/* only get unselected nabours */
|
2009-02-15 17:24:09 +00:00
|
|
|
neighbor = find_neighboring_sequence(scene, seq, SEQ_SIDE_LEFT, isel);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
if (neighbor) {
|
|
|
|
|
if (sel) {neighbor->flag |= SELECT; recurs_sel_seq(neighbor);}
|
|
|
|
|
else neighbor->flag &= ~SELECT;
|
|
|
|
|
if (linked==0) neighbor->tmp = (Sequence *)1;
|
|
|
|
|
change = 1;
|
|
|
|
|
}
|
2009-02-15 17:24:09 +00:00
|
|
|
neighbor = find_neighboring_sequence(scene, seq, SEQ_SIDE_RIGHT, isel);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
if (neighbor) {
|
|
|
|
|
if (sel) {neighbor->flag |= SELECT; recurs_sel_seq(neighbor);}
|
|
|
|
|
else neighbor->flag &= ~SELECT;
|
|
|
|
|
if (linked==0) neighbor->tmp = (void *)1;
|
|
|
|
|
change = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return change;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* select more operator */
|
2010-10-15 01:36:14 +00:00
|
|
|
static int sequencer_select_more_exec(bContext *C, wmOperator *UNUSED(op))
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
{
|
|
|
|
|
Scene *scene= CTX_data_scene(C);
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (!select_more_less_seq__internal(scene, 0, 0))
|
2009-12-08 13:57:51 +00:00
|
|
|
return OPERATOR_CANCELLED;
|
|
|
|
|
|
2010-06-18 04:39:32 +00:00
|
|
|
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SEQUENCER_OT_select_more(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->name = "Select More";
|
|
|
|
|
ot->idname = "SEQUENCER_OT_select_more";
|
|
|
|
|
ot->description = "Select more strips adjacent to the current selection";
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->exec = sequencer_select_more_exec;
|
|
|
|
|
ot->poll = sequencer_edit_poll;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
|
|
|
|
/* flags */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
/* properties */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* select less operator */
|
2010-10-15 01:36:14 +00:00
|
|
|
static int sequencer_select_less_exec(bContext *C, wmOperator *UNUSED(op))
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
{
|
|
|
|
|
Scene *scene= CTX_data_scene(C);
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (!select_more_less_seq__internal(scene, 1, 0))
|
2009-12-08 13:57:51 +00:00
|
|
|
return OPERATOR_CANCELLED;
|
|
|
|
|
|
2010-06-18 04:39:32 +00:00
|
|
|
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SEQUENCER_OT_select_less(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->name = "Select Less";
|
|
|
|
|
ot->idname = "SEQUENCER_OT_select_less";
|
|
|
|
|
ot->description = "Shrink the current selection of adjacent selected strips";
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->exec = sequencer_select_less_exec;
|
|
|
|
|
ot->poll = sequencer_edit_poll;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
|
|
|
|
/* flags */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
/* properties */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* select pick linked operator (uses the mouse) */
|
2009-03-29 02:15:13 +00:00
|
|
|
static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
{
|
|
|
|
|
Scene *scene= CTX_data_scene(C);
|
|
|
|
|
View2D *v2d= UI_view2d_fromcontext(C);
|
|
|
|
|
|
2009-02-15 17:24:09 +00:00
|
|
|
short extend= RNA_boolean_get(op->ptr, "extend");
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
Sequence *mouse_seq;
|
|
|
|
|
int selected, hand;
|
2011-05-20 07:40:05 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
/* this works like UV, not mesh */
|
2011-05-20 07:40:05 +00:00
|
|
|
mouse_seq= find_nearest_seq(scene, v2d, &hand, event->mval);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
if (!mouse_seq)
|
|
|
|
|
return OPERATOR_FINISHED; /* user error as with mesh?? */
|
|
|
|
|
|
|
|
|
|
if (extend==0)
|
|
|
|
|
deselect_all_seq(scene);
|
|
|
|
|
|
|
|
|
|
mouse_seq->flag |= SELECT;
|
|
|
|
|
recurs_sel_seq(mouse_seq);
|
|
|
|
|
|
|
|
|
|
selected = 1;
|
|
|
|
|
while (selected) {
|
|
|
|
|
selected = select_more_less_seq__internal(scene, 1, 1);
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-18 04:39:32 +00:00
|
|
|
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
2009-03-29 02:15:13 +00:00
|
|
|
void SEQUENCER_OT_select_linked_pick(wmOperatorType *ot)
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->name = "Select pick linked";
|
|
|
|
|
ot->idname = "SEQUENCER_OT_select_linked_pick";
|
|
|
|
|
ot->description = "Select a chain of linked strips nearest to the mouse pointer";
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->invoke = sequencer_select_linked_pick_invoke;
|
|
|
|
|
ot->poll = ED_operator_sequencer_active;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
|
|
|
|
/* flags */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
/* properties */
|
2012-02-27 18:14:56 +00:00
|
|
|
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection");
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* select linked operator */
|
2010-10-15 01:36:14 +00:00
|
|
|
static int sequencer_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
{
|
|
|
|
|
Scene *scene= CTX_data_scene(C);
|
|
|
|
|
int selected;
|
2009-01-31 09:58:38 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
selected = 1;
|
|
|
|
|
while (selected) {
|
|
|
|
|
selected = select_more_less_seq__internal(scene, 1, 1);
|
|
|
|
|
}
|
2009-01-31 09:58:38 +00:00
|
|
|
|
2010-06-18 04:39:32 +00:00
|
|
|
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
|
2009-01-31 09:58:38 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SEQUENCER_OT_select_linked(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->name = "Select linked";
|
|
|
|
|
ot->idname = "SEQUENCER_OT_select_linked";
|
|
|
|
|
ot->description = "Select all strips adjacent to the current selection";
|
2009-09-12 17:16:12 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->exec = sequencer_select_linked_exec;
|
|
|
|
|
ot->poll = sequencer_edit_poll;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
|
|
|
|
/* flags */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
/* properties */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-02-13 14:16:56 +00:00
|
|
|
/* select handles operator */
|
2009-01-31 09:58:38 +00:00
|
|
|
static int sequencer_select_handles_exec(bContext *C, wmOperator *op)
|
|
|
|
|
{
|
|
|
|
|
Scene *scene= CTX_data_scene(C);
|
|
|
|
|
Editing *ed= seq_give_editing(scene, 0);
|
|
|
|
|
Sequence *seq;
|
|
|
|
|
int sel_side= RNA_enum_get(op->ptr, "side");
|
|
|
|
|
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
for (seq= ed->seqbasep->first; seq; seq=seq->next) {
|
2009-01-31 09:58:38 +00:00
|
|
|
if (seq->flag & SELECT) {
|
|
|
|
|
switch(sel_side) {
|
|
|
|
|
case SEQ_SIDE_LEFT:
|
|
|
|
|
seq->flag &= ~SEQ_RIGHTSEL;
|
|
|
|
|
seq->flag |= SEQ_LEFTSEL;
|
|
|
|
|
break;
|
|
|
|
|
case SEQ_SIDE_RIGHT:
|
|
|
|
|
seq->flag &= ~SEQ_LEFTSEL;
|
|
|
|
|
seq->flag |= SEQ_RIGHTSEL;
|
|
|
|
|
break;
|
|
|
|
|
case SEQ_SIDE_BOTH:
|
|
|
|
|
seq->flag |= SEQ_LEFTSEL+SEQ_RIGHTSEL;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-18 04:39:32 +00:00
|
|
|
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
|
2009-01-31 09:58:38 +00:00
|
|
|
|
|
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SEQUENCER_OT_select_handles(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->name = "Select Handles";
|
|
|
|
|
ot->idname = "SEQUENCER_OT_select_handles";
|
|
|
|
|
ot->description = "Select manipulator handles on the sides of the selected strip";
|
2009-09-12 17:16:12 +00:00
|
|
|
|
2009-01-31 09:58:38 +00:00
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->exec = sequencer_select_handles_exec;
|
|
|
|
|
ot->poll = sequencer_edit_poll;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
|
|
|
|
/* flags */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
2009-02-13 14:16:56 +00:00
|
|
|
/* properties */
|
|
|
|
|
RNA_def_enum(ot->srna, "side", prop_side_types, SEQ_SIDE_BOTH, "Side", "The side of the handle that is selected");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* select side operator */
|
|
|
|
|
static int sequencer_select_active_side_exec(bContext *C, wmOperator *op)
|
|
|
|
|
{
|
|
|
|
|
Scene *scene= CTX_data_scene(C);
|
|
|
|
|
Editing *ed= seq_give_editing(scene, 0);
|
2010-06-21 17:37:50 +00:00
|
|
|
Sequence *seq_act= seq_active_get(scene);
|
2009-02-13 14:16:56 +00:00
|
|
|
|
2009-02-15 17:24:09 +00:00
|
|
|
if (ed==NULL || seq_act==NULL)
|
2009-02-13 14:16:56 +00:00
|
|
|
return OPERATOR_CANCELLED;
|
|
|
|
|
|
|
|
|
|
seq_act->flag |= SELECT;
|
|
|
|
|
|
2009-02-15 17:24:09 +00:00
|
|
|
select_active_side(ed->seqbasep, RNA_enum_get(op->ptr, "side"), seq_act->machine, seq_act->startdisp);
|
2009-02-13 14:16:56 +00:00
|
|
|
|
2010-06-18 04:39:32 +00:00
|
|
|
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
|
2009-02-13 14:16:56 +00:00
|
|
|
|
|
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SEQUENCER_OT_select_active_side(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->name = "Select Active Side";
|
|
|
|
|
ot->idname = "SEQUENCER_OT_select_active_side";
|
|
|
|
|
ot->description = "Select strips on the nominated side of the active strip";
|
2009-09-12 17:16:12 +00:00
|
|
|
|
2009-02-13 14:16:56 +00:00
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->exec = sequencer_select_active_side_exec;
|
|
|
|
|
ot->poll = sequencer_edit_poll;
|
2009-02-13 14:16:56 +00:00
|
|
|
|
|
|
|
|
/* flags */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
2009-02-13 14:16:56 +00:00
|
|
|
|
2009-01-31 09:58:38 +00:00
|
|
|
/* properties */
|
|
|
|
|
RNA_def_enum(ot->srna, "side", prop_side_types, SEQ_SIDE_BOTH, "Side", "The side of the handle that is selected");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
/* borderselect operator */
|
|
|
|
|
static int sequencer_borderselect_exec(bContext *C, wmOperator *op)
|
|
|
|
|
{
|
|
|
|
|
Scene *scene= CTX_data_scene(C);
|
2009-01-28 22:36:34 +00:00
|
|
|
Editing *ed= seq_give_editing(scene, FALSE);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
View2D *v2d= UI_view2d_fromcontext(C);
|
|
|
|
|
|
|
|
|
|
Sequence *seq;
|
|
|
|
|
rcti rect;
|
|
|
|
|
rctf rectf, rq;
|
2009-11-06 22:51:08 +00:00
|
|
|
short selecting = (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT);
|
2011-11-16 19:22:14 +00:00
|
|
|
int extend = RNA_boolean_get(op->ptr, "extend");
|
2011-05-12 16:47:36 +00:00
|
|
|
int mval[2];
|
2009-01-28 22:36:34 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ed==NULL)
|
2009-01-28 22:36:34 +00:00
|
|
|
return OPERATOR_CANCELLED;
|
|
|
|
|
|
2012-03-24 02:51:46 +00:00
|
|
|
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
|
|
|
|
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
|
|
|
|
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
|
|
|
|
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
mval[0]= rect.xmin;
|
|
|
|
|
mval[1]= rect.ymin;
|
|
|
|
|
UI_view2d_region_to_view(v2d, mval[0], mval[1], &rectf.xmin, &rectf.ymin);
|
|
|
|
|
mval[0]= rect.xmax;
|
|
|
|
|
mval[1]= rect.ymax;
|
|
|
|
|
UI_view2d_region_to_view(v2d, mval[0], mval[1], &rectf.xmax, &rectf.ymax);
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
for (seq= ed->seqbasep->first; seq; seq= seq->next) {
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
seq_rectf(seq, &rq);
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (BLI_isect_rctf(&rq, &rectf, NULL)) {
|
|
|
|
|
if (selecting) seq->flag |= SELECT;
|
2010-06-24 10:04:18 +00:00
|
|
|
else seq->flag &= ~SEQ_ALLSEL;
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
recurs_sel_seq(seq);
|
|
|
|
|
}
|
2012-03-24 06:38:07 +00:00
|
|
|
else if (!extend) {
|
2011-11-16 19:22:14 +00:00
|
|
|
seq->flag &= ~SEQ_ALLSEL;
|
|
|
|
|
recurs_sel_seq(seq);
|
|
|
|
|
}
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
|
|
|
|
|
2010-06-18 04:39:32 +00:00
|
|
|
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
|
2009-12-17 11:40:12 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ****** Border Select ****** */
|
2009-03-29 02:15:13 +00:00
|
|
|
void SEQUENCER_OT_select_border(wmOperatorType *ot)
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->name = "Border Select";
|
|
|
|
|
ot->idname = "SEQUENCER_OT_select_border";
|
|
|
|
|
ot->description = "Enable border select mode";
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
|
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->invoke = WM_border_select_invoke;
|
|
|
|
|
ot->exec = sequencer_borderselect_exec;
|
|
|
|
|
ot->modal = WM_border_select_modal;
|
|
|
|
|
ot->cancel = WM_border_select_cancel;
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->poll = ED_operator_sequencer_active;
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
|
2009-01-31 19:40:40 +00:00
|
|
|
/* flags */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
2009-01-31 19:40:40 +00:00
|
|
|
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
/* rna */
|
2011-11-16 19:22:14 +00:00
|
|
|
WM_operator_properties_gesture_border(ot, TRUE);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 21:42:18 +00:00
|
|
|
}
|
2011-09-28 14:12:27 +00:00
|
|
|
|
|
|
|
|
/* ****** Selected Grouped ****** */
|
|
|
|
|
|
|
|
|
|
static EnumPropertyItem sequencer_prop_select_grouped_types[] = {
|
|
|
|
|
{1, "TYPE", 0, "Type", "Shared strip type"},
|
|
|
|
|
{2, "TYPE_BASIC", 0, "Global Type", "All strips of same basic type (Graphical or Sound)"},
|
2011-09-28 15:22:13 +00:00
|
|
|
{3, "TYPE_EFFECT", 0, "Effect Type",
|
|
|
|
|
"Shared strip effect type (if active strip is not an effect one, select all non-effect strips)"},
|
2011-09-28 14:12:27 +00:00
|
|
|
{4, "DATA", 0, "Data", "Shared data (scene, image, sound, etc.)"},
|
|
|
|
|
{5, "EFFECT", 0, "Effect", "Shared effects"},
|
2011-09-28 15:22:13 +00:00
|
|
|
{6, "EFFECT_LINK", 0, "Effect/Linked",
|
|
|
|
|
"Other strips affected by the active one (sharing some time, and below or effect-assigned)"},
|
|
|
|
|
{7, "OVERLAP", 0, "Overlap", "Overlapping time"},
|
2011-09-28 14:12:27 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define SEQ_IS_SOUND(_seq) ((_seq->type & SEQ_SOUND) && !(_seq->type & SEQ_EFFECT))
|
|
|
|
|
|
|
|
|
|
#define SEQ_IS_EFFECT(_seq) (_seq->type & SEQ_EFFECT)
|
|
|
|
|
|
|
|
|
|
#define SEQ_USE_DATA(_seq) (_seq->type == SEQ_SCENE || SEQ_HAS_PATH(_seq))
|
|
|
|
|
|
|
|
|
|
static short select_grouped_type(Editing *ed, Sequence *actseq)
|
|
|
|
|
{
|
|
|
|
|
Sequence *seq;
|
|
|
|
|
short changed = FALSE;
|
|
|
|
|
|
|
|
|
|
SEQP_BEGIN(ed, seq) {
|
|
|
|
|
if (seq->type == actseq->type) {
|
|
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
changed = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
SEQ_END;
|
|
|
|
|
|
|
|
|
|
return changed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static short select_grouped_type_basic(Editing *ed, Sequence *actseq)
|
|
|
|
|
{
|
|
|
|
|
Sequence *seq;
|
|
|
|
|
short changed = FALSE;
|
|
|
|
|
short is_sound = SEQ_IS_SOUND(actseq);
|
|
|
|
|
|
|
|
|
|
SEQP_BEGIN(ed, seq) {
|
|
|
|
|
if (is_sound ? SEQ_IS_SOUND(seq) : !SEQ_IS_SOUND(seq)) {
|
|
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
changed = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
SEQ_END;
|
|
|
|
|
|
|
|
|
|
return changed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static short select_grouped_type_effect(Editing *ed, Sequence *actseq)
|
|
|
|
|
{
|
|
|
|
|
Sequence *seq;
|
|
|
|
|
short changed = FALSE;
|
|
|
|
|
short is_effect = SEQ_IS_EFFECT(actseq);
|
|
|
|
|
|
|
|
|
|
SEQP_BEGIN(ed, seq) {
|
|
|
|
|
if (is_effect ? SEQ_IS_EFFECT(seq) : !SEQ_IS_EFFECT(seq)) {
|
|
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
changed = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
SEQ_END;
|
|
|
|
|
|
|
|
|
|
return changed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static short select_grouped_data(Editing *ed, Sequence *actseq)
|
|
|
|
|
{
|
|
|
|
|
Sequence *seq;
|
|
|
|
|
short changed = FALSE;
|
|
|
|
|
Scene *sce = actseq->scene;
|
|
|
|
|
char *dir = actseq->strip ? actseq->strip->dir : NULL;
|
|
|
|
|
|
|
|
|
|
if (!SEQ_USE_DATA(actseq))
|
|
|
|
|
return changed;
|
|
|
|
|
|
|
|
|
|
if (SEQ_HAS_PATH(actseq) && dir) {
|
|
|
|
|
SEQP_BEGIN(ed, seq) {
|
|
|
|
|
if (SEQ_HAS_PATH(seq) && seq->strip && strcmp(seq->strip->dir, dir) == 0) {
|
|
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
changed = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
SEQ_END;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
SEQP_BEGIN(ed, seq) {
|
|
|
|
|
if (seq->type == SEQ_SCENE && seq->scene == sce) {
|
|
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
changed = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
SEQ_END;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return changed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static short select_grouped_effect(Editing *ed, Sequence *actseq)
|
|
|
|
|
{
|
|
|
|
|
Sequence *seq;
|
|
|
|
|
short changed = FALSE;
|
|
|
|
|
short effects[SEQ_EFFECT_MAX+1];
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i <= SEQ_EFFECT_MAX; i++)
|
|
|
|
|
effects[i] = FALSE;
|
|
|
|
|
|
|
|
|
|
SEQP_BEGIN(ed, seq) {
|
|
|
|
|
if (ELEM3(actseq, seq->seq1, seq->seq2, seq->seq3)) {
|
|
|
|
|
effects[seq->type] = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
SEQ_END;
|
|
|
|
|
|
|
|
|
|
SEQP_BEGIN(ed, seq) {
|
|
|
|
|
if (effects[seq->type]) {
|
2012-03-24 06:38:07 +00:00
|
|
|
if (seq->seq1) seq->seq1->flag |= SELECT;
|
|
|
|
|
if (seq->seq2) seq->seq2->flag |= SELECT;
|
|
|
|
|
if (seq->seq3) seq->seq3->flag |= SELECT;
|
2011-09-28 14:12:27 +00:00
|
|
|
changed = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
SEQ_END;
|
|
|
|
|
|
|
|
|
|
return changed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static short select_grouped_time_overlap(Editing *ed, Sequence *actseq)
|
|
|
|
|
{
|
|
|
|
|
Sequence *seq;
|
|
|
|
|
short changed = FALSE;
|
|
|
|
|
|
|
|
|
|
SEQP_BEGIN(ed, seq) {
|
|
|
|
|
if (!((seq->startdisp >= actseq->enddisp) || (seq->enddisp < actseq->startdisp))) {
|
|
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
changed = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
SEQ_END;
|
|
|
|
|
|
|
|
|
|
return changed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static short select_grouped_effect_link(Editing *ed, Sequence *actseq)
|
|
|
|
|
{
|
2011-09-28 15:22:13 +00:00
|
|
|
Sequence *seq = NULL;
|
2011-09-28 14:12:27 +00:00
|
|
|
short changed = FALSE;
|
|
|
|
|
short is_audio = ((actseq->type == SEQ_META) || SEQ_IS_SOUND(actseq));
|
|
|
|
|
int startdisp = actseq->startdisp;
|
|
|
|
|
int enddisp = actseq->enddisp;
|
|
|
|
|
int machine = actseq->machine;
|
|
|
|
|
SeqIterator iter;
|
|
|
|
|
|
|
|
|
|
SEQP_BEGIN(ed, seq) {
|
|
|
|
|
seq->tmp= NULL;
|
|
|
|
|
}
|
|
|
|
|
SEQ_END;
|
|
|
|
|
|
2011-10-06 05:10:09 +00:00
|
|
|
actseq->tmp= SET_INT_IN_POINTER(TRUE);
|
2011-09-28 14:12:27 +00:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
for (seq_begin(ed, &iter, 1); iter.valid; seq_next(&iter)) {
|
2011-09-28 14:12:27 +00:00
|
|
|
seq = iter.seq;
|
|
|
|
|
|
|
|
|
|
/* Ignore all seqs already selected! */
|
|
|
|
|
/* Ignore all seqs not sharing some time with active one. */
|
|
|
|
|
/* Ignore all seqs of incompatible types (audio vs video). */
|
|
|
|
|
if ((seq->flag & SELECT) || (seq->startdisp >= enddisp) || (seq->enddisp < startdisp)
|
|
|
|
|
|| (!is_audio && SEQ_IS_SOUND(seq))
|
|
|
|
|
|| (is_audio && !((seq->type == SEQ_META) || SEQ_IS_SOUND(seq))))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* If the seq is an effect one, we need extra cheking! */
|
|
|
|
|
if (SEQ_IS_EFFECT(seq) && ((seq->seq1 && seq->seq1->tmp) ||
|
|
|
|
|
(seq->seq2 && seq->seq2->tmp) ||
|
|
|
|
|
(seq->seq3 && seq->seq3->tmp)))
|
|
|
|
|
{
|
|
|
|
|
if (startdisp > seq->startdisp) startdisp = seq->startdisp;
|
|
|
|
|
if (enddisp < seq->enddisp) enddisp = seq->enddisp;
|
|
|
|
|
if (machine < seq->machine) machine = seq->machine;
|
|
|
|
|
|
|
|
|
|
seq->tmp= SET_INT_IN_POINTER(TRUE);
|
|
|
|
|
|
|
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
changed = TRUE;
|
|
|
|
|
|
2012-03-02 16:05:54 +00:00
|
|
|
/* Unfortunately, we must restart checks from the beginning. */
|
2011-09-28 14:12:27 +00:00
|
|
|
seq_end(&iter);
|
|
|
|
|
seq_begin(ed, &iter, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Video strips bellow active one, or any strip for audio (order do no matters here!). */
|
|
|
|
|
else if (seq->machine < machine || is_audio) {
|
|
|
|
|
seq->flag |= SELECT;
|
|
|
|
|
changed = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
seq_end(&iter);
|
|
|
|
|
|
|
|
|
|
return changed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
int type = RNA_enum_get(op->ptr, "type");
|
|
|
|
|
short changed = 0, extend;
|
|
|
|
|
|
|
|
|
|
extend = RNA_boolean_get(op->ptr, "extend");
|
|
|
|
|
|
|
|
|
|
if (actseq == NULL) {
|
|
|
|
|
BKE_report(op->reports, RPT_ERROR, "No Active Sequence!");
|
|
|
|
|
return OPERATOR_CANCELLED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (extend == 0) {
|
|
|
|
|
SEQP_BEGIN(ed, seq) {
|
|
|
|
|
seq->flag &= ~SELECT;
|
|
|
|
|
changed = TRUE;
|
|
|
|
|
}
|
|
|
|
|
SEQ_END;
|
|
|
|
|
}
|
|
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (type==1) changed |= select_grouped_type(ed, actseq);
|
|
|
|
|
else if (type==2) changed |= select_grouped_type_basic(ed, actseq);
|
|
|
|
|
else if (type==3) changed |= select_grouped_type_effect(ed, actseq);
|
|
|
|
|
else if (type==4) changed |= select_grouped_data(ed, actseq);
|
|
|
|
|
else if (type==5) changed |= select_grouped_effect(ed, actseq);
|
|
|
|
|
else if (type==6) changed |= select_grouped_effect_link(ed, actseq);
|
|
|
|
|
else if (type==7) changed |= select_grouped_time_overlap(ed, actseq);
|
2011-09-28 14:12:27 +00:00
|
|
|
|
|
|
|
|
if (changed) {
|
|
|
|
|
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
|
|
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return OPERATOR_CANCELLED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SEQUENCER_OT_select_grouped(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
|
|
|
|
ot->name = "Select Grouped";
|
2011-09-29 10:17:34 +00:00
|
|
|
ot->description = "Select all strips grouped by various properties";
|
2011-09-28 14:12:27 +00:00
|
|
|
ot->idname = "SEQUENCER_OT_select_grouped";
|
|
|
|
|
|
|
|
|
|
/* api callbacks */
|
|
|
|
|
ot->invoke = WM_menu_invoke;
|
|
|
|
|
ot->exec = sequencer_select_grouped_exec;
|
|
|
|
|
ot->poll = sequencer_edit_poll;
|
|
|
|
|
|
|
|
|
|
/* flags */
|
|
|
|
|
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
|
|
|
|
|
|
|
|
|
/* properties */
|
2011-09-29 10:17:34 +00:00
|
|
|
RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
|
2011-09-28 14:12:27 +00:00
|
|
|
ot->prop = RNA_def_enum(ot->srna, "type", sequencer_prop_select_grouped_types, 0, "Type", "");
|
|
|
|
|
}
|
|
|
|
|
|