89 #define GVERTSEL_TOL (10 * U.pixelsize)
121 int screen_co[2],
dist;
136 bool replace =
false;
183 short mapping_flag = 0;
197 for (ale = anim_data.
first; ale; ale = ale->
next) {
202 ac->
scene, ale->
id,
fcu, mapping_flag, &offset);
213 for (i = 0; i <
fcu->
totvert; i++, prevbezt = bezt1, bezt1++) {
291 for (nvi = matches->
first; nvi; nvi = nvi->
next) {
375 for (ale = anim_data.first; ale; ale = ale->next) {
387 for (ale = anim_data.first; ale; ale = ale->next) {
529 const bool incl_handles,
542 r_ked->
data = data_lasso;
548 r_ked->
data = data_circle;
552 r_ked->
data = scaled_rectf;
578 const rctf *rectf_view,
591 sipo, incl_handles, mode, ac,
data, &scaled_rectf, &ked, &mapping_flag);
601 for (ale = anim_data.first; ale; ale = ale->
next) {
606 ac->
scene, ale->
id,
fcu, mapping_flag, &offset);
617 scaled_rectf.
ymin = rectf.
ymin / unit_scale - offset;
618 scaled_rectf.
ymax = rectf.
ymax / unit_scale - offset;
669 bool mouse_is_over_element = under_mouse !=
NULL;
674 if (mouse_is_over_element) {
741 ot->
description =
"Select all keyframes within the specified region";
763 "Are handles tested individually against the selection criteria");
767 ot->
srna,
"tweak", 0,
"Tweak",
"Operator has been activated using a tweak event");
831 ot->
name =
"Lasso Select";
832 ot->
description =
"Select keyframe points using lasso selection";
833 ot->
idname =
"GRAPH_OT_select_lasso";
855 bool incl_handles =
false;
878 data.radius_squared = radius * radius;
879 data.rectf_view = &rect_fl;
881 rect_fl.
xmin =
x - radius;
882 rect_fl.
xmax =
x + radius;
883 rect_fl.
ymin =
y - radius;
884 rect_fl.
ymax =
y + radius;
907 ot->
name =
"Circle Select";
908 ot->
description =
"Select keyframe points using circle selection";
909 ot->
idname =
"GRAPH_OT_select_circle";
941 "Between Min/Max Selected Markers",
978 for (ale = anim_data.
first; ale; ale = ale->
next) {
1016 for (ale = anim_data.
first; ale; ale = ale->
next) {
1049 for (ale = anim_data.
first; ale; ale = ale->
next) {
1101 ot->
idname =
"GRAPH_OT_select_column";
1102 ot->
description =
"Select all keyframes on the specified frame(s)";
1137 for (ale = anim_data.
first; ale; ale = ale->
next) {
1159 ot->
name =
"Select Linked";
1160 ot->
idname =
"GRAPH_OT_select_linked";
1161 ot->
description =
"Select keyframes occurring in the same F-Curves as selected ones";
1191 for (ale = anim_data.
first; ale; ale = ale->
next) {
1238 ot->
name =
"Select More";
1239 ot->
idname =
"GRAPH_OT_select_more";
1240 ot->
description =
"Select keyframes beside already selected ones";
1273 ot->
name =
"Select Less";
1274 ot->
idname =
"GRAPH_OT_select_less";
1275 ot->
description =
"Deselect keyframes on ends of selection islands";
1336 for (ale = anim_data.
first; ale; ale = ale->
next) {
1425 ot->
name =
"Select Left/Right";
1426 ot->
idname =
"GRAPH_OT_select_leftright";
1427 ot->
description =
"Select keyframes to the left or the right of the current frame";
1460 const bool deselect_all,
1461 const bool curves_only,
1462 bool wait_to_deselect_others)
1467 bool run_modal =
false;
1475 wait_to_deselect_others =
false;
1481 const bool already_selected =
1486 if (wait_to_deselect_others && nvi && already_selected) {
1514 bool something_was_selected =
false;
1545 something_was_selected =
true;
1549 const bool may_activate = !already_selected ||
1557 else if (nvi->fpt) {
1604 if (!run_modal && (nvi->fcu->flag &
FCURVE_SELECTED) && something_was_selected) {
1631 bool wait_to_deselect_others)
1636 bool run_modal =
false;
1658 else if (wait_to_deselect_others && (nvi->
bezt->
f2 &
SELECT)) {
1686 for (ale = anim_data.
first; ale; ale = ale->
next) {
1726 const bool wait_to_deselect_others =
RNA_boolean_get(op->
ptr,
"wait_to_deselect_others");
1740 ret_val =
mouse_graph_keys(&ac, mval, selectmode, deselect_all,
true, wait_to_deselect_others);
1745 &ac, mval, selectmode, deselect_all,
false, wait_to_deselect_others);
1762 ot->
name =
"Select Keyframes";
1763 ot->
idname =
"GRAPH_OT_clickselect";
1781 "Toggle keyframe selection instead of leaving newly selected "
1788 "Deselect On Nothing",
1789 "Deselect all when nothing under the cursor");
1796 "Select all keyframes that occur on the same frame as the one under "
1804 "Select all the keyframes in the curve");
typedef float(TangentPoint)[2]
void BKE_fcurve_active_keyframe_set(struct FCurve *fcu, const struct BezTriple *active_bezt)
int BKE_fcurve_active_keyframe_index(const struct FCurve *fcu)
float BKE_nla_tweakedit_remap(struct AnimData *adt, float cframe, short mode)
void BLI_lasso_boundbox(struct rcti *rect, const int mcoords[][2], const unsigned int mcoords_len)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void void BLI_INLINE bool BLI_listbase_is_single(const struct ListBase *lb)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE float len_v2v2_int(const int v1[2], const int v2[2])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src)
#define FCURVE_ACTIVE_KEYFRAME_NONE
#define BEZT_ISSEL_ANY(bezt)
@ SIPO_RUNTIME_FLAG_TWEAK_HANDLES_RIGHT
@ SIPO_RUNTIME_FLAG_TWEAK_HANDLES_LEFT
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_CURVE_VISIBLE
@ KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE
@ KEYFRAME_ITER_INCL_HANDLES
short(* KeyframeEditFunc)(KeyframeEditData *ked, struct BezTriple *bezt)
#define SEL_OP_USE_PRE_DESELECT(sel_op)
eSelectOp ED_select_op_modal(const eSelectOp sel_op, const bool is_first)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
Read Guarded memory(de)allocation.
void UI_view2d_region_to_view_rctf(const struct View2D *v2d, const struct rctf *rect_src, struct rctf *rect_dst) ATTR_NONNULL()
bool UI_view2d_view_to_region_clip(const struct View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
float UI_view2d_region_to_view_x(const struct View2D *v2d, float x)
void ANIM_anim_channels_select_set(bAnimContext *ac, eAnimChannels_SetFlag sel)
void ANIM_set_active_channel(bAnimContext *ac, void *data, eAnimCont_Types datatype, eAnimFilter_Flags filter, void *channel_data, eAnim_ChannelType channel_type)
void ANIM_animdata_freelist(ListBase *anim_data)
AnimData * ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale)
void ANIM_nla_mapping_apply_fcurve(AnimData *adt, FCurve *fcu, bool restore, bool only_keys)
float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short flag, float *r_offset)
short ANIM_get_normalization_flags(bAnimContext *ac)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, eAnimFilter_Flags filter_mode, void *data, eAnimCont_Types datatype)
void ED_markers_make_cfra_list(ListBase *markers, ListBase *lb, short only_sel)
void ED_markers_get_minmax(ListBase *markers, short sel, float *r_first, float *r_last)
@ GRAPHKEYS_COLUMNSEL_MARKERS_BETWEEN
@ GRAPHKEYS_COLUMNSEL_KEYS
@ GRAPHKEYS_COLUMNSEL_MARKERS_COLUMN
@ GRAPHKEYS_COLUMNSEL_CFRA
struct bAnimListElem * get_active_fcurve_channel(struct bAnimContext *ac)
bool graphop_visible_keyframes_poll(struct bContext *C)
void GRAPH_OT_select_box(wmOperatorType *ot)
static int graphkeys_box_select_exec(bContext *C, wmOperator *op)
void GRAPH_OT_select_column(wmOperatorType *ot)
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 rctf initialize_box_select_coords(const bAnimContext *ac, const rctf *rectf_view)
static int graphkeys_clickselect_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem prop_graphkeys_leftright_select_types[]
static void box_select_graphkeys(bAnimContext *ac, const rctf *rectf_view, short mode, short selectmode, bool incl_handles, void *data)
static void graphkeys_select_leftright(bAnimContext *ac, short leftright, short select_mode)
void GRAPH_OT_select_lasso(wmOperatorType *ot)
static int graphkeys_select_leftright_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static tNearestVertInfo * get_best_nearest_fcurve_vert(ListBase *matches)
void deselect_graph_keys(bAnimContext *ac, bool test, short sel, bool do_channels)
static tNearestVertInfo * find_nearest_fcurve_vert(bAnimContext *ac, const int mval[2])
static int graphkeys_select_leftright_exec(bContext *C, wmOperator *op)
static int graphkeys_lassoselect_exec(bContext *C, wmOperator *op)
void GRAPH_OT_select_circle(wmOperatorType *ot)
void GRAPH_OT_clickselect(wmOperatorType *ot)
static int graphkeys_mselect_column(bAnimContext *ac, const int mval[2], eEditKeyframes_Select select_mode, bool wait_to_deselect_others)
void GRAPH_OT_select_more(wmOperatorType *ot)
struct tNearestVertInfo tNearestVertInfo
static int graphkeys_deselectall_exec(bContext *C, wmOperator *op)
static int graphkeys_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
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 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)
void GRAPH_OT_select_linked(wmOperatorType *ot)
static void markers_selectkeys_between(bAnimContext *ac)
static int graph_circle_select_exec(bContext *C, wmOperator *op)
void GRAPH_OT_select_leftright(wmOperatorType *ot)
static int graphkeys_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static ListBase initialize_box_select_anim_data(const SpaceGraph *sipo, bAnimContext *ac)
static bool fcurve_handle_sel_check(SpaceGraph *sipo, BezTriple *bezt)
static int graphkeys_select_less_exec(bContext *C, wmOperator *UNUSED(op))
static void select_moreless_graph_keys(bAnimContext *ac, short mode)
void GRAPH_OT_select_all(wmOperatorType *ot)
static const EnumPropertyItem prop_column_select_types[]
static void columnselect_graph_keys(bAnimContext *ac, short mode)
static int graphkeys_select_more_exec(bContext *C, wmOperator *UNUSED(op))
static void get_nearest_fcurve_verts_list(bAnimContext *ac, const int mval[2], ListBase *matches)
static int graphkeys_columnselect_exec(bContext *C, wmOperator *op)
void GRAPH_OT_select_less(wmOperatorType *ot)
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
short bezt_selmap_flush(KeyframeEditData *ked, BezTriple *bezt)
KeyframeEditFunc ANIM_editkeyframes_select(short selectmode)
short bezt_to_cfraelem(KeyframeEditData *ked, BezTriple *bezt)
KeyframeEditFunc ANIM_editkeyframes_buildselmap(short mode)
short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, FCurve *fcu, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
KeyframeEditFunc ANIM_editkeyframes_ok(short mode)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
int RNA_int_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
eKeyframeIterFlags iterflags
SpaceGraph_Runtime runtime
struct bAnimListElem * next
struct tNearestVertInfo * prev
struct tNearestVertInfo * next
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
bool WM_gesture_is_modal_first(const wmGesture *gesture)
void WM_gesture_box_cancel(bContext *C, wmOperator *op)
int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void WM_gesture_circle_cancel(bContext *C, wmOperator *op)
int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_gesture_lasso_cancel(bContext *C, wmOperator *op)
int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
const int(* WM_gesture_lasso_path_to_array(bContext *UNUSED(C), wmOperator *op, int *r_mcoords_len))[2]
void WM_operator_properties_border_to_rcti(struct wmOperator *op, rcti *rect)
void WM_operator_properties_gesture_box(wmOperatorType *ot)
void WM_operator_properties_select_operation_simple(wmOperatorType *ot)
void WM_operator_properties_generic_select(wmOperatorType *ot)
void WM_operator_properties_gesture_lasso(wmOperatorType *ot)
void WM_operator_properties_gesture_circle(wmOperatorType *ot)
void WM_operator_properties_select_all(wmOperatorType *ot)
int WM_generic_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event)