79 ListBase anim_data = {
nullptr,
nullptr};
209 key_hsize = roundf(key_hsize / 2.0f);
225 *r_is_selected = (ak->
sel &
SELECT) != 0;
246 if (*r_ale !=
nullptr) {
248 ac, *r_ale, region_x, r_selx, r_frame, r_found, r_is_selected);
262 ac, filter, region_x, region_y, &ale, &selx, &frame, &found, &is_selected);
264 if (ale !=
nullptr) {
289 ListBase anim_data = {
nullptr,
nullptr};
329 &ked,
static_cast<FCurve *
>(ale->key_data),
nullptr, test_cb,
nullptr))
357 &ked,
static_cast<FCurve *
>(ale->key_data),
nullptr, sel_cb,
nullptr);
409 ot->
idname =
"ACTION_OT_select_all";
472 layer->wrap().as_node(), xmin, xmax, sel_data->
selectmode);
495 for (masklay =
static_cast<MaskLayer *
>(mask->masklayers.first); masklay;
496 masklay = masklay->
next)
513 ListBase anim_data = {
nullptr,
nullptr};
538 ListBase anim_data = {
nullptr,
nullptr};
544 sel_data.selectmode = selectmode;
565 sel_data.ok_cb =
nullptr;
576 ale = ale->
next, ymax -= channel_step)
581 float ymin = ymax - channel_step;
593 sel_data.ked.f1 = rectf.
xmin;
594 sel_data.ked.f2 = rectf.
xmax;
685 ot->
idname =
"ACTION_OT_select_box";
686 ot->
description =
"Select all keyframes within the specified region";
707 ot->
srna,
"tweak",
false,
"Tweak",
"Operator has been activated using a click-drag event");
741 &rdata->ked, ale->
data, rdata->mode, rdata->selectmode);
765 ListBase anim_data = {
nullptr,
nullptr};
782 for (masklay =
static_cast<MaskLayer *
>(mask->masklayers.first); masklay;
783 masklay = masklay->
next)
803 ListBase anim_data = {
nullptr,
nullptr};
824 const rctf *rectf_view,
829 ListBase anim_data = {
nullptr,
nullptr};
835 sel_data.mode = mode;
836 sel_data.selectmode = selectmode;
838 rctf rectf, scaled_rectf;
857 sel_data.ked.data = data_lasso;
862 sel_data.ked.data =
data;
865 sel_data.ked.data = &scaled_rectf;
873 ale = ale->
next, ymax -= channel_step)
878 const float ymin = ymax - channel_step;
881 sel_data.ked.channel_y = (ymin + ymax) / 2.0f;
896 sel_data.ked.f1 = rectf.
xmin;
897 sel_data.ked.f2 = rectf.
xmax;
904 scaled_rectf.
xmin = sel_data.ked.f1;
905 scaled_rectf.
xmax = sel_data.ked.f2;
906 scaled_rectf.
ymin = ymin;
907 scaled_rectf.
ymax = ymax;
937 if (data_lasso.
mcoords.is_empty()) {
965 ot->
name =
"Lasso Select";
966 ot->
description =
"Select keyframe points using lasso selection";
967 ot->
idname =
"ACTION_OT_select_lasso";
1012 data.radius_squared = radius * radius;
1013 data.rectf_view = &rect_fl;
1015 rect_fl.
xmin = x - radius;
1016 rect_fl.
xmax = x + radius;
1017 rect_fl.
ymin = y - radius;
1018 rect_fl.
ymax = y + radius;
1033 ot->
name =
"Circle Select";
1034 ot->
description =
"Select keyframe points using circle selection";
1035 ot->
idname =
"ACTION_OT_select_circle";
1072 "Between Min/Max Selected Markers",
1074 {0,
nullptr, 0,
nullptr,
nullptr},
1084 ListBase anim_data = {
nullptr,
nullptr};
1109 switch (ale->type) {
1140 BLI_assert_msg(
false,
"Keys cannot be selected into this animation type.");
1152 ListBase anim_data = {
nullptr,
nullptr};
1168 switch (ale->type) {
1174 blender::ed::greasepencil ::create_keyframe_edit_data_selected_frames_list(
1202 ce = MEM_cnew<CfraElem>(
"cfraElem");
1256 &ked,
static_cast<FCurve *
>(ale->key_data), ok_cb, select_cb,
nullptr);
1302 ot->
idname =
"ACTION_OT_select_column";
1303 ot->
description =
"Select all keyframes on the specified frame(s)";
1327 ListBase anim_data = {
nullptr,
nullptr};
1367 ot->
name =
"Select Linked";
1368 ot->
idname =
"ACTION_OT_select_linked";
1369 ot->
description =
"Select keyframes occurring in the same F-Curves as selected ones";
1388 ListBase anim_data = {
nullptr,
nullptr};
1411 if (fcu->
bezt ==
nullptr) {
1456 ot->
name =
"Select More";
1457 ot->
idname =
"ACTION_OT_select_more";
1458 ot->
description =
"Select keyframes beside already selected ones";
1493 ot->
name =
"Select Less";
1494 ot->
idname =
"ACTION_OT_select_less";
1495 ot->
description =
"Deselect keyframes on ends of selection islands";
1518 {0,
nullptr, 0,
nullptr,
nullptr},
1527 ListBase anim_data = {
nullptr,
nullptr};
1550 ked.
f2 =
float(scene->r.cfra + 0.1f);
1553 ked.
f1 =
float(scene->r.cfra - 0.1f);
1563 switch (ale->type) {
1574 static_cast<bGPDlayer *
>(ale->data), ked.
f1, ked.
f2, select_mode);
1580 static_cast<MaskLayer *
>(ale->data), ked.
f1, ked.
f2, select_mode);
1598 BLI_assert_msg(
false,
"Keys cannot be selected into this animation type.");
1615 marker->flag &= ~SELECT;
1676 View2D *v2d = ®ion->v2d;
1698 ot->
name =
"Select Left/Right";
1699 ot->
idname =
"ACTION_OT_select_leftright";
1700 ot->
description =
"Select keyframes to the left or the right of the current frame";
1764 ListBase anim_data = {
nullptr,
nullptr};
1785 ListBase anim_data = {
nullptr,
nullptr};
1793 switch (ale2->type) {
1831 ListBase anim_data = {
nullptr,
nullptr};
1873 &ked,
static_cast<FCurve *
>(ale->key_data), ok_cb, select_cb,
nullptr);
1909 ListBase anim_data = {
nullptr,
nullptr};
1940 const bool deselect_all,
1942 const bool same_channel,
1943 bool wait_to_deselect_others)
1950 bool is_selected =
false;
1956 ac, filter, mval[0], mval[1], &ale, &selx, &frame, &found, &is_selected);
1959 wait_to_deselect_others =
false;
1965 if ((select_mode ==
SELECT_REPLACE && found) || (!found && deselect_all)) {
1971 if (wait_to_deselect_others && (!found || is_selected)) {
1984 if (ale !=
nullptr && ale->
data) {
2011 "fcurve_owner_id of an Action Slot should be an Action");
2052 if (ale !=
nullptr) {
2062 else if (same_channel) {
2103 const bool wait_to_deselect_others =
RNA_boolean_get(op->
ptr,
"wait_to_deselect_others");
2115 &ac, mval, selectmode, deselect_all, column, channel, wait_to_deselect_others);
2130 ot->
name =
"Select Keyframes";
2131 ot->
idname =
"ACTION_OT_clickselect";
2151 "Toggle keyframe selection instead of leaving newly selected keyframes only");
2157 "Deselect On Nothing",
2158 "Deselect all when nothing under the cursor");
2167 "Select all keyframes that occur on the same frame as the one under the mouse");
2175 "Select all the keyframes in the channel under the mouse");
Low-level operations for grease pencil.
float BKE_nla_tweakedit_remap(AnimData *adt, float cframe, short mode)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
void BLI_lasso_boundbox(rcti *rect, blender::Span< blender::int2 > mcoords)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
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)
Object is a sort of wrapper for general info.
@ ANIMTYPE_GREASE_PENCIL_DATABLOCK
@ ANIMTYPE_GREASE_PENCIL_LAYER
@ ANIMTYPE_GREASE_PENCIL_LAYER_GROUP
@ ALE_GREASE_PENCIL_GROUP
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_LIST_VISIBLE
@ ANIMFILTER_LIST_CHANNELS
short(*)(KeyframeEditData *ked, BezTriple *bezt) KeyframeEditFunc
bool ED_masklayer_frame_select_check(const MaskLayer *mask_layer)
void ED_mask_select_frame(MaskLayer *mask_layer, int selx, short select_mode)
void ED_mask_select_frames(MaskLayer *mask_layer, short select_mode)
void ED_masklayer_frames_select_region(KeyframeEditData *ked, MaskLayer *mask_layer, short tool, short select_mode)
void ED_masklayer_frames_select_box(MaskLayer *mask_layer, float min, float max, short select_mode)
void ED_masklayer_frame_select_set(MaskLayer *mask_layer, short mode)
bool ED_operator_action_active(bContext *C)
eSelectOp ED_select_op_modal(eSelectOp sel_op, bool is_first)
#define SEL_OP_USE_PRE_DESELECT(sel_op)
std::string ED_select_circle_get_name(wmOperatorType *ot, PointerRNA *ptr)
Read Guarded memory(de)allocation.
void UI_view2d_listview_view_to_cell(float columnwidth, float rowheight, float startx, float starty, float viewx, float viewy, int *r_column, int *r_row)
void UI_view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
float UI_view2d_region_to_view_x(const View2D *v2d, float x)
void UI_view2d_region_to_view_rctf(const View2D *v2d, const rctf *rect_src, rctf *rect_dst) ATTR_NONNULL()
@ OPTYPE_DEPENDS_ON_CURSOR
@ ACTKEYS_COLUMNSEL_MARKERS_BETWEEN
@ ACTKEYS_COLUMNSEL_MARKERS_COLUMN
static bool actkeys_is_key_at_position(bAnimContext *ac, float region_x, float region_y)
static int mouse_action_keys(bAnimContext *ac, const int mval[2], eEditKeyframes_Select select_mode, const bool deselect_all, const bool column, const bool same_channel, bool wait_to_deselect_others)
@ ACTKEYS_BORDERSEL_ALLKEYS
@ ACTKEYS_BORDERSEL_CHANNELS
@ ACTKEYS_BORDERSEL_FRAMERANGE
static int actkeys_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void ACTION_OT_select_column(wmOperatorType *ot)
static void box_select_elem(BoxSelectData *sel_data, bAnimListElem *ale, float xmin, float xmax, bool summary)
static void actkeys_select_leftright(bAnimContext *ac, short leftright, eEditKeyframes_Select select_mode)
void ACTION_OT_select_less(wmOperatorType *ot)
static int actkeys_clickselect_exec(bContext *C, wmOperator *op)
static void actkeys_mselect_single(bAnimContext *ac, bAnimListElem *ale, const eEditKeyframes_Select select_mode, float selx)
static void actkeys_mselect_column(bAnimContext *ac, eEditKeyframes_Select select_mode, float selx)
static int actkeys_box_select_exec(bContext *C, wmOperator *op)
static void deselect_action_keys(bAnimContext *ac, short test, eEditKeyframes_Select sel)
static void actkeys_find_key_at_position(bAnimContext *ac, eAnimFilter_Flags filter, float region_x, float region_y, bAnimListElem **r_ale, float *r_selx, float *r_frame, bool *r_found, bool *r_is_selected)
static void actkeys_list_element_to_keylist(bAnimContext *ac, AnimKeylist *keylist, bAnimListElem *ale)
static int actkeys_columnselect_exec(bContext *C, wmOperator *op)
static int action_circle_select_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem prop_actkeys_leftright_select_types[]
static void region_select_elem(RegionSelectData *sel_data, bAnimListElem *ale, bool summary)
static int actkeys_select_leftright_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int actkeys_lassoselect_exec(bContext *C, wmOperator *op)
void ACTION_OT_select_all(wmOperatorType *ot)
static bAnimListElem * actkeys_find_list_element_at_position(bAnimContext *ac, eAnimFilter_Flags filter, float region_x, float region_y)
static int actkeys_deselectall_exec(bContext *C, wmOperator *op)
void ACTION_OT_select_lasso(wmOperatorType *ot)
static int actkeys_select_less_exec(bContext *C, wmOperator *)
void ACTION_OT_select_leftright(wmOperatorType *ot)
static void markers_selectkeys_between(bAnimContext *ac)
static void columnselect_action_keys(bAnimContext *ac, short mode)
static void select_moreless_action_keys(bAnimContext *ac, short mode)
void ACTION_OT_select_linked(wmOperatorType *ot)
static void box_select_action(bAnimContext *ac, const rcti rect, short mode, const eEditKeyframes_Select selectmode)
static void actkeys_find_key_in_list_element(bAnimContext *ac, bAnimListElem *ale, float region_x, float *r_selx, float *r_frame, bool *r_found, bool *r_is_selected)
static int actkeys_select_leftright_exec(bContext *C, wmOperator *op)
static void region_select_action_keys(bAnimContext *ac, const rctf *rectf_view, short mode, eEditKeyframes_Select selectmode, void *data)
static void actkeys_mselect_channel_only(bAnimContext *ac, bAnimListElem *ale, eEditKeyframes_Select select_mode)
void ACTION_OT_select_box(wmOperatorType *ot)
void ACTION_OT_select_circle(wmOperatorType *ot)
void ACTION_OT_clickselect(wmOperatorType *ot)
static const EnumPropertyItem prop_column_select_types[]
static int actkeys_select_more_exec(bContext *C, wmOperator *)
static int actkeys_select_linked_exec(bContext *C, wmOperator *)
void ACTION_OT_select_more(wmOperatorType *ot)
float ANIM_UI_get_channel_step()
float ANIM_UI_get_first_channel_top(View2D *v2d)
float ANIM_UI_get_channel_height()
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)
void ANIM_animdata_update(bAnimContext *ac, 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)
bool ANIM_animdata_can_have_greasepencil(const eAnimCont_Types type)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
ListBase * ED_animcontext_get_markers(const bAnimContext *ac)
void ED_markers_get_minmax(ListBase *markers, short sel, float *r_first, float *r_last)
void ED_markers_make_cfra_list(ListBase *markers, ListBase *lb, const bool only_selected)
void slot_active_set(slot_handle_t slot_handle)
void set_selected(bool selected)
void ED_gpencil_layer_frame_select_set(bGPDlayer *gpl, short mode)
void ED_gpencil_set_active_channel(bGPdata *gpd, bGPDlayer *gpl)
void ED_gpencil_select_frames(bGPDlayer *gpl, short select_mode)
bool ED_gpencil_layer_frame_select_check(const bGPDlayer *gpl)
void ED_gpencil_select_frame(bGPDlayer *gpl, int selx, short select_mode)
void ED_gpencil_layer_frames_select_region(KeyframeEditData *ked, bGPDlayer *gpl, short tool, short select_mode)
void ED_gpencil_layer_frames_select_box(bGPDlayer *gpl, float min, float max, short select_mode)
void ED_gpencil_layer_make_cfra_list(bGPDlayer *gpl, ListBase *elems, bool onlysel)
draw_view in_light_buf[] float
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
const vector< Marker > & markers
short bezt_selmap_flush(KeyframeEditData *ked, BezTriple *bezt)
short bezt_to_cfraelem(KeyframeEditData *ked, BezTriple *bezt)
KeyframeEditFunc ANIM_editkeyframes_buildselmap(short mode)
short ANIM_animchannel_keyframes_loop(KeyframeEditData *ked, bDopeSheet *ads, bAnimListElem *ale, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, FCurve *fcu, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
KeyframeEditFunc ANIM_editkeyframes_ok(short mode)
KeyframeEditFunc ANIM_editkeyframes_select(const eEditKeyframes_Select selectmode)
void mask_to_keylist(bDopeSheet *, MaskLayer *masklay, AnimKeylist *keylist)
void scene_to_keylist(bDopeSheet *ads, Scene *sce, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
const ActKeyColumn * ED_keylist_find_any_between(const AnimKeylist *keylist, const Range2f frame_range)
void ob_to_keylist(bDopeSheet *ads, Object *ob, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
void grease_pencil_data_block_to_keylist(AnimData *adt, const GreasePencil *grease_pencil, AnimKeylist *keylist, const int saction_flag, const bool active_layer_only)
void ED_keylist_prepare_for_direct_access(AnimKeylist *keylist)
void summary_to_keylist(bAnimContext *ac, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
AnimKeylist * ED_keylist_create()
void ED_keylist_free(AnimKeylist *keylist)
void fcurve_to_keylist(AnimData *adt, FCurve *fcu, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
void action_slot_to_keylist(AnimData *adt, animrig::Action &action, const animrig::slot_handle_t slot_handle, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
void grease_pencil_layer_group_to_keylist(AnimData *adt, const GreasePencilLayerTreeGroup *layer_group, AnimKeylist *keylist, const int saction_flag)
void action_to_keylist(AnimData *adt, bAction *dna_action, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
void grease_pencil_cels_to_keylist(AnimData *, const GreasePencilLayer *gpl, AnimKeylist *keylist, int)
void gpl_to_keylist(bDopeSheet *, bGPDlayer *gpl, AnimKeylist *keylist)
void action_group_to_keylist(AnimData *adt, bActionGroup *agrp, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void select_frames_at(bke::greasepencil::LayerGroup &layer_group, const int frame_number, const short select_mode)
void select_frames_range(bke::greasepencil::TreeNode &node, const float min, const float max, const short select_mode)
void select_frames_region(KeyframeEditData *ked, bke::greasepencil::TreeNode &node, const short tool, const short select_mode)
bool has_any_frame_selected(const bke::greasepencil::Layer &layer)
void select_all_frames(bke::greasepencil::Layer &layer, const short select_mode)
void select_layer_channel(GreasePencil &grease_pencil, bke::greasepencil::Layer *layer)
bool select_frame_at(bke::greasepencil::Layer &layer, const int frame_number, const short select_mode)
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_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
KeyframeEditFunc select_cb
eKeyframeIterFlags iterflags
blender::Array< blender::int2 > mcoords
KeyframeEditFunc select_cb
eAnim_Update_Flags update
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* modal)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
std::string(* get_name)(wmOperatorType *ot, PointerRNA *ptr)
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(* cancel)(bContext *C, wmOperator *op)
void WM_event_drag_start_mval(const wmEvent *event, const ARegion *region, int r_mval[2])
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)
Array< int2 > WM_gesture_lasso_path_to_array(bContext *, wmOperator *op)
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)
void WM_operator_properties_border_to_rcti(wmOperator *op, rcti *r_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)