Blender  V2.93
Classes | Macros | Typedefs | Enumerations | Functions | Variables
graph_select.c File Reference
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_lasso_2d.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "BKE_context.h"
#include "BKE_fcurve.h"
#include "BKE_nla.h"
#include "UI_view2d.h"
#include "ED_anim_api.h"
#include "ED_keyframes_edit.h"
#include "ED_markers.h"
#include "ED_select_utils.h"
#include "WM_api.h"
#include "WM_types.h"
#include "graph_intern.h"

Go to the source code of this file.

Classes

struct  tNearestVertInfo
 

Macros

#define GVERTSEL_TOL   (10 * U.pixelsize)
 

Typedefs

typedef struct tNearestVertInfo tNearestVertInfo
 
typedef enum eGraphVertIndex eGraphVertIndex
 

Enumerations

enum  eGraphVertIndex { NEAREST_HANDLE_LEFT = -1 , NEAREST_HANDLE_KEY , NEAREST_HANDLE_RIGHT }
 

Functions

static bool fcurve_handle_sel_check (SpaceGraph *sipo, BezTriple *bezt)
 
static void nearest_fcurve_vert_store (ListBase *matches, View2D *v2d, FCurve *fcu, eAnim_ChannelType ctype, BezTriple *bezt, FPoint *fpt, short hpoint, const int mval[2], float unit_scale, float offset)
 
static void get_nearest_fcurve_verts_list (bAnimContext *ac, const int mval[2], ListBase *matches)
 
static tNearestVertInfoget_best_nearest_fcurve_vert (ListBase *matches)
 
static tNearestVertInfofind_nearest_fcurve_vert (bAnimContext *ac, const int mval[2])
 
void deselect_graph_keys (bAnimContext *ac, bool test, short sel, bool do_channels)
 
static int graphkeys_deselectall_exec (bContext *C, wmOperator *op)
 
void GRAPH_OT_select_all (wmOperatorType *ot)
 
static rctf initialize_box_select_coords (const bAnimContext *ac, const rctf *rectf_view)
 
static ListBase initialize_box_select_anim_data (const SpaceGraph *sipo, bAnimContext *ac)
 
static void initialize_box_select_key_editing_data (const SpaceGraph *sipo, const bool incl_handles, const short mode, bAnimContext *ac, void *data, rctf *scaled_rectf, KeyframeEditData *r_ked, int *r_mapping_flag)
 
static void box_select_graphkeys (bAnimContext *ac, const rctf *rectf_view, short mode, short selectmode, bool incl_handles, void *data)
 
static int graphkeys_box_select_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int graphkeys_box_select_exec (bContext *C, wmOperator *op)
 
void GRAPH_OT_select_box (wmOperatorType *ot)
 
static int graphkeys_lassoselect_exec (bContext *C, wmOperator *op)
 
void GRAPH_OT_select_lasso (wmOperatorType *ot)
 
static int graph_circle_select_exec (bContext *C, wmOperator *op)
 
void GRAPH_OT_select_circle (wmOperatorType *ot)
 
static void markers_selectkeys_between (bAnimContext *ac)
 
static void columnselect_graph_keys (bAnimContext *ac, short mode)
 
static int graphkeys_columnselect_exec (bContext *C, wmOperator *op)
 
void GRAPH_OT_select_column (wmOperatorType *ot)
 
static int graphkeys_select_linked_exec (bContext *C, wmOperator *UNUSED(op))
 
void GRAPH_OT_select_linked (wmOperatorType *ot)
 
static void select_moreless_graph_keys (bAnimContext *ac, short mode)
 
static int graphkeys_select_more_exec (bContext *C, wmOperator *UNUSED(op))
 
void GRAPH_OT_select_more (wmOperatorType *ot)
 
static int graphkeys_select_less_exec (bContext *C, wmOperator *UNUSED(op))
 
void GRAPH_OT_select_less (wmOperatorType *ot)
 
static void graphkeys_select_leftright (bAnimContext *ac, short leftright, short select_mode)
 
static int graphkeys_select_leftright_exec (bContext *C, wmOperator *op)
 
static int graphkeys_select_leftright_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void GRAPH_OT_select_leftright (wmOperatorType *ot)
 
static int mouse_graph_keys (bAnimContext *ac, const int mval[2], eEditKeyframes_Select select_mode, const bool deselect_all, const bool curves_only, bool wait_to_deselect_others)
 
static int graphkeys_mselect_column (bAnimContext *ac, const int mval[2], eEditKeyframes_Select select_mode, bool wait_to_deselect_others)
 
static int graphkeys_clickselect_exec (bContext *C, wmOperator *op)
 
void GRAPH_OT_clickselect (wmOperatorType *ot)
 

Variables

static const EnumPropertyItem prop_column_select_types []
 
static const EnumPropertyItem prop_graphkeys_leftright_select_types []
 

Macro Definition Documentation

◆ GVERTSEL_TOL

#define GVERTSEL_TOL   (10 * U.pixelsize)

Definition at line 89 of file graph_select.c.

Typedef Documentation

◆ eGraphVertIndex

◆ tNearestVertInfo

Enumeration Type Documentation

◆ eGraphVertIndex

Enumerator
NEAREST_HANDLE_LEFT 
NEAREST_HANDLE_KEY 
NEAREST_HANDLE_RIGHT 

Definition at line 81 of file graph_select.c.

Function Documentation

◆ box_select_graphkeys()

static void box_select_graphkeys ( bAnimContext ac,
const rctf rectf_view,
short  mode,
short  selectmode,
bool  incl_handles,
void *  data 
)
static

◆ columnselect_graph_keys()

static void columnselect_graph_keys ( bAnimContext ac,
short  mode 
)
static

◆ deselect_graph_keys()

void deselect_graph_keys ( bAnimContext ac,
bool  test,
short  sel,
bool  do_channels 
)

◆ fcurve_handle_sel_check()

static bool fcurve_handle_sel_check ( SpaceGraph sipo,
BezTriple bezt 
)
static

◆ find_nearest_fcurve_vert()

static tNearestVertInfo* find_nearest_fcurve_vert ( bAnimContext ac,
const int  mval[2] 
)
static

Find the nearest vertices (either a handle or the keyframe) that are nearest to the mouse cursor (in area coordinates)

Note
the match info found must still be freed.

Definition at line 320 of file graph_select.c.

References BLI_freelistN(), get_best_nearest_fcurve_vert(), get_nearest_fcurve_verts_list(), and NULL.

Referenced by graphkeys_box_select_invoke(), graphkeys_mselect_column(), and mouse_graph_keys().

◆ get_best_nearest_fcurve_vert()

static tNearestVertInfo* get_best_nearest_fcurve_vert ( ListBase matches)
static

◆ get_nearest_fcurve_verts_list()

static void get_nearest_fcurve_verts_list ( bAnimContext ac,
const int  mval[2],
ListBase matches 
)
static

◆ graph_circle_select_exec()

static int graph_circle_select_exec ( bContext C,
wmOperator op 
)
static

◆ GRAPH_OT_clickselect()

void GRAPH_OT_clickselect ( wmOperatorType ot)

◆ GRAPH_OT_select_all()

void GRAPH_OT_select_all ( wmOperatorType ot)

◆ GRAPH_OT_select_box()

void GRAPH_OT_select_box ( wmOperatorType ot)

◆ GRAPH_OT_select_circle()

void GRAPH_OT_select_circle ( wmOperatorType ot)

◆ GRAPH_OT_select_column()

void GRAPH_OT_select_column ( wmOperatorType ot)

◆ GRAPH_OT_select_lasso()

void GRAPH_OT_select_lasso ( wmOperatorType ot)

◆ GRAPH_OT_select_leftright()

void GRAPH_OT_select_leftright ( wmOperatorType ot)

◆ GRAPH_OT_select_less()

void GRAPH_OT_select_less ( wmOperatorType ot)

◆ GRAPH_OT_select_linked()

void GRAPH_OT_select_linked ( wmOperatorType ot)

◆ GRAPH_OT_select_more()

void GRAPH_OT_select_more ( wmOperatorType ot)

◆ graphkeys_box_select_exec()

static int graphkeys_box_select_exec ( bContext C,
wmOperator op 
)
static

◆ graphkeys_box_select_invoke()

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

◆ graphkeys_clickselect_exec()

static int graphkeys_clickselect_exec ( bContext C,
wmOperator op 
)
static

◆ graphkeys_columnselect_exec()

static int graphkeys_columnselect_exec ( bContext C,
wmOperator op 
)
static

◆ graphkeys_deselectall_exec()

static int graphkeys_deselectall_exec ( bContext C,
wmOperator op 
)
static

◆ graphkeys_lassoselect_exec()

static int graphkeys_lassoselect_exec ( bContext C,
wmOperator op 
)
static

◆ graphkeys_mselect_column()

static int graphkeys_mselect_column ( bAnimContext ac,
const int  mval[2],
eEditKeyframes_Select  select_mode,
bool  wait_to_deselect_others 
)
static

◆ graphkeys_select_leftright()

static void graphkeys_select_leftright ( bAnimContext ac,
short  leftright,
short  select_mode 
)
static

◆ graphkeys_select_leftright_exec()

static int graphkeys_select_leftright_exec ( bContext C,
wmOperator op 
)
static

◆ graphkeys_select_leftright_invoke()

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

◆ graphkeys_select_less_exec()

static int graphkeys_select_less_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ graphkeys_select_linked_exec()

static int graphkeys_select_linked_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ graphkeys_select_more_exec()

static int graphkeys_select_more_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ initialize_box_select_anim_data()

static ListBase initialize_box_select_anim_data ( const SpaceGraph sipo,
bAnimContext ac 
)
static

◆ initialize_box_select_coords()

static rctf initialize_box_select_coords ( const bAnimContext ac,
const rctf rectf_view 
)
static

Definition at line 504 of file graph_select.c.

References bAnimContext::region, UI_view2d_region_to_view_rctf(), and ARegion::v2d.

Referenced by box_select_graphkeys().

◆ initialize_box_select_key_editing_data()

static void initialize_box_select_key_editing_data ( const SpaceGraph sipo,
const bool  incl_handles,
const short  mode,
bAnimContext ac,
void *  data,
rctf scaled_rectf,
KeyframeEditData r_ked,
int *  r_mapping_flag 
)
static

◆ markers_selectkeys_between()

static void markers_selectkeys_between ( bAnimContext ac)
static

◆ mouse_graph_keys()

static int mouse_graph_keys ( bAnimContext ac,
const int  mval[2],
eEditKeyframes_Select  select_mode,
const bool  deselect_all,
const bool  curves_only,
bool  wait_to_deselect_others 
)
static

◆ nearest_fcurve_vert_store()

static void nearest_fcurve_vert_store ( ListBase matches,
View2D v2d,
FCurve fcu,
eAnim_ChannelType  ctype,
BezTriple bezt,
FPoint fpt,
short  hpoint,
const int  mval[2],
float  unit_scale,
float  offset 
)
static

◆ select_moreless_graph_keys()

static void select_moreless_graph_keys ( bAnimContext ac,
short  mode 
)
static

Variable Documentation

◆ prop_column_select_types

const EnumPropertyItem prop_column_select_types[]
static
Initial value:
= {
{GRAPHKEYS_COLUMNSEL_KEYS, "KEYS", 0, "On Selected Keyframes", ""},
{GRAPHKEYS_COLUMNSEL_CFRA, "CFRA", 0, "On Current Frame", ""},
{GRAPHKEYS_COLUMNSEL_MARKERS_COLUMN, "MARKERS_COLUMN", 0, "On Selected Markers", ""},
"MARKERS_BETWEEN",
0,
"Between Min/Max Selected Markers",
""},
{0, NULL, 0, NULL, NULL},
}
@ GRAPHKEYS_COLUMNSEL_MARKERS_BETWEEN
Definition: graph_intern.h:75
@ GRAPHKEYS_COLUMNSEL_KEYS
Definition: graph_intern.h:72
@ GRAPHKEYS_COLUMNSEL_MARKERS_COLUMN
Definition: graph_intern.h:74
@ GRAPHKEYS_COLUMNSEL_CFRA
Definition: graph_intern.h:73

Definition at line 934 of file graph_select.c.

Referenced by GRAPH_OT_select_column().

◆ prop_graphkeys_leftright_select_types

const EnumPropertyItem prop_graphkeys_leftright_select_types[]
static
Initial value:
= {
{GRAPHKEYS_LRSEL_TEST, "CHECK", 0, "Check if Select Left or Right", ""},
{GRAPHKEYS_LRSEL_LEFT, "LEFT", 0, "Before Current Frame", ""},
{GRAPHKEYS_LRSEL_RIGHT, "RIGHT", 0, "After Current Frame", ""},
{0, NULL, 0, NULL, NULL},
}
@ GRAPHKEYS_LRSEL_TEST
Definition: graph_intern.h:65
@ GRAPHKEYS_LRSEL_RIGHT
Definition: graph_intern.h:67
@ GRAPHKEYS_LRSEL_LEFT
Definition: graph_intern.h:66

Definition at line 1289 of file graph_select.c.

Referenced by GRAPH_OT_select_leftright().