Blender V4.3
anim_channels_edit.cc File Reference
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_listbase.h"
#include "BLI_span.hh"
#include "BLI_utildefines.h"
#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_context.hh"
#include "BKE_fcurve.hh"
#include "BKE_global.hh"
#include "BKE_gpencil_legacy.h"
#include "BKE_grease_pencil.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_mask.h"
#include "BKE_nla.hh"
#include "BKE_scene.hh"
#include "BKE_screen.hh"
#include "BKE_workspace.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  tReorderChannelIsland
 

Functions

Channel helper functions
static bool get_normalized_fcurve_bounds (FCurve *fcu, AnimData *anim_data, SpaceLink *space_link, Scene *scene, ID *id, const bool include_handles, const float range[2], rctf *r_bounds)
 
static bool get_gpencil_bounds (bGPDlayer *gpl, const float range[2], rctf *r_bounds)
 
static bool get_grease_pencil_layer_bounds (const GreasePencilLayer *gplayer, const float range[2], rctf *r_bounds)
 
static bool get_channel_bounds (bAnimContext *ac, bAnimListElem *ale, const float range[2], const bool include_handles, rctf *r_bounds)
 
static void add_region_padding (bContext *C, ARegion *region, rctf *bounds)
 
Public Channel Selection API
void ANIM_set_active_channel (bAnimContext *ac, void *data, eAnimCont_Types datatype, eAnimFilter_Flags filter, void *channel_data, eAnim_ChannelType channel_type)
 
bool ANIM_is_active_channel (bAnimListElem *ale)
 
static void select_pchan_for_action_group (bAnimContext *ac, bActionGroup *agrp, bAnimListElem *ale, const bool change_active)
 
static ListBase anim_channels_for_selection (bAnimContext *ac)
 
static eAnimChannels_SetFlag anim_channels_selection_flag_for_toggle (const ListBase anim_data)
 
template<typename T >
static void templated_selection_state_update (T &selectable_thing, const eAnimChannels_SetFlag selectmode)
 
static void anim_channels_select_set (bAnimContext *ac, const ListBase anim_data, eAnimChannels_SetFlag sel)
 
void ANIM_anim_channels_select_set (bAnimContext *ac, eAnimChannels_SetFlag sel)
 
void ANIM_anim_channels_select_toggle (bAnimContext *ac)
 
Public Graph Editor API
static void anim_flush_channel_setting_up (bAnimContext *ac, const eAnimChannel_Settings setting, const eAnimChannels_SetFlag mode, bAnimListElem *const match, const int matchLevel)
 
static void anim_flush_channel_setting_down (bAnimContext *ac, const eAnimChannel_Settings setting, const eAnimChannels_SetFlag mode, bAnimListElem *const match, const int matchLevel)
 
void ANIM_flush_setting_anim_channels (bAnimContext *ac, ListBase *anim_data, bAnimListElem *ale_setting, eAnimChannel_Settings setting, eAnimChannels_SetFlag mode)
 
void ANIM_frame_channel_y_extents (bContext *C, bAnimContext *ac)
 
Operator Utilities
static bool animedit_poll_channels_active (bContext *C)
 
static bool animedit_poll_channels_nla_tweakmode_off (bContext *C)
 
Group Channel Operator
static bool animchannels_grouping_poll (bContext *C)
 
static void animchannels_group_channels (bAnimContext *ac, bAnimListElem *adt_ref, const char name[])
 
static int animchannels_group_exec (bContext *C, wmOperator *op)
 
static void ANIM_OT_channels_group (wmOperatorType *ot)
 
Ungroup Channels Operator
static int animchannels_ungroup_exec (bContext *C, wmOperator *)
 
static void ANIM_OT_channels_ungroup (wmOperatorType *ot)
 
Delete Channel Operator
static void tag_update_animation_element (bAnimListElem *ale)
 
static int animchannels_delete_exec (bContext *C, wmOperator *)
 
static void ANIM_OT_channels_delete (wmOperatorType *ot)
 
Expand Channels Operator
static int animchannels_expand_exec (bContext *C, wmOperator *op)
 
static void ANIM_OT_channels_expand (wmOperatorType *ot)
 
Collapse Channels Operator
static int animchannels_collapse_exec (bContext *C, wmOperator *op)
 
static void 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 int animchannels_clean_empty_exec (bContext *C, wmOperator *)
 
static void ANIM_OT_channels_clean_empty (wmOperatorType *ot)
 
Re-enable Disabled Operator
static bool animchannels_enable_poll (bContext *C)
 
static int animchannels_enable_exec (bContext *C, wmOperator *)
 
static void ANIM_OT_channels_fcurves_enable (wmOperatorType *ot)
 
Select Filter Text-box Operator
static bool animchannels_select_filter_poll (bContext *C)
 
static int animchannels_select_filter_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
static int animchannels_select_filter_modal (bContext *C, wmOperator *, const wmEvent *)
 
static void ANIM_OT_channels_select_filter (wmOperatorType *ot)
 
Select All Operator
static int animchannels_selectall_exec (bContext *C, wmOperator *op)
 
static void ANIM_OT_channels_select_all (wmOperatorType *ot)
 
Box Select Operator
static void box_select_anim_channels (bAnimContext *ac, const rcti &rect, short selectmode)
 
static int animchannels_box_select_exec (bContext *C, wmOperator *op)
 
static void ANIM_OT_channels_select_box (wmOperatorType *ot)
 
Rename Channel Operator

Allow renaming some channels by clicking on them.

static bool rename_anim_channels (bAnimContext *ac, int channel_index)
 
static int animchannels_channel_get (bAnimContext *ac, const int mval[2])
 
static int animchannels_rename_invoke (bContext *C, wmOperator *, const wmEvent *event)
 
static void ANIM_OT_channels_rename (wmOperatorType *ot)
 
Select Channel Keyframes Operator (Internal Logic)
static int click_select_channel_scene (bAnimListElem *ale, const short selectmode)
 
static bool animchannel_has_active_of_type (bAnimContext *ac, const eAnim_ChannelType type)
 
static void animchannel_select_range (bAnimContext *ac, bAnimListElem *cursor_elem)
 
static int click_select_channel_object (bContext *C, bAnimContext *ac, bAnimListElem *ale, const short selectmode)
 
static int click_select_channel_dummy (bAnimContext *ac, bAnimListElem *ale, const short selectmode)
 
static int click_select_channel_group (bAnimContext *ac, bAnimListElem *ale, const short selectmode, const int filter)
 
static int click_select_channel_fcurve (bAnimContext *ac, bAnimListElem *ale, const short selectmode, const int filter)
 
static int click_select_channel_action_slot (bAnimContext *ac, bAnimListElem *ale, short selectmode)
 
static int click_select_channel_shapekey (bAnimContext *ac, bAnimListElem *ale, const short selectmode)
 
static int click_select_channel_nlacontrols (bAnimListElem *ale)
 
static int click_select_channel_gpdatablock (bAnimListElem *ale)
 
static int click_select_channel_gplayer (bContext *C, bAnimContext *ac, bAnimListElem *ale, const short selectmode, const int filter)
 
static int click_select_channel_grease_pencil_datablock (bAnimListElem *ale)
 
static int click_select_channel_grease_pencil_layer_group (bAnimListElem *ale)
 
static int click_select_channel_grease_pencil_layer (bContext *C, bAnimContext *ac, bAnimListElem *ale, const short selectmode, const int)
 
static int click_select_channel_maskdatablock (bAnimListElem *ale)
 
static int click_select_channel_masklayer (bAnimContext *ac, bAnimListElem *ale, const short selectmode)
 
static int mouse_anim_channels (bContext *C, bAnimContext *ac, const int channel_index, short selectmode)
 
Select Channel Keyframes Operator
static int animchannels_mouseclick_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void ANIM_OT_channels_click (wmOperatorType *ot)
 
static bool select_anim_channel_keys (bAnimContext *ac, int channel_index, bool extend)
 
static int animchannels_channel_select_keys_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void ANIM_OT_channel_select_keys (wmOperatorType *ot)
 
Operator Registration
void ED_operatortypes_animchannels ()
 
void ED_keymap_animchannels (wmKeyConfig *keyconf)
 

Move (Rearrange) Channels Operator

enum  eRearrangeAnimChan_Mode { REARRANGE_ANIMCHAN_TOP = -2 , REARRANGE_ANIMCHAN_UP = -1 , REARRANGE_ANIMCHAN_DOWN = 1 , REARRANGE_ANIMCHAN_BOTTOM = 2 }
 
enum  eReorderIslandFlag { REORDER_ISLAND_SELECTED = (1 << 0) , REORDER_ISLAND_UNTOUCHABLE = (1 << 1) , REORDER_ISLAND_MOVED = (1 << 2) , REORDER_ISLAND_HIDDEN = (1 << 3) }
 
using AnimChanRearrangeFp = bool (*)(ListBase *list, tReorderChannelIsland *island)
 
static const EnumPropertyItem prop_animchannel_rearrange_types []
 
static bool rearrange_island_ok (tReorderChannelIsland *island)
 
static bool rearrange_island_top (ListBase *list, tReorderChannelIsland *island)
 
static bool rearrange_island_up (ListBase *list, tReorderChannelIsland *island)
 
static bool rearrange_island_down (ListBase *list, tReorderChannelIsland *island)
 
static bool rearrange_island_bottom (ListBase *list, tReorderChannelIsland *island)
 
static AnimChanRearrangeFp rearrange_get_mode_func (eRearrangeAnimChan_Mode mode)
 
static AnimChanRearrangeFp rearrange_gpencil_get_mode_func (eRearrangeAnimChan_Mode mode)
 
static void rearrange_animchannel_add_to_islands (ListBase *islands, ListBase *srcList, Link *channel, eAnim_ChannelType type, const bool is_hidden)
 
static void rearrange_animchannel_flatten_islands (ListBase *islands, ListBase *srcList)
 
static void rearrange_animchannels_filter_visible (ListBase *anim_data_visible, bAnimContext *ac, eAnim_ChannelType type)
 
static bool rearrange_animchannel_islands (ListBase *list, AnimChanRearrangeFp rearrange_func, eRearrangeAnimChan_Mode mode, eAnim_ChannelType type, ListBase *anim_data_visible)
 
static void rearrange_nla_tracks (bAnimContext *ac, AnimData *adt, eRearrangeAnimChan_Mode mode)
 
static void rearrange_driver_channels (bAnimContext *ac, AnimData *adt, eRearrangeAnimChan_Mode mode)
 
static void split_groups_action_temp (bAction *act, bActionGroup *tgrp)
 
static void join_groups_action_temp (bAction *act)
 
static void rearrange_layered_action_channel_groups (bAnimContext *ac, const eRearrangeAnimChan_Mode mode)
 
static void rearrange_layered_action_fcurves (bAnimContext *ac, blender::animrig::Action &action, const eRearrangeAnimChan_Mode mode)
 
static void rearrange_action_channels (bAnimContext *ac, bAction *act, eRearrangeAnimChan_Mode mode)
 
static void rearrange_nla_control_channels (bAnimContext *ac, AnimData *adt, eRearrangeAnimChan_Mode mode)
 
static void rearrange_grease_pencil_channels (bAnimContext *ac, eRearrangeAnimChan_Mode mode)
 
static void rearrange_gpencil_channels (bAnimContext *ac, eRearrangeAnimChan_Mode mode)
 
static int animchannels_rearrange_exec (bContext *C, wmOperator *op)
 
static void ANIM_OT_channels_move (wmOperatorType *ot)
 

Set/Toggle Channel Flags Operator Utilities

static const EnumPropertyItem prop_animchannel_setflag_types []
 
static const EnumPropertyItem prop_animchannel_settings_types []
 
static void setflag_anim_channels (bAnimContext *ac, eAnimChannel_Settings setting, eAnimChannels_SetFlag mode, bool onlysel, bool flush)
 
static int animchannels_setflag_exec (bContext *C, wmOperator *op)
 
static void ANIM_OT_channels_setting_enable (wmOperatorType *ot)
 
static void ANIM_OT_channels_setting_disable (wmOperatorType *ot)
 
static void ANIM_OT_channels_setting_toggle (wmOperatorType *ot)
 
static void ANIM_OT_channels_editable_toggle (wmOperatorType *ot)
 

View Channel Operator

static const EnumPropertyItem channel_bake_key_options []
 
static void get_view_range (Scene *scene, const bool use_preview_range, float r_range[2])
 
static int graphkeys_view_selected_channels_exec (bContext *C, wmOperator *op)
 
static bool channel_view_poll (bContext *C)
 
static void ANIM_OT_channels_view_selected (wmOperatorType *ot)
 
static int graphkeys_channel_view_pick_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void ANIM_OT_channel_view_pick (wmOperatorType *ot)
 
static int channels_bake_exec (bContext *C, wmOperator *op)
 
static void ANIM_OT_channels_bake (wmOperatorType *ot)
 
static bool context_find_graph_editor (bContext *C, wmWindow **r_win, ScrArea **r_area, ARegion **r_region)
 
static void deselect_all_fcurves (bAnimContext *ac, const bool hide)
 
static int count_fcurves_hidden_by_filter (bAnimContext *ac, const blender::Span< FCurve * > fcurves)
 
static blender::Vector< FCurve * > get_fcurves_of_property (ID *id, PointerRNA *ptr, PropertyRNA *prop, const bool whole_array, const int index)
 
static rctf calculate_fcurve_bounds_and_unhide (SpaceLink *space_link, Scene *scene, ID *id, const blender::Span< FCurve * > fcurves)
 
static rctf calculate_selection_fcurve_bounds (bAnimContext *ac, blender::Span< PointerRNA > selection, PropertyRNA *prop, const blender::StringRefNull id_to_prop_path, const int index, const bool whole_array, int *r_filtered_fcurve_count)
 
static int view_curve_in_graph_editor_exec (bContext *C, wmOperator *op)
 
static void ANIM_OT_view_curve_in_graph_editor (wmOperatorType *ot)
 

Typedef Documentation

◆ AnimChanRearrangeFp

using AnimChanRearrangeFp = bool (*)(ListBase *list, tReorderChannelIsland *island)

typedef for channel rearranging function

Parameters
listList of tReorderChannelIsland's that channels belong to
islandIsland to be moved
Returns
Whether operation was a success

Definition at line 1260 of file anim_channels_edit.cc.

Enumeration Type Documentation

◆ eRearrangeAnimChan_Mode

Enumerator
REARRANGE_ANIMCHAN_TOP 
REARRANGE_ANIMCHAN_UP 
REARRANGE_ANIMCHAN_DOWN 
REARRANGE_ANIMCHAN_BOTTOM 

Definition at line 1109 of file anim_channels_edit.cc.

◆ eReorderIslandFlag

Enumerator
REORDER_ISLAND_SELECTED 
REORDER_ISLAND_UNTOUCHABLE 
REORDER_ISLAND_MOVED 
REORDER_ISLAND_HIDDEN 

Definition at line 1136 of file anim_channels_edit.cc.

Function Documentation

◆ add_region_padding()

◆ ANIM_anim_channels_select_set()

◆ ANIM_anim_channels_select_toggle()

void ANIM_anim_channels_select_toggle ( bAnimContext * ac)

Toggle selection state of all animation channels in the context.

Definition at line 826 of file anim_channels_edit.cc.

References ANIM_animdata_freelist(), anim_channels_for_selection(), anim_channels_select_set(), and anim_channels_selection_flag_for_toggle().

Referenced by animchannels_selectall_exec().

◆ anim_channels_for_selection()

◆ anim_channels_select_set()

static void anim_channels_select_set ( bAnimContext * ac,
const ListBase anim_data,
eAnimChannels_SetFlag sel )
static

◆ anim_channels_selection_flag_for_toggle()

◆ anim_flush_channel_setting_down()

static void anim_flush_channel_setting_down ( bAnimContext * ac,
const eAnimChannel_Settings setting,
const eAnimChannels_SetFlag mode,
bAnimListElem *const match,
const int matchLevel )
static

◆ anim_flush_channel_setting_up()

static void anim_flush_channel_setting_up ( bAnimContext * ac,
const eAnimChannel_Settings setting,
const eAnimChannels_SetFlag mode,
bAnimListElem *const match,
const int matchLevel )
static

◆ ANIM_flush_setting_anim_channels()

void ANIM_flush_setting_anim_channels ( bAnimContext * ac,
ListBase * anim_data,
bAnimListElem * ale_setting,
eAnimChannel_Settings setting,
eAnimChannels_SetFlag mode )

Flush visibility (for Graph Editor) changes up/down hierarchy for changes in the given setting

  • anim_data: list of the all the anim channels that can be chosen -> filtered using ANIMFILTER_CHANNELS only, since if we took VISIBLE too, then the channels under closed expanders get ignored...
  • ale_setting: the anim channel (not in the anim_data list directly, though occurring there) with the new state of the setting that we want flushed up/down the hierarchy
  • setting: type of setting to set
  • on: whether the visibility setting has been enabled or disabled

Definition at line 949 of file anim_channels_edit.cc.

References ACHANNEL_SETTING_ALWAYS_VISIBLE, ANIM_channel_get_typeinfo(), anim_flush_channel_setting_down(), anim_flush_channel_setting_up(), bAnimListElem::data, ELEM, ListBase::first, bAnimChannelType::get_offset, bAnimListElem::id, LISTBASE_FOREACH, printf, and bAnimListElem::type.

Referenced by achannel_setting_flush_widget_cb(), graphview_curves_hide_exec(), graphview_curves_reveal_exec(), and setflag_anim_channels().

◆ ANIM_frame_channel_y_extents()

◆ ANIM_is_active_channel()

◆ ANIM_OT_channel_select_keys()

◆ ANIM_OT_channel_view_pick()

◆ ANIM_OT_channels_bake()

◆ ANIM_OT_channels_clean_empty()

◆ ANIM_OT_channels_click()

◆ ANIM_OT_channels_collapse()

◆ ANIM_OT_channels_delete()

◆ ANIM_OT_channels_editable_toggle()

◆ ANIM_OT_channels_expand()

◆ ANIM_OT_channels_fcurves_enable()

◆ ANIM_OT_channels_group()

◆ ANIM_OT_channels_move()

◆ ANIM_OT_channels_rename()

◆ ANIM_OT_channels_select_all()

◆ ANIM_OT_channels_select_box()

◆ ANIM_OT_channels_select_filter()

◆ ANIM_OT_channels_setting_disable()

◆ ANIM_OT_channels_setting_enable()

◆ ANIM_OT_channels_setting_toggle()

◆ ANIM_OT_channels_ungroup()

◆ ANIM_OT_channels_view_selected()

◆ ANIM_OT_view_curve_in_graph_editor()

◆ ANIM_set_active_channel()

void ANIM_set_active_channel ( bAnimContext * ac,
void * data,
eAnimCont_Types datatype,
eAnimFilter_Flags filter,
void * channel_data,
eAnim_ChannelType channel_type )

Set the given animation-channel as the active one for the active context.

Definition at line 232 of file anim_channels_edit.cc.

References ACHANNEL_SET_FLAG, ACHANNEL_SETFLAG_CLEAR, bAnimListElem::adt, ADT_UI_ACTIVE, AGRP_ACTIVE, ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIMTYPE_ACTION_SLOT, ANIMTYPE_ANIMDATA, ANIMTYPE_DSARM, ANIMTYPE_DSCACHEFILE, ANIMTYPE_DSCAM, ANIMTYPE_DSCUR, ANIMTYPE_DSGPENCIL, ANIMTYPE_DSHAIR, ANIMTYPE_DSLAM, ANIMTYPE_DSLAT, ANIMTYPE_DSLINESTYLE, ANIMTYPE_DSMAT, ANIMTYPE_DSMBALL, ANIMTYPE_DSMCLIP, ANIMTYPE_DSMESH, ANIMTYPE_DSNTREE, ANIMTYPE_DSPART, ANIMTYPE_DSPOINTCLOUD, ANIMTYPE_DSSKEY, ANIMTYPE_DSSPK, ANIMTYPE_DSTEX, ANIMTYPE_DSVOLUME, ANIMTYPE_DSWOR, ANIMTYPE_FCURVE, ANIMTYPE_FILLACT_LAYERED, ANIMTYPE_FILLACTD, ANIMTYPE_FILLDRIVERS, ANIMTYPE_GPDATABLOCK, ANIMTYPE_GPLAYER, ANIMTYPE_GREASE_PENCIL_DATABLOCK, ANIMTYPE_GREASE_PENCIL_LAYER, ANIMTYPE_GREASE_PENCIL_LAYER_GROUP, ANIMTYPE_GROUP, ANIMTYPE_MASKDATABLOCK, ANIMTYPE_MASKLAYER, ANIMTYPE_NLAACTION, ANIMTYPE_NLACONTROLS, ANIMTYPE_NLACURVE, ANIMTYPE_NLATRACK, ANIMTYPE_NONE, ANIMTYPE_NUM_TYPES, ANIMTYPE_OBJECT, ANIMTYPE_PALETTE, ANIMTYPE_SCENE, ANIMTYPE_SHAPEKEY, ANIMTYPE_SPECIALDATA__UNUSED, ANIMTYPE_SUMMARY, BLI_listbase_is_empty(), bAnimListElem::data, FCURVE_ACTIVE, ListBase::first, AnimData::flag, bActionGroup::flag, bGPDlayer::flag, FCurve::flag, NlaTrack::flag, GP_LAYER_ACTIVE, bAnimListElem::next, NLATRACK_ACTIVE, and bAnimListElem::type.

Referenced by box_select_graphcurves(), click_select_channel_fcurve(), click_select_channel_gplayer(), click_select_channel_group(), drivers_editor_show_exec(), mouse_action_keys(), mouse_graph_keys(), mouse_nla_strips(), and mouse_nla_tracks().

◆ animchannel_has_active_of_type()

static bool animchannel_has_active_of_type ( bAnimContext * ac,
const eAnim_ChannelType type )
static

◆ animchannel_select_range()

◆ animchannels_box_select_exec()

◆ animchannels_channel_get()

◆ animchannels_channel_select_keys_invoke()

◆ animchannels_clean_empty_exec()

◆ animchannels_collapse_exec()

◆ animchannels_delete_exec()

static int animchannels_delete_exec ( bContext * C,
wmOperator *  )
static

Definition at line 2589 of file anim_channels_edit.cc.

References AnimData::action, action_groups_remove_channel(), ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIM_animdata_get_context(), ANIM_animdata_update(), ANIM_UPDATE_DEPS, ANIMCONT_DRIVERS, ANIMCONT_SHAPEKEY, blender::animrig::animdata_fcurve_delete(), ANIMFILTER_DATA_VISIBLE, ANIMFILTER_FOREDIT, ANIMFILTER_LIST_CHANNELS, ANIMFILTER_LIST_VISIBLE, ANIMFILTER_NODUPLIS, ANIMFILTER_SEL, ANIMTYPE_ACTION_SLOT, ANIMTYPE_ANIMDATA, ANIMTYPE_DSARM, ANIMTYPE_DSCACHEFILE, ANIMTYPE_DSCAM, ANIMTYPE_DSCUR, ANIMTYPE_DSGPENCIL, ANIMTYPE_DSHAIR, ANIMTYPE_DSLAM, ANIMTYPE_DSLAT, ANIMTYPE_DSLINESTYLE, ANIMTYPE_DSMAT, ANIMTYPE_DSMBALL, ANIMTYPE_DSMCLIP, ANIMTYPE_DSMESH, ANIMTYPE_DSNTREE, ANIMTYPE_DSPART, ANIMTYPE_DSPOINTCLOUD, ANIMTYPE_DSSKEY, ANIMTYPE_DSSPK, ANIMTYPE_DSTEX, ANIMTYPE_DSVOLUME, ANIMTYPE_DSWOR, ANIMTYPE_FCURVE, ANIMTYPE_FILLACT_LAYERED, ANIMTYPE_FILLACTD, ANIMTYPE_FILLDRIVERS, ANIMTYPE_GPDATABLOCK, ANIMTYPE_GPLAYER, ANIMTYPE_GREASE_PENCIL_DATABLOCK, ANIMTYPE_GREASE_PENCIL_LAYER, ANIMTYPE_GREASE_PENCIL_LAYER_GROUP, ANIMTYPE_GROUP, ANIMTYPE_MASKDATABLOCK, ANIMTYPE_MASKLAYER, ANIMTYPE_NLAACTION, ANIMTYPE_NLACONTROLS, ANIMTYPE_NLACURVE, ANIMTYPE_NLATRACK, ANIMTYPE_NONE, ANIMTYPE_NUM_TYPES, ANIMTYPE_OBJECT, ANIMTYPE_PALETTE, ANIMTYPE_SCENE, ANIMTYPE_SHAPEKEY, ANIMTYPE_SPECIALDATA__UNUSED, ANIMTYPE_SUMMARY, BKE_fcurve_free(), BKE_gpencil_free_data(), BKE_gpencil_layer_delete(), BKE_id_free_us(), BKE_mask_layer_remove(), BLI_assert, BLI_assert_msg, BLI_assert_unreachable, BLI_freelinkN(), BLI_remlink(), bActionGroup::channel_bag, bActionGroup::channels, CTX_data_main(), CTX_data_scene(), bAnimContext::data, bAnimContext::datatype, DEG_id_tag_update(), DEG_id_tag_update_ex(), DEG_relations_tag_update(), blender::animrig::ChannelBag::fcurve(), bActionGroup::fcurve_range_length, bActionGroup::fcurve_range_start, blender::animrig::ChannelBag::fcurve_remove(), NlaStrip::fcurves, filter(), ListBase::first, bGPdata::flag, NlaStrip::flag, GP_DATA_ANNOTATIONS, bAction::groups, FCurve::grp, GS, bAction::id, bGPdata::id, GreasePencil::id, Mask::id, ID_AC, ID_RECALC_ANIMATION, ID_RECALC_GEOMETRY, blender::animrig::Action::is_action_layered(), bGPdata::layers, LISTBASE_FOREACH, NA_EDITED, NA_REMOVED, NC_ANIMATION, ND_ANIMCHAN, ND_KEYFRAME, FCurve::next, OPERATOR_CANCELLED, OPERATOR_FINISHED, printf, FCurve::rna_path, blender::animrig::Action::slot_remove(), STREQ, tag_update_animation_element(), WM_event_add_notifier(), and wrap().

Referenced by ANIM_OT_channels_delete().

◆ animchannels_enable_exec()

◆ animchannels_enable_poll()

static bool animchannels_enable_poll ( bContext * C)
static

◆ animchannels_expand_exec()

◆ animchannels_group_channels()

◆ animchannels_group_exec()

◆ animchannels_grouping_poll()

◆ animchannels_mouseclick_invoke()

◆ animchannels_rearrange_exec()

◆ animchannels_rename_invoke()

◆ animchannels_select_filter_invoke()

◆ animchannels_select_filter_modal()

◆ animchannels_select_filter_poll()

static bool animchannels_select_filter_poll ( bContext * C)
static

Definition at line 3447 of file anim_channels_edit.cc.

References CTX_wm_area(), ELEM, SPACE_ACTION, SPACE_GRAPH, and SPACE_NLA.

Referenced by ANIM_OT_channels_select_filter().

◆ animchannels_selectall_exec()

◆ animchannels_setflag_exec()

◆ animchannels_ungroup_exec()

◆ animedit_poll_channels_active()

◆ animedit_poll_channels_nla_tweakmode_off()

◆ box_select_anim_channels()

static void box_select_anim_channels ( bAnimContext * ac,
const rcti & rect,
short selectmode )
static

Definition at line 3582 of file anim_channels_edit.cc.

References ACHANNEL_SET_FLAG, ACHANNEL_SETTING_SELECT, ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIM_channel_setting_set(), ANIM_UI_get_channel_step(), ANIM_UI_get_first_channel_top(), ANIMCONT_NLA, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_LIST_CHANNELS, ANIMFILTER_LIST_VISIBLE, ANIMTYPE_ACTION_SLOT, ANIMTYPE_ANIMDATA, ANIMTYPE_DSARM, ANIMTYPE_DSCACHEFILE, ANIMTYPE_DSCAM, ANIMTYPE_DSCUR, ANIMTYPE_DSGPENCIL, ANIMTYPE_DSHAIR, ANIMTYPE_DSLAM, ANIMTYPE_DSLAT, ANIMTYPE_DSLINESTYLE, ANIMTYPE_DSMAT, ANIMTYPE_DSMBALL, ANIMTYPE_DSMCLIP, ANIMTYPE_DSMESH, ANIMTYPE_DSNTREE, ANIMTYPE_DSPART, ANIMTYPE_DSPOINTCLOUD, ANIMTYPE_DSSKEY, ANIMTYPE_DSSPK, ANIMTYPE_DSTEX, ANIMTYPE_DSVOLUME, ANIMTYPE_DSWOR, ANIMTYPE_FCURVE, ANIMTYPE_FILLACT_LAYERED, ANIMTYPE_FILLACTD, ANIMTYPE_FILLDRIVERS, ANIMTYPE_GPDATABLOCK, ANIMTYPE_GPLAYER, ANIMTYPE_GREASE_PENCIL_DATABLOCK, ANIMTYPE_GREASE_PENCIL_LAYER, ANIMTYPE_GREASE_PENCIL_LAYER_GROUP, ANIMTYPE_GROUP, ANIMTYPE_MASKDATABLOCK, ANIMTYPE_MASKLAYER, ANIMTYPE_NLAACTION, ANIMTYPE_NLACONTROLS, ANIMTYPE_NLACURVE, ANIMTYPE_NLATRACK, ANIMTYPE_NONE, ANIMTYPE_NUM_TYPES, ANIMTYPE_OBJECT, ANIMTYPE_PALETTE, ANIMTYPE_SCENE, ANIMTYPE_SHAPEKEY, ANIMTYPE_SPECIALDATA__UNUSED, ANIMTYPE_SUMMARY, bAnimContext::data, bAnimContext::datatype, filter(), bActionGroup::flag, LISTBASE_FOREACH, NLATRACK_FIRST_TOP, NLATRACK_SELECTED, NLATRACK_STEP, bAnimContext::region, select_pchan_for_action_group(), bAnimContext::sl, templated_selection_state_update(), UI_view2d_region_to_view(), ARegion::v2d, rctf::xmax, rcti::xmax, rctf::xmin, rcti::xmin, rctf::ymax, rcti::ymax, rctf::ymin, and rcti::ymin.

Referenced by animchannels_box_select_exec().

◆ calculate_fcurve_bounds_and_unhide()

◆ calculate_selection_fcurve_bounds()

◆ channel_view_poll()

static bool channel_view_poll ( bContext * C)
static

◆ channels_bake_exec()

◆ click_select_channel_action_slot()

◆ click_select_channel_dummy()

◆ click_select_channel_fcurve()

◆ click_select_channel_gpdatablock()

static int click_select_channel_gpdatablock ( bAnimListElem * ale)
static

◆ click_select_channel_gplayer()

◆ click_select_channel_grease_pencil_datablock()

static int click_select_channel_grease_pencil_datablock ( bAnimListElem * ale)
static

◆ click_select_channel_grease_pencil_layer()

◆ click_select_channel_grease_pencil_layer_group()

static int click_select_channel_grease_pencil_layer_group ( bAnimListElem * ale)
static

◆ click_select_channel_group()

◆ click_select_channel_maskdatablock()

static int click_select_channel_maskdatablock ( bAnimListElem * ale)
static

Definition at line 4451 of file anim_channels_edit.cc.

References bAnimListElem::data, MASK_ANIMF_EXPAND, NA_EDITED, and ND_ANIMCHAN.

Referenced by mouse_anim_channels().

◆ click_select_channel_masklayer()

static int click_select_channel_masklayer ( bAnimContext * ac,
bAnimListElem * ale,
const short selectmode )
static

◆ click_select_channel_nlacontrols()

static int click_select_channel_nlacontrols ( bAnimListElem * ale)
static

◆ click_select_channel_object()

◆ click_select_channel_scene()

static int click_select_channel_scene ( bAnimListElem * ale,
const short selectmode )
static

◆ click_select_channel_shapekey()

static int click_select_channel_shapekey ( bAnimContext * ac,
bAnimListElem * ale,
const short selectmode )
static

◆ context_find_graph_editor()

static bool context_find_graph_editor ( bContext * C,
wmWindow ** r_win,
ScrArea ** r_area,
ARegion ** r_region )
static

Find a Graph Editor area and set the context arguments accordingly.

Definition at line 5367 of file anim_channels_edit.cc.

References BKE_area_find_region_type(), CTX_wm_manager(), LISTBASE_FOREACH, RGN_TYPE_WINDOW, SPACE_GRAPH, and WM_window_get_active_screen().

Referenced by view_curve_in_graph_editor_exec().

◆ count_fcurves_hidden_by_filter()

◆ deselect_all_fcurves()

◆ ED_keymap_animchannels()

void ED_keymap_animchannels ( wmKeyConfig * keyconf)

Definition at line 5752 of file anim_channels_edit.cc.

References RGN_TYPE_WINDOW, SPACE_EMPTY, and WM_keymap_ensure().

Referenced by ED_spacetypes_keymap().

◆ ED_operatortypes_animchannels()

◆ get_channel_bounds()

◆ get_fcurves_of_property()

◆ get_gpencil_bounds()

static bool get_gpencil_bounds ( bGPDlayer * gpl,
const float range[2],
rctf * r_bounds )
static

◆ get_grease_pencil_layer_bounds()

static bool get_grease_pencil_layer_bounds ( const GreasePencilLayer * gplayer,
const float range[2],
rctf * r_bounds )
static

Definition at line 138 of file anim_channels_edit.cc.

References rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by get_channel_bounds().

◆ get_normalized_fcurve_bounds()

static bool get_normalized_fcurve_bounds ( FCurve * fcu,
AnimData * anim_data,
SpaceLink * space_link,
Scene * scene,
ID * id,
const bool include_handles,
const float range[2],
rctf * r_bounds )
static

◆ get_view_range()

static void get_view_range ( Scene * scene,
const bool use_preview_range,
float r_range[2] )
static

◆ graphkeys_channel_view_pick_invoke()

◆ graphkeys_view_selected_channels_exec()

◆ join_groups_action_temp()

static void join_groups_action_temp ( bAction * act)
static

◆ mouse_anim_channels()

static int mouse_anim_channels ( bContext * C,
bAnimContext * ac,
const int channel_index,
short selectmode )
static

Definition at line 4484 of file anim_channels_edit.cc.

References ANIM_animdata_filter(), ANIM_animdata_freelist(), animchannel_has_active_of_type(), ANIMFILTER_DATA_VISIBLE, ANIMFILTER_FCURVESONLY, ANIMFILTER_LIST_CHANNELS, ANIMFILTER_LIST_VISIBLE, ANIMTYPE_ACTION_SLOT, ANIMTYPE_DSARM, ANIMTYPE_DSCACHEFILE, ANIMTYPE_DSCAM, ANIMTYPE_DSCUR, ANIMTYPE_DSGPENCIL, ANIMTYPE_DSHAIR, ANIMTYPE_DSLAM, ANIMTYPE_DSLAT, ANIMTYPE_DSLINESTYLE, ANIMTYPE_DSMAT, ANIMTYPE_DSMBALL, ANIMTYPE_DSMCLIP, ANIMTYPE_DSMESH, ANIMTYPE_DSNTREE, ANIMTYPE_DSPART, ANIMTYPE_DSPOINTCLOUD, ANIMTYPE_DSSKEY, ANIMTYPE_DSSPK, ANIMTYPE_DSTEX, ANIMTYPE_DSVOLUME, ANIMTYPE_DSWOR, ANIMTYPE_FCURVE, ANIMTYPE_FILLACT_LAYERED, ANIMTYPE_FILLACTD, ANIMTYPE_GPDATABLOCK, ANIMTYPE_GPLAYER, ANIMTYPE_GREASE_PENCIL_DATABLOCK, ANIMTYPE_GREASE_PENCIL_LAYER, ANIMTYPE_GREASE_PENCIL_LAYER_GROUP, ANIMTYPE_GROUP, ANIMTYPE_MASKDATABLOCK, ANIMTYPE_MASKLAYER, ANIMTYPE_NLACONTROLS, ANIMTYPE_NLACURVE, ANIMTYPE_OBJECT, ANIMTYPE_SCENE, ANIMTYPE_SHAPEKEY, BLI_findlink(), click_select_channel_action_slot(), click_select_channel_dummy(), click_select_channel_fcurve(), click_select_channel_gpdatablock(), click_select_channel_gplayer(), click_select_channel_grease_pencil_datablock(), click_select_channel_grease_pencil_layer(), click_select_channel_grease_pencil_layer_group(), click_select_channel_group(), click_select_channel_maskdatablock(), click_select_channel_masklayer(), click_select_channel_nlacontrols(), click_select_channel_object(), click_select_channel_scene(), click_select_channel_shapekey(), CTX_wm_area(), bAnimContext::data, bAnimContext::datatype, ELEM, filter(), G, G_DEBUG, printf, SELECT_EXTEND_RANGE, SELECT_INVERT, SPACE_GRAPH, SPACE_NLA, and bAnimListElem::type.

Referenced by animchannels_mouseclick_invoke().

◆ rearrange_action_channels()

◆ rearrange_animchannel_add_to_islands()

◆ rearrange_animchannel_flatten_islands()

static void rearrange_animchannel_flatten_islands ( ListBase * islands,
ListBase * srcList )
static

◆ rearrange_animchannel_islands()

◆ rearrange_animchannels_filter_visible()

◆ rearrange_driver_channels()

◆ rearrange_get_mode_func()

◆ rearrange_gpencil_channels()

◆ rearrange_gpencil_get_mode_func()

◆ rearrange_grease_pencil_channels()

◆ rearrange_island_bottom()

◆ rearrange_island_down()

◆ rearrange_island_ok()

◆ rearrange_island_top()

static bool rearrange_island_top ( ListBase * list,
tReorderChannelIsland * island )
static

◆ rearrange_island_up()

◆ rearrange_layered_action_channel_groups()

static void rearrange_layered_action_channel_groups ( bAnimContext * ac,
const eRearrangeAnimChan_Mode mode )
static

Move selected, visible channel groups in the channel list according to mode.

NOTE: the current implementation has quadratic performance with respect to the number of groups in a ChannelBag, due to both Span::first_index_try() and ChannelBag::channel_group_move() having linear performance. If this becomes a performance bottleneck in practice, we can create a dedicated method on ChannelBag for collectively moving a non-contiguous set of channel groups that works in linear time.

TODO: there's a fair amount of apparent repetition in this code and the code in rearrange_layered_action_fcurves(). In the time available when writing this, I (Nathan) wasn't able to figure out a satisfactory way to DRY that which didn't make the code significantly harder to follow. I suspect there is a good way to DRY this, and therefore this is probably worth revisiting when we have more time.

Definition at line 1705 of file anim_channels_edit.cc.

References ANIMTYPE_GROUP, BLI_assert, BLI_freelistN(), blender::animrig::ChannelBag::channel_group(), blender::animrig::ChannelBag::channel_group_move(), blender::animrig::ChannelBag::channel_groups(), LISTBASE_FOREACH, LISTBASE_FOREACH_BACKWARD, REARRANGE_ANIMCHAN_BOTTOM, REARRANGE_ANIMCHAN_DOWN, REARRANGE_ANIMCHAN_TOP, REARRANGE_ANIMCHAN_UP, rearrange_animchannels_filter_visible(), and SEL_AGRP.

Referenced by rearrange_action_channels().

◆ rearrange_layered_action_fcurves()

static void rearrange_layered_action_fcurves ( bAnimContext * ac,
blender::animrig::Action & action,
const eRearrangeAnimChan_Mode mode )
static

Move selected, visible fcurves in the channel list according to mode.

NOTE: the current implementation has quadratic performance with respect to the number of fcurves in a ChannelBag, due to both Span::first_index_try() and ChannelBag::fcurve_move() having linear performance. If this becomes a performance bottleneck in practice, we can create a dedicated method on ChannelBag for collectively moving a non-contiguous set of fcurves that works in linear time.

TODO: there's a fair amount of apparent repetition in this code and the code in rearrange_layered_action_channel_groups(). In the time available when writing this, I (Nathan) wasn't able to figure out a satisfactory way to DRY that which didn't make the code significantly harder to follow. I suspect there is a good way to DRY this, and therefore this is probably worth revisiting when we have more time.

Definition at line 1815 of file anim_channels_edit.cc.

References ANIMTYPE_FCURVE, BLI_assert, bActionGroup::channel_bag, blender::animrig::ChannelBag::channel_groups(), blender::animrig::ChannelBag::fcurve(), blender::animrig::ChannelBag::fcurve_move(), bActionGroup::fcurve_range_length, bActionGroup::fcurve_range_start, blender::animrig::ChannelBag::fcurves(), FCurve::grp, LISTBASE_FOREACH, LISTBASE_FOREACH_BACKWARD, REARRANGE_ANIMCHAN_BOTTOM, REARRANGE_ANIMCHAN_DOWN, REARRANGE_ANIMCHAN_TOP, REARRANGE_ANIMCHAN_UP, rearrange_animchannels_filter_visible(), SEL_AGRP, and SEL_FCU.

Referenced by rearrange_action_channels().

◆ rearrange_nla_control_channels()

◆ rearrange_nla_tracks()

◆ rename_anim_channels()

◆ select_anim_channel_keys()

◆ select_pchan_for_action_group()

◆ setflag_anim_channels()

◆ split_groups_action_temp()

◆ tag_update_animation_element()

static void tag_update_animation_element ( bAnimListElem * ale)
static

◆ templated_selection_state_update()

template<typename T >
static void templated_selection_state_update ( T & selectable_thing,
const eAnimChannels_SetFlag selectmode )
static

Update the selection state of selectable_thing based on selectmode.

This is basically the C++ variant of the macro ACHANNEL_SET_FLAG(thing, sel, selection_flag), except that this function doesn't require that the selectable thing has a member variable flag. Instead, it requires that it has two functions to query & set its selection state.

Parameters
selectable_thingsomething with functions set_selected(bool) and bool is_selected().
selectmodethe selection operation to perform.

Definition at line 648 of file anim_channels_edit.cc.

References ACHANNEL_SETFLAG_ADD, ACHANNEL_SETFLAG_CLEAR, ACHANNEL_SETFLAG_EXTEND_RANGE, ACHANNEL_SETFLAG_INVERT, and ACHANNEL_SETFLAG_TOGGLE.

Referenced by anim_channels_select_set(), and box_select_anim_channels().

◆ view_curve_in_graph_editor_exec()

Variable Documentation

◆ channel_bake_key_options

const EnumPropertyItem channel_bake_key_options[]
static
Initial value:
= {
{BEZT_IPO_BEZ, "BEZIER", 0, "Bézier", "New keys will be Bézier"},
{BEZT_IPO_LIN, "LIN", 0, "Linear", "New keys will be linear"},
{BEZT_IPO_CONST, "CONST", 0, "Constant", "New keys will be constant"},
{0, nullptr, 0, nullptr, nullptr},
}
@ BEZT_IPO_CONST
@ BEZT_IPO_BEZ
@ BEZT_IPO_LIN

Definition at line 5033 of file anim_channels_edit.cc.

Referenced by ANIM_OT_channels_bake().

◆ prop_animchannel_rearrange_types

const EnumPropertyItem prop_animchannel_rearrange_types[]
static
Initial value:
= {
{REARRANGE_ANIMCHAN_TOP, "TOP", 0, "To Top", ""},
{REARRANGE_ANIMCHAN_UP, "UP", 0, "Up", ""},
{REARRANGE_ANIMCHAN_DOWN, "DOWN", 0, "Down", ""},
{REARRANGE_ANIMCHAN_BOTTOM, "BOTTOM", 0, "To Bottom", ""},
{0, nullptr, 0, nullptr, nullptr},
}
@ REARRANGE_ANIMCHAN_DOWN
@ REARRANGE_ANIMCHAN_UP
@ REARRANGE_ANIMCHAN_BOTTOM
@ REARRANGE_ANIMCHAN_TOP

Definition at line 1117 of file anim_channels_edit.cc.

Referenced by ANIM_OT_channels_move().

◆ prop_animchannel_setflag_types

const EnumPropertyItem prop_animchannel_setflag_types[]
static
Initial value:
= {
{ACHANNEL_SETFLAG_TOGGLE, "TOGGLE", 0, "Toggle", ""},
{ACHANNEL_SETFLAG_CLEAR, "DISABLE", 0, "Disable", ""},
{ACHANNEL_SETFLAG_ADD, "ENABLE", 0, "Enable", ""},
{ACHANNEL_SETFLAG_INVERT, "INVERT", 0, "Invert", ""},
{0, nullptr, 0, nullptr, nullptr},
}
@ ACHANNEL_SETFLAG_TOGGLE
@ ACHANNEL_SETFLAG_ADD
@ ACHANNEL_SETFLAG_INVERT
@ ACHANNEL_SETFLAG_CLEAR

Definition at line 2904 of file anim_channels_edit.cc.

Referenced by ANIM_OT_channels_editable_toggle(), ANIM_OT_channels_setting_disable(), ANIM_OT_channels_setting_enable(), and ANIM_OT_channels_setting_toggle().

◆ prop_animchannel_settings_types

const EnumPropertyItem prop_animchannel_settings_types[]
static
Initial value:
= {
{ACHANNEL_SETTING_PROTECT, "PROTECT", 0, "Protect", ""},
{ACHANNEL_SETTING_MUTE, "MUTE", 0, "Mute", ""},
{0, nullptr, 0, nullptr, nullptr},
}
@ ACHANNEL_SETTING_MUTE
@ ACHANNEL_SETTING_PROTECT

Definition at line 2914 of file anim_channels_edit.cc.

Referenced by ANIM_OT_channels_editable_toggle(), ANIM_OT_channels_setting_disable(), ANIM_OT_channels_setting_enable(), and ANIM_OT_channels_setting_toggle().