Blender V5.3
anim_channels_edit.cc File Reference
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "BLI_listbase.hh"
#include "BLI_math_base_c.hh"
#include "BLI_span.hh"
#include "BLI_string_utf8.hh"
#include "BLI_utildefines.hh"
#include "DNA_anim_types.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_key_types.h"
#include "DNA_mask_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_path.hh"
#include "BKE_action.hh"
#include "BKE_anim_data.hh"
#include "BKE_annotations.h"
#include "BKE_context.hh"
#include "BKE_fcurve.hh"
#include "BKE_global.hh"
#include "BKE_grease_pencil.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_library.hh"
#include "BKE_mask.hh"
#include "BKE_nla.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "BKE_screen.hh"
#include "ANIM_action.hh"
#include "ANIM_action_legacy.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_build.hh"
#include "UI_interface.hh"
#include "UI_view2d.hh"
#include "ED_armature.hh"
#include "ED_keyframes_edit.hh"
#include "ED_markers.hh"
#include "ED_object.hh"
#include "ED_screen.hh"
#include "ED_select_utils.hh"
#include "ANIM_animdata.hh"
#include "ANIM_fcurve.hh"
#include "WM_api.hh"
#include "WM_message.hh"
#include "WM_types.hh"
#include "BLT_translation.hh"

Go to the source code of this file.

Classes

struct  blender::tReorderChannelIsland

Namespaces

namespace  blender
 BMesh Iterators.

Enumerations

Reordering "Islands" Defines
enum  blender::eReorderIslandFlag { blender::REORDER_ISLAND_SELECTED = (1 << 0) , blender::REORDER_ISLAND_UNTOUCHABLE = (1 << 1) , blender::REORDER_ISLAND_MOVED = (1 << 2) , blender::REORDER_ISLAND_HIDDEN = (1 << 3) }

Functions

Channel helper functions
static bool blender::get_normalized_fcurve_bounds (FCurve *fcu, SpaceLink *space_link, Scene *scene, ID *id, const bool include_handles, const float range[2], rctf *r_bounds)
static bool blender::get_gpencil_bounds (bGPDlayer *gpl, const float range[2], rctf *r_bounds)
static bool blender::get_grease_pencil_layer_bounds (const GreasePencilLayer *gplayer, const float range[2], rctf *r_bounds)
static bool blender::get_channel_bounds (bAnimContext *ac, bAnimListElem *ale, const float range[2], const bool include_handles, rctf *r_bounds)
static void blender::add_region_padding (bContext *C, ARegion *region, rctf *bounds)
Public Channel Selection API
void blender::ANIM_set_active_channel (bAnimContext *ac, void *data, eAnimCont_Types datatype, eAnimFilter_Flags filter, void *channel_data, eAnim_ChannelType channel_type)
bool blender::ANIM_is_active_channel (bAnimListElem *ale)
static void blender::select_pchan_for_action_group (bAnimContext *ac, bActionGroup *agrp, bAnimListElem *ale, const bool change_active)
static ListBaseT< bAnimListElem > blender::anim_channels_for_selection (bAnimContext *ac)
static eAnimChannels_SetFlag blender::anim_channels_selection_flag_for_toggle (const ListBaseT< bAnimListElem > anim_data)
template<typename T>
static void blender::templated_selection_state_update (T &selectable_thing, const eAnimChannels_SetFlag selectmode)
static void blender::anim_channels_select_set (bAnimContext *ac, const ListBaseT< bAnimListElem > anim_data, eAnimChannels_SetFlag sel)
void blender::ANIM_anim_channels_select_set (bAnimContext *ac, eAnimChannels_SetFlag sel)
void blender::ANIM_anim_channels_select_toggle (bAnimContext *ac)
Public Graph Editor API
static void blender::anim_flush_channel_setting_up (bAnimContext *ac, const eAnimChannel_Settings setting, const eAnimChannels_SetFlag mode, bAnimListElem *const match, const int matchLevel)
static void blender::anim_flush_channel_setting_down (bAnimContext *ac, const eAnimChannel_Settings setting, const eAnimChannels_SetFlag mode, bAnimListElem *const match, const int matchLevel)
void blender::ANIM_flush_setting_anim_channels (bAnimContext *ac, ListBaseT< bAnimListElem > *anim_data, bAnimListElem *ale_setting, eAnimChannel_Settings setting, eAnimChannels_SetFlag mode)
void blender::ANIM_frame_channel_y_extents (bContext *C, bAnimContext *ac)
Operator Utilities
static bool blender::animedit_poll_channels_active (bContext *C)
static bool blender::animedit_poll_channels_nla_tweakmode_off (bContext *C)
Rearrange Islands Generics
template<typename T>
static void blender::rearrange_animchannel_add_to_islands (ListBaseT< tReorderChannelIsland > *islands, ListBaseT< T > *srcList, Link *channel, eAnim_ChannelType type, const bool is_hidden)
template<typename T>
static void blender::rearrange_animchannel_flatten_islands (ListBaseT< tReorderChannelIsland > *islands, ListBaseT< T > *srcList)
static void blender::rearrange_animchannels_filter_visible (ListBaseT< bAnimListElem > *anim_data_visible, bAnimContext *ac, const eAnim_ChannelType type, const eAnimFilter_Flags additional_filters=eAnimFilter_Flags{})
template<typename T>
static bool blender::rearrange_animchannel_islands (ListBaseT< T > *list, AnimChanRearrangeFp rearrange_func, eRearrangeAnimChan_Mode mode, eAnim_ChannelType type, ListBaseT< bAnimListElem > *anim_data_visible)
Rearrange NLA Tracks
static void blender::rearrange_nla_tracks (bAnimContext *ac, AnimData *adt, eRearrangeAnimChan_Mode mode)
Rearrange Drivers
static void blender::rearrange_driver_channels (bAnimContext *ac, AnimData *adt, eRearrangeAnimChan_Mode mode)
Rearrange Action Channels
static bool blender::rearrange_layered_action_slots (bAnimContext *ac, const eRearrangeAnimChan_Mode mode)
static void blender::rearrange_layered_action_channel_groups (bAnimContext *ac, animrig::Action &action, const eRearrangeAnimChan_Mode mode)
static void blender::rearrange_layered_action_fcurves (bAnimContext *ac, animrig::Action &action, const eRearrangeAnimChan_Mode mode)
static void blender::rearrange_action_channels (bAnimContext *ac, bAction *act, eRearrangeAnimChan_Mode mode)
Rearrange NLA Control Channels
static void blender::rearrange_nla_control_channels (bAnimContext *ac, AnimData *adt, eRearrangeAnimChan_Mode mode)
Rearrange Grease Pencil Channels
static void blender::rearrange_grease_pencil_channels (bAnimContext *ac, eRearrangeAnimChan_Mode mode)
static void blender::rearrange_gpencil_channels (bAnimContext *ac, eRearrangeAnimChan_Mode mode)
Move (Rearrange) Channels Operator
static wmOperatorStatus blender::animchannels_rearrange_exec (bContext *C, wmOperator *op)
static void blender::ANIM_OT_channels_move (wmOperatorType *ot)
Group Channel Operator
static bool blender::animchannels_grouping_poll (bContext *C)
static void blender::animchannels_group_channels (bAnimContext *ac, bAnimListElem *adt_ref, const char name[])
static wmOperatorStatus blender::animchannels_group_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus blender::animchannels_group_exec (bContext *C, wmOperator *op)
static void blender::ANIM_OT_channels_group (wmOperatorType *ot)
Ungroup Channels Operator
static wmOperatorStatus blender::animchannels_ungroup_exec (bContext *C, wmOperator *)
static void blender::ANIM_OT_channels_ungroup (wmOperatorType *ot)
Delete Channel Operator
static void blender::tag_update_animation_element (bAnimListElem *ale)
static bool blender::animchannels_delete_containers (const bContext *C, bAnimContext *ac)
void blender::ED_anim_ale_fcurve_delete (bAnimContext &ac, bAnimListElem &ale)
static wmOperatorStatus blender::animchannels_delete_exec (bContext *C, wmOperator *)
static void blender::ANIM_OT_channels_delete (wmOperatorType *ot)
Set/Toggle Channel Flags Operators
static wmOperatorStatus blender::animchannels_setflag_exec (bContext *C, wmOperator *op)
static void blender::ANIM_OT_channels_setting_enable (wmOperatorType *ot)
static void blender::ANIM_OT_channels_setting_disable (wmOperatorType *ot)
static void blender::ANIM_OT_channels_setting_toggle (wmOperatorType *ot)
static void blender::ANIM_OT_channels_editable_toggle (wmOperatorType *ot)
Expand Channels Operator
static wmOperatorStatus blender::animchannels_expand_exec (bContext *C, wmOperator *op)
static void blender::ANIM_OT_channels_expand (wmOperatorType *ot)
Collapse Channels Operator
static wmOperatorStatus blender::animchannels_collapse_exec (bContext *C, wmOperator *op)
static void blender::ANIM_OT_channels_collapse (wmOperatorType *ot)
Remove All "Empty" AnimData Blocks Operator

We define "empty" AnimData blocks here as those which have all 3 of criteria:

1) No active action OR that active actions are empty Assuming that all legitimate entries will have an action, and that empty actions 2) No NLA Tracks + NLA Strips Assuming that users haven't set up any of these as "placeholders" for convenience sake, and that most that exist were either unintentional or are no longer wanted 3) No drivers

static wmOperatorStatus blender::animchannels_clean_empty_exec (bContext *C, wmOperator *)
static void blender::ANIM_OT_channels_clean_empty (wmOperatorType *ot)
Re-enable Disabled Operator
static bool blender::animchannels_enable_poll (bContext *C)
static wmOperatorStatus blender::animchannels_enable_exec (bContext *C, wmOperator *)
static void blender::ANIM_OT_channels_fcurves_enable (wmOperatorType *ot)
Select Filter Text-box Operator
static bool blender::animchannels_select_filter_poll (bContext *C)
static wmOperatorStatus blender::animchannels_select_filter_invoke (bContext *C, wmOperator *, const wmEvent *)
static void blender::ANIM_OT_channels_select_filter (wmOperatorType *ot)
Select All Operator
static wmOperatorStatus blender::animchannels_selectall_exec (bContext *C, wmOperator *op)
static void blender::ANIM_OT_channels_select_all (wmOperatorType *ot)
Box Select Operator
static void blender::box_select_anim_channels (bAnimContext *ac, const rcti &rect, short selectmode)
static wmOperatorStatus blender::animchannels_box_select_exec (bContext *C, wmOperator *op)
static void blender::ANIM_OT_channels_select_box (wmOperatorType *ot)
Rename Channel Operator

Allow renaming some channels by clicking on them.

static bool blender::rename_anim_channels (bAnimContext *ac, int channel_index)
static int blender::animchannels_channel_get (bAnimContext *ac, const int mval[2])
static wmOperatorStatus blender::animchannels_rename_invoke (bContext *C, wmOperator *, const wmEvent *event)
static void blender::ANIM_OT_channels_rename (wmOperatorType *ot)
Select Channel Keyframes Operator (Internal Logic)
static int blender::click_select_channel_scene (bAnimListElem *ale, const short selectmode)
static bool blender::animchannel_has_active_of_type (bAnimContext *ac, const eAnim_ChannelType type)
static void blender::animchannel_select_range (bAnimContext *ac, bAnimListElem *cursor_elem)
static int blender::click_select_channel_object (bContext *C, bAnimContext *ac, bAnimListElem *ale, const short selectmode)
static int blender::click_select_channel_dummy (bAnimContext *ac, bAnimListElem *ale, const short selectmode)
static int blender::click_select_channel_group (bAnimContext *ac, bAnimListElem *ale, const short selectmode, const int filter)
static int blender::click_select_channel_fcurve (bAnimContext *ac, bAnimListElem *ale, const short selectmode, const int filter)
static int blender::click_select_channel_action_slot (bAnimContext *ac, bAnimListElem *ale, short selectmode)
static int blender::click_select_channel_shapekey (bContext *C, bAnimContext *ac, bAnimListElem *ale, const short selectmode)
static int blender::click_select_channel_nlacontrols (bAnimListElem *ale)
static int blender::click_select_channel_gplayer (bContext *C, bAnimContext *ac, bAnimListElem *ale, const short selectmode, const int filter)
static int blender::click_select_channel_grease_pencil_datablock (bAnimListElem *ale)
static int blender::click_select_channel_grease_pencil_layer_group (bContext *C, bAnimListElem *ale)
static int blender::click_select_channel_grease_pencil_layer (bContext *C, bAnimContext *ac, bAnimListElem *ale, const short selectmode, const int)
static int blender::click_select_channel_maskdatablock (bAnimListElem *ale)
static int blender::click_select_channel_masklayer (bAnimContext *ac, bAnimListElem *ale, const short selectmode)
static int blender::mouse_anim_channels (bContext *C, bAnimContext *ac, const int channel_index, short selectmode)
Select Channel Keyframes Operator
static wmOperatorStatus blender::animchannels_mouseclick_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::ANIM_OT_channels_click (wmOperatorType *ot)
static bool blender::select_anim_channel_keys (bAnimContext *ac, int channel_index, bool extend)
static wmOperatorStatus blender::animchannels_channel_select_keys_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::ANIM_OT_channel_select_keys (wmOperatorType *ot)
View Channel Operator
static void blender::get_view_range (Scene *scene, const bool use_preview_range, float r_range[2])
static wmOperatorStatus blender::graphkeys_view_selected_channels_exec (bContext *C, wmOperator *op)
static bool blender::channel_view_poll (bContext *C)
static void blender::ANIM_OT_channels_view_selected (wmOperatorType *ot)
static wmOperatorStatus blender::graphkeys_channel_view_pick_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::ANIM_OT_channel_view_pick (wmOperatorType *ot)
Move Slot Channels to New Action Operator
static wmOperatorStatus blender::slot_channels_move_to_new_action_exec (bContext *C, wmOperator *op)
static bool blender::slot_channels_move_to_new_action_poll (bContext *C)
static void blender::ANIM_OT_slot_channels_move_to_new_action (wmOperatorType *ot)
Separate Slots Operator
static wmOperatorStatus blender::separate_slots_exec (bContext *C, wmOperator *op)
static bool blender::separate_slots_poll (bContext *C)
static void blender::ANIM_OT_separate_slots (wmOperatorType *ot)
View Curve in Graph Editor Operator
static bool blender::context_find_graph_editor (bContext *C, wmWindow **r_win, ScrArea **r_area, ARegion **r_region)
static void blender::deselect_all_fcurves (bAnimContext *ac, const bool hide)
static int blender::count_fcurves_hidden_by_filter (bAnimContext *ac, const Span< FCurve * > fcurves)
static Vector< FCurve * > blender::get_fcurves_of_property (ID *id, PointerRNA *ptr, PropertyRNA *prop, const bool whole_array, const int index)
static rctf blender::calculate_fcurve_bounds_and_unhide (SpaceLink *space_link, Scene *scene, ID *id, const Span< FCurve * > fcurves)
static rctf blender::calculate_selection_fcurve_bounds (bAnimContext *ac, Span< PointerRNA > selection, PropertyRNA *prop, const StringRefNull id_to_prop_path, const int index, const bool whole_array, int *r_filtered_fcurve_count)
static wmOperatorStatus blender::view_curve_in_graph_editor_exec (bContext *C, wmOperator *op)
static void blender::ANIM_OT_view_curve_in_graph_editor (wmOperatorType *ot)
Operator Registration
void blender::ED_operatortypes_animchannels ()
void blender::ED_keymap_animchannels (wmKeyConfig *keyconf)

Move (Rearrange) Channel Defines

enum  blender::eRearrangeAnimChan_Mode { blender::REARRANGE_ANIMCHAN_TOP = -2 , blender::REARRANGE_ANIMCHAN_UP = -1 , blender::REARRANGE_ANIMCHAN_DOWN = 1 , blender::REARRANGE_ANIMCHAN_BOTTOM = 2 }
static const EnumPropertyItem blender::prop_animchannel_rearrange_types []

Rearrange Methods

using blender::AnimChanRearrangeFp
static bool blender::rearrange_island_ok (tReorderChannelIsland *island)
static bool blender::rearrange_island_top (ListBaseT< tReorderChannelIsland > *list, tReorderChannelIsland *island)
static bool blender::rearrange_island_up (ListBaseT< tReorderChannelIsland > *list, tReorderChannelIsland *island)
static bool blender::rearrange_island_down (ListBaseT< tReorderChannelIsland > *list, tReorderChannelIsland *island)
static bool blender::rearrange_island_bottom (ListBaseT< tReorderChannelIsland > *list, tReorderChannelIsland *island)
static AnimChanRearrangeFp blender::rearrange_get_mode_func (eRearrangeAnimChan_Mode mode)
static AnimChanRearrangeFp blender::rearrange_gpencil_get_mode_func (eRearrangeAnimChan_Mode mode)

Set/Toggle Channel Flags Operator Utilities

static const EnumPropertyItem blender::prop_animchannel_setflag_types []
static const EnumPropertyItem blender::prop_animchannel_settings_types []
static void blender::setflag_anim_channels (bAnimContext *ac, eAnimChannel_Settings setting, eAnimChannels_SetFlag mode, bool onlysel, bool flush)

Bake Channels Operator

static const EnumPropertyItem blender::channel_bake_key_options []
static wmOperatorStatus blender::channels_bake_exec (bContext *C, wmOperator *op)
static bool blender::channels_bake_poll_property (const bContext *, wmOperator *op, const PropertyRNA *prop)
static void blender::ANIM_OT_channels_bake (wmOperatorType *ot)