Blender V2.61 - r43446
|
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "BKE_fcurve.h"
#include "BKE_nla.h"
#include "BKE_context.h"
#include "UI_view2d.h"
#include "ED_anim_api.h"
#include "ED_keyframes_edit.h"
#include "ED_markers.h"
#include "WM_api.h"
#include "WM_types.h"
#include "graph_intern.h"
Go to the source code of this file.
Definition in file graph_select.c.
#define GVERTSEL_TOL 10 |
Definition at line 902 of file graph_select.c.
Referenced by nearest_fcurve_vert_store().
typedef enum eGraphVertIndex eGraphVertIndex |
typedef struct tNearestVertInfo tNearestVertInfo |
enum eGraphVertIndex |
Definition at line 894 of file graph_select.c.
static void borderselect_graphkeys | ( | bAnimContext * | ac, |
rcti | rect, | ||
short | mode, | ||
short | selectmode, | ||
short | incl_handles | ||
) | [static] |
Definition at line 200 of file graph_select.c.
References bAnimListElem::adt, ANIM_animdata_filter(), ANIM_editkeyframes_ok(), ANIM_editkeyframes_select(), ANIM_fcurve_keyframes_loop(), ANIM_nla_mapping_apply_fcurve(), ANIM_nla_mapping_get(), ANIM_unit_mapping_apply_fcurve(), ANIM_UNITCONV_ONLYKEYS, ANIM_UNITCONV_RESTORE, ANIMFILTER_CURVE_VISIBLE, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_NODUPLIS, bAnimContext::ar, BEZT_OK_VALUERANGE, BLI_freelistN(), bAnimContext::data, bAnimContext::datatype, FCURVE_SELECTED, filter(), ListBase::first, SpaceIpo::flag, FCurve::flag, bAnimListElem::id, bAnimListElem::key_data, KEYFRAME_ITER_INCL_HANDLES, bAnimListElem::next, NULL, bAnimContext::scene, SELECT_ADD, SIPO_SELCUVERTSONLY, bAnimContext::sl, UI_view2d_region_to_view(), ARegion::v2d, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by graphkeys_borderselect_exec().
static void columnselect_graph_keys | ( | bAnimContext * | ac, |
short | mode | ||
) | [static] |
Definition at line 441 of file graph_select.c.
References bAnimListElem::adt, ANIM_animdata_filter(), ANIM_editkeyframes_ok(), ANIM_editkeyframes_select(), ANIM_fcurve_keyframes_loop(), ANIM_nla_mapping_get(), ANIMFILTER_CURVE_VISIBLE, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_NODUPLIS, BEZT_OK_FRAME, bezt_to_cfraelem(), BKE_nla_tweakedit_remap(), BLI_addtail(), BLI_freelistN(), CfraElem::cfra, CFRA, bAnimContext::data, bAnimContext::datatype, ED_markers_make_cfra_list(), KeyframeEditData::f1, filter(), ListBase::first, GRAPHKEYS_COLUMNSEL_CFRA, GRAPHKEYS_COLUMNSEL_KEYS, GRAPHKEYS_COLUMNSEL_MARKERS_COLUMN, bAnimListElem::key_data, KeyframeEditData::list, bAnimContext::markers, MEM_callocN(), bAnimListElem::next, CfraElem::next, NLATIME_CONVERT_UNMAP, NULL, bAnimContext::scene, SELECT, and SELECT_ADD.
Referenced by graphkeys_columnselect_exec().
static void deselect_graph_keys | ( | bAnimContext * | ac, |
short | test, | ||
short | sel, | ||
short | do_channels | ||
) | [static] |
Definition at line 86 of file graph_select.c.
References filter(), NULL, and bAnimContext::sl.
Referenced by graphkeys_borderselect_exec(), graphkeys_deselectall_exec(), graphkeys_mselect_column(), graphkeys_select_leftright(), and mouse_graph_keys().
Definition at line 908 of file graph_select.c.
References BEZSELECTED, SpaceIpo::flag, SIPO_NOHANDLES, and SIPO_SELVHANDLESONLY.
Referenced by get_nearest_fcurve_verts_list().
static tNearestVertInfo* find_nearest_fcurve_vert | ( | bAnimContext * | ac, |
const int | mval[2] | ||
) | [static] |
Definition at line 1086 of file graph_select.c.
References BLI_freelistN(), get_best_nearest_fcurve_vert(), get_nearest_fcurve_verts_list(), and NULL.
Referenced by graphkeys_mselect_column(), and mouse_graph_keys().
static tNearestVertInfo* get_best_nearest_fcurve_vert | ( | ListBase * | matches | ) | [static] |
Definition at line 1040 of file graph_select.c.
References BLI_remlink(), ListBase::first, ListBase::last, tNearestVertInfo::next, NULL, and tNearestVertInfo::sel.
Referenced by find_nearest_fcurve_vert().
static void get_nearest_fcurve_verts_list | ( | bAnimContext * | ac, |
const int | mval[2], | ||
ListBase * | matches | ||
) | [static] |
Definition at line 969 of file graph_select.c.
References ANIM_animdata_filter(), ANIM_nla_mapping_apply_fcurve(), ANIM_nla_mapping_get(), ANIM_unit_mapping_apply_fcurve(), ANIM_UNITCONV_RESTORE, ANIMFILTER_CURVE_VISIBLE, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_NODUPLIS, ANIMFILTER_SEL, bAnimContext::ar, FCurve::bezt, BEZT_IPO_BEZ, BLI_freelistN(), bAnimContext::data, bAnimContext::datatype, fcurve_handle_sel_check(), filter(), ListBase::first, SpaceIpo::flag, FCurve::fpt, i, bAnimListElem::id, BezTriple::ipo, bAnimListElem::key_data, nearest_fcurve_vert_store(), NEAREST_HANDLE_KEY, NEAREST_HANDLE_LEFT, NEAREST_HANDLE_RIGHT, bAnimListElem::next, NULL, bAnimContext::scene, SIPO_SELCUVERTSONLY, bAnimContext::sl, FCurve::totvert, and ARegion::v2d.
Referenced by find_nearest_fcurve_vert().
void GRAPH_OT_clickselect | ( | wmOperatorType * | ot | ) |
Definition at line 1336 of file graph_select.c.
References wmOperatorType::description, graphkeys_clickselect_invoke(), graphop_visible_keyframes_poll(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by graphedit_operatortypes().
void GRAPH_OT_select_all_toggle | ( | wmOperatorType * | ot | ) |
Definition at line 169 of file graph_select.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, graphkeys_deselectall_exec(), graphop_visible_keyframes_poll(), wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, wmOperatorType::poll, wmOperatorType::prop, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by graphedit_operatortypes().
void GRAPH_OT_select_border | ( | wmOperatorType * | ot | ) |
Definition at line 348 of file graph_select.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, graphkeys_borderselect_exec(), graphop_visible_keyframes_poll(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_REGISTER, wmOperatorType::poll, wmOperatorType::prop, RNA_def_boolean(), wmOperatorType::srna, TRUE, WM_border_select_cancel(), WM_border_select_invoke(), WM_border_select_modal(), and WM_operator_properties_gesture_border().
Referenced by graphedit_operatortypes().
void GRAPH_OT_select_column | ( | wmOperatorType * | ot | ) |
Definition at line 538 of file graph_select.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, graphkeys_columnselect_exec(), graphop_visible_keyframes_poll(), wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), and wmOperatorType::srna.
Referenced by graphedit_operatortypes().
void GRAPH_OT_select_leftright | ( | wmOperatorType * | ot | ) |
Definition at line 849 of file graph_select.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, GRAPHKEYS_LRSEL_TEST, graphkeys_select_leftright_exec(), graphkeys_select_leftright_invoke(), graphop_visible_keyframes_poll(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, wmOperatorType::prop, RNA_def_boolean(), RNA_def_enum(), and wmOperatorType::srna.
Referenced by graphedit_operatortypes().
void GRAPH_OT_select_less | ( | wmOperatorType * | ot | ) |
Definition at line 708 of file graph_select.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, graphkeys_select_less_exec(), graphop_visible_keyframes_poll(), wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, and wmOperatorType::poll.
Referenced by graphedit_operatortypes().
void GRAPH_OT_select_linked | ( | wmOperatorType * | ot | ) |
Definition at line 596 of file graph_select.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, graphkeys_select_linked_exec(), graphop_visible_keyframes_poll(), wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, and wmOperatorType::poll.
Referenced by graphedit_operatortypes().
void GRAPH_OT_select_more | ( | wmOperatorType * | ot | ) |
Definition at line 674 of file graph_select.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, graphkeys_select_more_exec(), graphop_visible_keyframes_poll(), wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, and wmOperatorType::poll.
Referenced by graphedit_operatortypes().
static int graphkeys_borderselect_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 290 of file graph_select.c.
References ANIM_animdata_get_context(), BEZT_OK_FRAMERANGE, BEZT_OK_REGION, BEZT_OK_VALUERANGE, borderselect_graphkeys(), deselect_graph_keys(), GESTURE_MODAL_SELECT, NA_SELECTED, NC_ANIMATION, ND_KEYFRAME, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), RNA_int_get(), SELECT_ADD, SELECT_SUBTRACT, TRUE, WM_event_add_notifier(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by GRAPH_OT_select_border().
static int graphkeys_clickselect_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 1300 of file graph_select.c.
References ANIM_animdata_get_context(), graphkeys_mselect_column(), mouse_graph_keys(), wmEvent::mval, NA_SELECTED, NC_ANIMATION, ND_ANIMCHAN, ND_KEYFRAME, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, wmOperator::ptr, RNA_boolean_get(), SELECT_INVERT, SELECT_REPLACE, and WM_event_add_notifier().
Referenced by GRAPH_OT_clickselect().
static int graphkeys_columnselect_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 515 of file graph_select.c.
References ANIM_animdata_get_context(), columnselect_graph_keys(), GRAPHKEYS_COLUMNSEL_MARKERS_BETWEEN, markers_selectkeys_between(), NA_SELECTED, NC_ANIMATION, ND_KEYFRAME, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), and WM_event_add_notifier().
Referenced by GRAPH_OT_select_column().
static int graphkeys_deselectall_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 149 of file graph_select.c.
References ANIM_animdata_get_context(), deselect_graph_keys(), NA_SELECTED, NC_ANIMATION, ND_KEYFRAME, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), SELECT_ADD, SELECT_INVERT, TRUE, and WM_event_add_notifier().
Referenced by GRAPH_OT_select_all_toggle().
static void graphkeys_mselect_column | ( | bAnimContext * | ac, |
const int | mval[2], | ||
short | select_mode | ||
) | [static] |
Definition at line 1229 of file graph_select.c.
References ANIM_animdata_filter(), ANIM_editkeyframes_ok(), ANIM_editkeyframes_select(), ANIM_fcurve_keyframes_loop(), ANIM_nla_mapping_get(), ANIMFILTER_CURVE_VISIBLE, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_NODUPLIS, tNearestVertInfo::bezt, BEZT_OK_FRAME, BKE_nla_tweakedit_remap(), BLI_freelistN(), RenderData::cfra, bAnimContext::data, bAnimContext::datatype, deselect_graph_keys(), KeyframeEditData::f1, FALSE, filter(), find_nearest_fcurve_vert(), ListBase::first, tNearestVertInfo::fpt, bAnimListElem::key_data, KeyframeEditData::list, MEM_freeN(), bAnimListElem::next, NLATIME_CONVERT_UNMAP, NULL, Scene::r, bAnimContext::scene, SELECT_ADD, SELECT_REPLACE, SELECT_SUBTRACT, BezTriple::vec, and FPoint::vec.
Referenced by graphkeys_clickselect_invoke().
static void graphkeys_select_leftright | ( | bAnimContext * | ac, |
short | leftright, | ||
short | select_mode | ||
) | [static] |
Definition at line 736 of file graph_select.c.
References bAnimListElem::adt, ANIM_animdata_filter(), ANIM_editkeyframes_ok(), ANIM_editkeyframes_select(), ANIM_fcurve_keyframes_loop(), ANIM_nla_mapping_apply_fcurve(), ANIM_nla_mapping_get(), ANIMFILTER_DATA_VISIBLE, ANIMFILTER_NODUPLIS, BEZT_OK_FRAMERANGE, BLI_freelistN(), CFRA, bAnimContext::data, bAnimContext::datatype, deselect_graph_keys(), KeyframeEditData::f1, KeyframeEditData::f2, FALSE, filter(), ListBase::first, GRAPHKEYS_LRSEL_LEFT, bAnimListElem::key_data, MAXFRAMEF, MINAFRAMEF, bAnimListElem::next, NULL, bAnimContext::scene, SELECT_ADD, SELECT_REPLACE, and SELECT_SUBTRACT.
Referenced by graphkeys_select_leftright_exec().
static int graphkeys_select_leftright_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 792 of file graph_select.c.
References ANIM_animdata_get_context(), GRAPHKEYS_LRSEL_TEST, graphkeys_select_leftright(), NA_SELECTED, NC_ANIMATION, ND_ANIMCHAN, ND_KEYFRAME, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), RNA_enum_get(), SELECT_INVERT, SELECT_REPLACE, and WM_event_add_notifier().
Referenced by GRAPH_OT_select_leftright(), and graphkeys_select_leftright_invoke().
static int graphkeys_select_leftright_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 821 of file graph_select.c.
References ANIM_animdata_get_context(), bAnimContext::ar, CFRA, GRAPHKEYS_LRSEL_LEFT, GRAPHKEYS_LRSEL_RIGHT, GRAPHKEYS_LRSEL_TEST, graphkeys_select_leftright_exec(), wmEvent::mval, NULL, OPERATOR_CANCELLED, wmOperator::ptr, RNA_enum_get(), RNA_enum_set(), bAnimContext::scene, UI_view2d_region_to_view(), and ARegion::v2d.
Referenced by GRAPH_OT_select_leftright().
static int graphkeys_select_less_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 691 of file graph_select.c.
References ANIM_animdata_get_context(), NA_SELECTED, NC_ANIMATION, ND_KEYFRAME, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, select_moreless_graph_keys(), SELMAP_LESS, and WM_event_add_notifier().
Referenced by GRAPH_OT_select_less().
static int graphkeys_select_linked_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 558 of file graph_select.c.
References ANIM_animdata_filter(), ANIM_animdata_get_context(), ANIM_editkeyframes_ok(), ANIM_editkeyframes_select(), ANIM_fcurve_keyframes_loop(), ANIMFILTER_CURVE_VISIBLE, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_NODUPLIS, BEZT_OK_SELECTED, BLI_freelistN(), bAnimContext::data, bAnimContext::datatype, filter(), ListBase::first, if(), bAnimListElem::key_data, NA_SELECTED, NC_ANIMATION, ND_KEYFRAME, bAnimListElem::next, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, SELECT_ADD, and WM_event_add_notifier().
Referenced by GRAPH_OT_select_linked().
static int graphkeys_select_more_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 657 of file graph_select.c.
References ANIM_animdata_get_context(), NA_SELECTED, NC_ANIMATION, ND_KEYFRAME, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, select_moreless_graph_keys(), SELMAP_MORE, and WM_event_add_notifier().
Referenced by GRAPH_OT_select_more().
static void markers_selectkeys_between | ( | bAnimContext * | ac | ) | [static] |
Definition at line 395 of file graph_select.c.
References bAnimListElem::adt, ANIM_animdata_filter(), ANIM_editkeyframes_ok(), ANIM_editkeyframes_select(), ANIM_fcurve_keyframes_loop(), ANIM_nla_mapping_apply_fcurve(), ANIM_nla_mapping_get(), ANIMFILTER_CURVE_VISIBLE, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_NODUPLIS, BEZT_OK_FRAMERANGE, BLI_freelistN(), bAnimContext::data, bAnimContext::datatype, ED_markers_get_minmax(), KeyframeEditData::f1, KeyframeEditData::f2, filter(), ListBase::first, bAnimListElem::key_data, bAnimContext::markers, max, min, bAnimListElem::next, NULL, and SELECT_ADD.
Referenced by graphkeys_columnselect_exec().
static void mouse_graph_keys | ( | bAnimContext * | ac, |
const int | mval[2], | ||
short | select_mode, | ||
short | curves_only | ||
) | [static] |
Definition at line 1106 of file graph_select.c.
References ACHANNEL_SETFLAG_CLEAR, ANIM_deselect_anim_channels(), ANIM_editkeyframes_select(), ANIM_fcurve_keyframes_loop(), ANIM_set_active_channel(), ANIMFILTER_CURVE_VISIBLE, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_NODUPLIS, ANIMTYPE_FCURVE, BEZ_DESEL, BEZ_SEL, BEZSELECTED, tNearestVertInfo::bezt, bAnimContext::data, bAnimContext::datatype, deselect_graph_keys(), BezTriple::f1, BezTriple::f3, KeyframeEditData::fcu, FCURVE_PROTECTED, FCURVE_SELECTED, filter(), find_nearest_fcurve_vert(), SpaceIpo::flag, MEM_freeN(), NEAREST_HANDLE_KEY, NEAREST_HANDLE_LEFT, NULL, SELECT, SELECT_ADD, SELECT_INVERT, SELECT_REPLACE, SELECT_SUBTRACT, SIPO_SELCUVERTSONLY, bAnimContext::sl, and TRUE.
Referenced by graphkeys_clickselect_invoke().
static void nearest_fcurve_vert_store | ( | ListBase * | matches, |
View2D * | v2d, | ||
FCurve * | fcu, | ||
BezTriple * | bezt, | ||
FPoint * | fpt, | ||
short | hpoint, | ||
const int | mval[2] | ||
) | [static] |
Definition at line 917 of file graph_select.c.
References BEZSELECTED, tNearestVertInfo::bezt, BLI_addtail(), tNearestVertInfo::dist, tNearestVertInfo::fcu, GVERTSEL_TOL, tNearestVertInfo::hpoint, if(), ListBase::last, MEM_callocN(), tNearestVertInfo::sel, sqrt(), UI_view2d_view_to_region(), and BezTriple::vec.
Referenced by get_nearest_fcurve_verts_list().
static void select_moreless_graph_keys | ( | bAnimContext * | ac, |
short | mode | ||
) | [static] |
Definition at line 614 of file graph_select.c.
References ANIM_animdata_filter(), ANIM_editkeyframes_buildselmap(), ANIM_fcurve_keyframes_loop(), ANIMFILTER_CURVE_VISIBLE, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_NODUPLIS, FCurve::bezt, bezt_selmap_flush(), BLI_freelistN(), bAnimContext::data, KeyframeEditData::data, bAnimContext::datatype, filter(), ListBase::first, if(), bAnimListElem::key_data, MEM_callocN(), MEM_freeN(), bAnimListElem::next, NULL, and FCurve::totvert.
Referenced by graphkeys_select_less_exec(), and graphkeys_select_more_exec().
EnumPropertyItem prop_column_select_types[] [static] |
{ {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", ""}, {GRAPHKEYS_COLUMNSEL_MARKERS_BETWEEN, "MARKERS_BETWEEN", 0, "Between Min/Max Selected Markers", ""}, {0, NULL, 0, NULL, NULL} }
Definition at line 382 of file graph_select.c.
{ {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} }
Definition at line 727 of file graph_select.c.