Blender  V3.3
Classes
sequencer_select.c File Reference
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "DNA_scene_types.h"
#include "BKE_context.h"
#include "BKE_report.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_define.h"
#include "SEQ_channels.h"
#include "SEQ_iterator.h"
#include "SEQ_relations.h"
#include "SEQ_select.h"
#include "SEQ_sequencer.h"
#include "SEQ_time.h"
#include "SEQ_transform.h"
#include "SEQ_utils.h"
#include "ED_outliner.h"
#include "ED_screen.h"
#include "ED_select_utils.h"
#include "ED_sequencer.h"
#include "UI_view2d.h"
#include "sequencer_intern.h"

Go to the source code of this file.

Classes

struct  SeqSelect_Link
 

Functions

Selection Utilities
SeqCollectionall_strips_from_context (bContext *C)
 
SeqCollectionselected_strips_from_context (bContext *C)
 
static void select_surrounding_handles (Scene *scene, Sequence *test)
 
static void select_active_side (const Scene *scene, ListBase *seqbase, int sel_side, int channel, int frame)
 
static void select_active_side_range (const Scene *scene, ListBase *seqbase, const int sel_side, const int frame_ranges[MAXSEQ], const int frame_ignore)
 
static void select_linked_time (const Scene *scene, ListBase *seqbase, Sequence *seq_link)
 
void ED_sequencer_select_sequence_single (Scene *scene, Sequence *seq, bool deselect_all)
 
void seq_rectf (const Scene *scene, Sequence *seq, rctf *rect)
 
Sequencefind_neighboring_sequence (Scene *scene, Sequence *test, int lr, int sel)
 
Sequencefind_nearest_seq (Scene *scene, View2D *v2d, int *hand, const int mval[2])
 
void recurs_sel_seq (Sequence *seq_meta)
 
static bool seq_point_image_isect (const Scene *scene, const Sequence *seq, float point[2])
 
static void sequencer_select_do_updates (bContext *C, Scene *scene)
 
(De)select All Operator
static int sequencer_de_select_all_exec (bContext *C, wmOperator *op)
 
void SEQUENCER_OT_select_all (struct wmOperatorType *ot)
 
Select Inverse Operator
static int sequencer_select_inverse_exec (bContext *C, wmOperator *UNUSED(op))
 
void SEQUENCER_OT_select_inverse (struct wmOperatorType *ot)
 
Select Operator
static void sequencer_select_set_active (Scene *scene, Sequence *seq)
 
static void sequencer_select_side_of_frame (const bContext *C, const View2D *v2d, const int mval[2], Scene *scene)
 
static void sequencer_select_linked_handle (const bContext *C, Sequence *seq, const int handle_clicked)
 
static int seq_sort_for_depth_select (const void *a, const void *b)
 
static int seq_sort_for_center_select (const void *a, const void *b)
 
static Sequenceseq_select_seq_from_preview (const bContext *C, const int mval[2], const bool toggle, const bool extend, const bool center)
 
static bool element_already_selected (const Sequence *seq, const int handle_clicked)
 
static void sequencer_select_strip_impl (const Editing *ed, Sequence *seq, const int handle_clicked, const bool extend, const bool deselect, const bool toggle)
 
static int sequencer_select_exec (bContext *C, wmOperator *op)
 
static int sequencer_select_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void SEQUENCER_OT_select (wmOperatorType *ot)
 
Select More Operator
static bool select_linked_internal (Scene *scene)
 
static bool select_more_less_seq__internal (Scene *scene, bool select_more)
 
static int sequencer_select_more_exec (bContext *C, wmOperator *UNUSED(op))
 
void SEQUENCER_OT_select_more (wmOperatorType *ot)
 
Select Less Operator
static int sequencer_select_less_exec (bContext *C, wmOperator *UNUSED(op))
 
void SEQUENCER_OT_select_less (wmOperatorType *ot)
 
Select Pick Linked Operator
static int sequencer_select_linked_pick_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void SEQUENCER_OT_select_linked_pick (wmOperatorType *ot)
 
Select Linked Operator
static int sequencer_select_linked_exec (bContext *C, wmOperator *UNUSED(op))
 
void SEQUENCER_OT_select_linked (wmOperatorType *ot)
 
Select Side of Frame Operator
static int sequencer_select_side_of_frame_exec (bContext *C, wmOperator *op)
 
void SEQUENCER_OT_select_side_of_frame (wmOperatorType *ot)
 
Select Side Operator
static int sequencer_select_side_exec (bContext *C, wmOperator *op)
 
void SEQUENCER_OT_select_side (wmOperatorType *ot)
 
Box Select Operator
static bool seq_box_select_rect_image_isect (const Scene *scene, const Sequence *seq, rctf *rect)
 
static void seq_box_select_seq_from_preview (const bContext *C, rctf *rect, const eSelectOp mode)
 
static int sequencer_box_select_exec (bContext *C, wmOperator *op)
 
static int sequencer_box_select_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void SEQUENCER_OT_select_box (wmOperatorType *ot)
 

Select Grouped Operator

#define SEQ_IS_SOUND(_seq)   ((_seq->type & SEQ_TYPE_SOUND_RAM) && !(_seq->type & SEQ_TYPE_EFFECT))
 
#define SEQ_IS_EFFECT(_seq)   ((_seq->type & SEQ_TYPE_EFFECT) != 0)
 
#define SEQ_USE_DATA(_seq)    (ELEM(_seq->type, SEQ_TYPE_SCENE, SEQ_TYPE_MOVIECLIP, SEQ_TYPE_MASK) || SEQ_HAS_PATH(_seq))
 
#define SEQ_CHANNEL_CHECK(_seq, _chan)   (ELEM((_chan), 0, (_seq)->machine))
 
enum  {
  SEQ_SELECT_GROUP_TYPE , SEQ_SELECT_GROUP_TYPE_BASIC , SEQ_SELECT_GROUP_TYPE_EFFECT , SEQ_SELECT_GROUP_DATA ,
  SEQ_SELECT_GROUP_EFFECT , SEQ_SELECT_GROUP_EFFECT_LINK , SEQ_SELECT_GROUP_OVERLAP
}
 
static const EnumPropertyItem sequencer_prop_select_grouped_types []
 
static bool select_grouped_type (SeqCollection *strips, ListBase *UNUSED(seqbase), Sequence *actseq, const int channel)
 
static bool select_grouped_type_basic (SeqCollection *strips, ListBase *UNUSED(seqbase), Sequence *actseq, const int channel)
 
static bool select_grouped_type_effect (SeqCollection *strips, ListBase *UNUSED(seqbase), Sequence *actseq, const int channel)
 
static bool select_grouped_data (SeqCollection *strips, ListBase *UNUSED(seqbase), Sequence *actseq, const int channel)
 
static bool select_grouped_effect (SeqCollection *strips, ListBase *UNUSED(seqbase), Sequence *actseq, const int channel)
 
static bool select_grouped_time_overlap (const Scene *scene, SeqCollection *strips, ListBase *UNUSED(seqbase), Sequence *actseq)
 
static void query_lower_channel_strips (const Scene *scene, Sequence *seq_reference, ListBase *seqbase, SeqCollection *collection)
 
static bool select_grouped_effect_link (const Scene *scene, SeqCollection *strips, ListBase *seqbase, Sequence *UNUSED(actseq), const int UNUSED(channel))
 
static int sequencer_select_grouped_exec (bContext *C, wmOperator *op)
 
void SEQUENCER_OT_select_grouped (wmOperatorType *ot)
 

Select Handles Operator

enum  {
  SEQ_SELECT_HANDLES_SIDE_LEFT , SEQ_SELECT_HANDLES_SIDE_RIGHT , SEQ_SELECT_HANDLES_SIDE_BOTH , SEQ_SELECT_HANDLES_SIDE_LEFT_NEIGHBOR ,
  SEQ_SELECT_HANDLES_SIDE_RIGHT_NEIGHBOR , SEQ_SELECT_HANDLES_SIDE_BOTH_NEIGHBORS
}
 
static const EnumPropertyItem prop_select_handles_side_types []
 
static int sequencer_select_handles_exec (bContext *C, wmOperator *op)
 
void SEQUENCER_OT_select_handles (wmOperatorType *ot)
 

Macro Definition Documentation

◆ SEQ_CHANNEL_CHECK

#define SEQ_CHANNEL_CHECK (   _seq,
  _chan 
)    (ELEM((_chan), 0, (_seq)->machine))

Definition at line 1818 of file sequencer_select.c.

◆ SEQ_IS_EFFECT

#define SEQ_IS_EFFECT (   _seq)    ((_seq->type & SEQ_TYPE_EFFECT) != 0)

Definition at line 1813 of file sequencer_select.c.

◆ SEQ_IS_SOUND

#define SEQ_IS_SOUND (   _seq)    ((_seq->type & SEQ_TYPE_SOUND_RAM) && !(_seq->type & SEQ_TYPE_EFFECT))

Definition at line 1811 of file sequencer_select.c.

◆ SEQ_USE_DATA

#define SEQ_USE_DATA (   _seq)     (ELEM(_seq->type, SEQ_TYPE_SCENE, SEQ_TYPE_MOVIECLIP, SEQ_TYPE_MASK) || SEQ_HAS_PATH(_seq))

Definition at line 1815 of file sequencer_select.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SEQ_SELECT_HANDLES_SIDE_LEFT 
SEQ_SELECT_HANDLES_SIDE_RIGHT 
SEQ_SELECT_HANDLES_SIDE_BOTH 
SEQ_SELECT_HANDLES_SIDE_LEFT_NEIGHBOR 
SEQ_SELECT_HANDLES_SIDE_RIGHT_NEIGHBOR 
SEQ_SELECT_HANDLES_SIDE_BOTH_NEIGHBORS 

Definition at line 1317 of file sequencer_select.c.

◆ anonymous enum

anonymous enum
Enumerator
SEQ_SELECT_GROUP_TYPE 
SEQ_SELECT_GROUP_TYPE_BASIC 
SEQ_SELECT_GROUP_TYPE_EFFECT 
SEQ_SELECT_GROUP_DATA 
SEQ_SELECT_GROUP_EFFECT 
SEQ_SELECT_GROUP_EFFECT_LINK 
SEQ_SELECT_GROUP_OVERLAP 

Definition at line 1776 of file sequencer_select.c.

Function Documentation

◆ all_strips_from_context()

SeqCollection* all_strips_from_context ( struct bContext C)

Returns collection with all strips presented to user. If operation is done in preview, collection is limited to all presented strips that can produce image output.

Parameters
Ccontext
Returns
collection of strips (Sequence)

Definition at line 53 of file sequencer_select.c.

References C, RenderData::cfra, channels(), CTX_data_scene(), Scene::r, scene, SEQ_active_seqbase_get(), SEQ_channels_displayed_get(), SEQ_editing_get(), SEQ_query_all_strips(), SEQ_query_rendered_strips(), and sequencer_view_has_preview_poll().

Referenced by sequencer_de_select_all_exec(), sequencer_select_grouped_exec(), and sequencer_select_inverse_exec().

◆ ED_sequencer_select_sequence_single()

void ED_sequencer_select_sequence_single ( Scene scene,
Sequence seq,
bool  deselect_all 
)

◆ element_already_selected()

static bool element_already_selected ( const Sequence seq,
const int  handle_clicked 
)
static

◆ find_nearest_seq()

Sequence* find_nearest_seq ( Scene scene,
View2D v2d,
int *  hand,
const int  mval[2] 
)

◆ find_neighboring_sequence()

Sequence* find_neighboring_sequence ( Scene scene,
Sequence test,
int  lr,
int  sel 
)

◆ query_lower_channel_strips()

static void query_lower_channel_strips ( const Scene scene,
Sequence seq_reference,
ListBase seqbase,
SeqCollection collection 
)
static

◆ recurs_sel_seq()

void recurs_sel_seq ( Sequence seq_meta)

◆ select_active_side()

static void select_active_side ( const Scene scene,
ListBase seqbase,
int  sel_side,
int  channel,
int  frame 
)
static

◆ select_active_side_range()

static void select_active_side_range ( const Scene scene,
ListBase seqbase,
const int  sel_side,
const int  frame_ranges[MAXSEQ],
const int  frame_ignore 
)
static

◆ select_grouped_data()

static bool select_grouped_data ( SeqCollection strips,
ListBase UNUSEDseqbase,
Sequence actseq,
const int  channel 
)
static

◆ select_grouped_effect()

static bool select_grouped_effect ( SeqCollection strips,
ListBase UNUSEDseqbase,
Sequence actseq,
const int  channel 
)
static

◆ select_grouped_effect_link()

static bool select_grouped_effect_link ( const Scene scene,
SeqCollection strips,
ListBase seqbase,
Sequence UNUSEDactseq,
const int   UNUSEDchannel 
)
static

◆ select_grouped_time_overlap()

static bool select_grouped_time_overlap ( const Scene scene,
SeqCollection strips,
ListBase UNUSEDseqbase,
Sequence actseq 
)
static

◆ select_grouped_type()

static bool select_grouped_type ( SeqCollection strips,
ListBase UNUSEDseqbase,
Sequence actseq,
const int  channel 
)
static

◆ select_grouped_type_basic()

static bool select_grouped_type_basic ( SeqCollection strips,
ListBase UNUSEDseqbase,
Sequence actseq,
const int  channel 
)
static

◆ select_grouped_type_effect()

static bool select_grouped_type_effect ( SeqCollection strips,
ListBase UNUSEDseqbase,
Sequence actseq,
const int  channel 
)
static

◆ select_linked_internal()

static bool select_linked_internal ( Scene scene)
static

◆ select_linked_time()

static void select_linked_time ( const Scene scene,
ListBase seqbase,
Sequence seq_link 
)
static

◆ select_more_less_seq__internal()

static bool select_more_less_seq__internal ( Scene scene,
bool  select_more 
)
static

◆ select_surrounding_handles()

static void select_surrounding_handles ( Scene scene,
Sequence test 
)
static

◆ selected_strips_from_context()

SeqCollection* selected_strips_from_context ( struct bContext C)

Returns collection with selected strips presented to user. If operation is done in preview, collection is limited to selected presented strips, that can produce image output at current frame.

Parameters
Ccontext
Returns
collection of strips (Sequence)

Definition at line 68 of file sequencer_select.c.

References C, RenderData::cfra, channels(), CTX_data_scene(), Scene::r, scene, SEQ_active_seqbase_get(), SEQ_channels_displayed_get(), SEQ_editing_get(), SEQ_filter_selected_strips(), SEQ_query_rendered_strips(), SEQ_query_selected_strips(), and sequencer_view_has_preview_poll().

Referenced by sequencer_delete_exec(), and sequencer_view_selected_exec().

◆ seq_box_select_rect_image_isect()

static bool seq_box_select_rect_image_isect ( const Scene scene,
const Sequence seq,
rctf rect 
)
static

◆ seq_box_select_seq_from_preview()

static void seq_box_select_seq_from_preview ( const bContext C,
rctf rect,
const eSelectOp  mode 
)
static

◆ seq_point_image_isect()

static bool seq_point_image_isect ( const Scene scene,
const Sequence seq,
float  point[2] 
)
static

◆ seq_rectf()

void seq_rectf ( const Scene scene,
Sequence seq,
rctf rect 
)

◆ seq_select_seq_from_preview()

static Sequence* seq_select_seq_from_preview ( const bContext C,
const int  mval[2],
const bool  toggle,
const bool  extend,
const bool  center 
)
static

◆ seq_sort_for_center_select()

static int seq_sort_for_center_select ( const void a,
const void b 
)
static

◆ seq_sort_for_depth_select()

static int seq_sort_for_depth_select ( const void a,
const void b 
)
static

◆ sequencer_box_select_exec()

static int sequencer_box_select_exec ( bContext C,
wmOperator op 
)
static

◆ sequencer_box_select_invoke()

static int sequencer_box_select_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ sequencer_de_select_all_exec()

static int sequencer_de_select_all_exec ( bContext C,
wmOperator op 
)
static

◆ SEQUENCER_OT_select()

void SEQUENCER_OT_select ( wmOperatorType ot)

◆ SEQUENCER_OT_select_all()

void SEQUENCER_OT_select_all ( struct wmOperatorType ot)

◆ SEQUENCER_OT_select_box()

void SEQUENCER_OT_select_box ( wmOperatorType ot)

◆ SEQUENCER_OT_select_grouped()

void SEQUENCER_OT_select_grouped ( wmOperatorType ot)

◆ SEQUENCER_OT_select_handles()

void SEQUENCER_OT_select_handles ( wmOperatorType ot)

◆ SEQUENCER_OT_select_inverse()

void SEQUENCER_OT_select_inverse ( struct wmOperatorType ot)

◆ SEQUENCER_OT_select_less()

void SEQUENCER_OT_select_less ( wmOperatorType ot)

◆ SEQUENCER_OT_select_linked()

void SEQUENCER_OT_select_linked ( wmOperatorType ot)

◆ SEQUENCER_OT_select_linked_pick()

void SEQUENCER_OT_select_linked_pick ( wmOperatorType ot)

◆ SEQUENCER_OT_select_more()

void SEQUENCER_OT_select_more ( wmOperatorType ot)

◆ SEQUENCER_OT_select_side()

void SEQUENCER_OT_select_side ( wmOperatorType ot)

◆ SEQUENCER_OT_select_side_of_frame()

void SEQUENCER_OT_select_side_of_frame ( wmOperatorType ot)

◆ sequencer_select_do_updates()

static void sequencer_select_do_updates ( bContext C,
Scene scene 
)
static

◆ sequencer_select_exec()

static int sequencer_select_exec ( bContext C,
wmOperator op 
)
static

◆ sequencer_select_grouped_exec()

static int sequencer_select_grouped_exec ( bContext C,
wmOperator op 
)
static

◆ sequencer_select_handles_exec()

static int sequencer_select_handles_exec ( bContext C,
wmOperator op 
)
static

◆ sequencer_select_inverse_exec()

static int sequencer_select_inverse_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ sequencer_select_invoke()

static int sequencer_select_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ sequencer_select_less_exec()

static int sequencer_select_less_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ sequencer_select_linked_exec()

static int sequencer_select_linked_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ sequencer_select_linked_handle()

static void sequencer_select_linked_handle ( const bContext C,
Sequence seq,
const int  handle_clicked 
)
static

◆ sequencer_select_linked_pick_invoke()

static int sequencer_select_linked_pick_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ sequencer_select_more_exec()

static int sequencer_select_more_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ sequencer_select_set_active()

static void sequencer_select_set_active ( Scene scene,
Sequence seq 
)
static

◆ sequencer_select_side_exec()

static int sequencer_select_side_exec ( bContext C,
wmOperator op 
)
static

◆ sequencer_select_side_of_frame()

static void sequencer_select_side_of_frame ( const bContext C,
const View2D v2d,
const int  mval[2],
Scene scene 
)
static

◆ sequencer_select_side_of_frame_exec()

static int sequencer_select_side_of_frame_exec ( bContext C,
wmOperator op 
)
static

◆ sequencer_select_strip_impl()

static void sequencer_select_strip_impl ( const Editing ed,
Sequence seq,
const int  handle_clicked,
const bool  extend,
const bool  deselect,
const bool  toggle 
)
static

Variable Documentation

◆ prop_select_handles_side_types

const EnumPropertyItem prop_select_handles_side_types[]
static
Initial value:
= {
{SEQ_SELECT_HANDLES_SIDE_LEFT, "LEFT", 0, "Left", ""},
{SEQ_SELECT_HANDLES_SIDE_RIGHT, "RIGHT", 0, "Right", ""},
{SEQ_SELECT_HANDLES_SIDE_BOTH, "BOTH", 0, "Both", ""},
{SEQ_SELECT_HANDLES_SIDE_LEFT_NEIGHBOR, "LEFT_NEIGHBOR", 0, "Left Neighbor", ""},
{SEQ_SELECT_HANDLES_SIDE_RIGHT_NEIGHBOR, "RIGHT_NEIGHBOR", 0, "Right Neighbor", ""},
{SEQ_SELECT_HANDLES_SIDE_BOTH_NEIGHBORS, "BOTH_NEIGHBORS", 0, "Both Neighbors", ""},
{0, NULL, 0, NULL, NULL},
}
@ SEQ_SELECT_HANDLES_SIDE_LEFT_NEIGHBOR
@ SEQ_SELECT_HANDLES_SIDE_LEFT
@ SEQ_SELECT_HANDLES_SIDE_BOTH
@ SEQ_SELECT_HANDLES_SIDE_BOTH_NEIGHBORS
@ SEQ_SELECT_HANDLES_SIDE_RIGHT_NEIGHBOR
@ SEQ_SELECT_HANDLES_SIDE_RIGHT

Definition at line 1326 of file sequencer_select.c.

Referenced by SEQUENCER_OT_select_handles().

◆ sequencer_prop_select_grouped_types

const EnumPropertyItem sequencer_prop_select_grouped_types[]
static
Initial value:
= {
{SEQ_SELECT_GROUP_TYPE, "TYPE", 0, "Type", "Shared strip type"},
"TYPE_BASIC",
0,
"Global Type",
"All strips of same basic type (graphical or sound)"},
"TYPE_EFFECT",
0,
"Effect Type",
"Shared strip effect type (if active strip is not an effect one, select all non-effect "
"strips)"},
{SEQ_SELECT_GROUP_DATA, "DATA", 0, "Data", "Shared data (scene, image, sound, etc.)"},
{SEQ_SELECT_GROUP_EFFECT, "EFFECT", 0, "Effect", "Shared effects"},
"EFFECT_LINK",
0,
"Effect/Linked",
"Other strips affected by the active one (sharing some time, and below or "
"effect-assigned)"},
{SEQ_SELECT_GROUP_OVERLAP, "OVERLAP", 0, "Overlap", "Overlapping time"},
{0, NULL, 0, NULL, NULL},
}
@ SEQ_SELECT_GROUP_TYPE_EFFECT
@ SEQ_SELECT_GROUP_TYPE_BASIC
@ SEQ_SELECT_GROUP_EFFECT_LINK
@ SEQ_SELECT_GROUP_EFFECT
@ SEQ_SELECT_GROUP_OVERLAP
@ SEQ_SELECT_GROUP_TYPE
@ SEQ_SELECT_GROUP_DATA

Definition at line 1786 of file sequencer_select.c.

Referenced by SEQUENCER_OT_select_grouped().