Blender V4.3
anim_filter.cc File Reference
#include <cstring>
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_brush_types.h"
#include "DNA_cachefile_types.h"
#include "DNA_camera_types.h"
#include "DNA_curves_types.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_grease_pencil_types.h"
#include "DNA_key_types.h"
#include "DNA_lattice_types.h"
#include "DNA_layer_types.h"
#include "DNA_light_types.h"
#include "DNA_linestyle_types.h"
#include "DNA_mask_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
#include "DNA_movieclip_types.h"
#include "DNA_node_types.h"
#include "DNA_object_force_types.h"
#include "DNA_object_types.h"
#include "DNA_particle_types.h"
#include "DNA_pointcloud_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_sequence_types.h"
#include "DNA_space_types.h"
#include "DNA_speaker_types.h"
#include "DNA_userdef_types.h"
#include "DNA_volume_types.h"
#include "DNA_world_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_alloca.h"
#include "BLI_ghash.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_action.hh"
#include "BKE_anim_data.hh"
#include "BKE_collection.hh"
#include "BKE_context.hh"
#include "BKE_fcurve.hh"
#include "BKE_fcurve_driver.h"
#include "BKE_global.hh"
#include "BKE_grease_pencil.hh"
#include "BKE_key.hh"
#include "BKE_layer.hh"
#include "BKE_main.hh"
#include "BKE_mask.h"
#include "BKE_material.h"
#include "BKE_modifier.hh"
#include "BKE_node.hh"
#include "ED_anim_api.hh"
#include "ED_markers.hh"
#include "SEQ_sequencer.hh"
#include "SEQ_utils.hh"
#include "ANIM_action.hh"
#include "ANIM_bone_collections.hh"
#include "anim_intern.hh"

Go to the source code of this file.

Classes

struct  tAnimFilterModifiersContext
 

Macros

#define BEGIN_ANIMFILTER_SUBCHANNELS(expanded_check)
 
#define END_ANIMFILTER_SUBCHANNELS
 
#define ANIMDATA_HAS_ACTION_LEGACY(id)    ((id)->adt && (id)->adt->action && (id)->adt->action->wrap().is_action_legacy())
 
#define ANIMDATA_HAS_ACTION_LAYERED(id)   false
 
#define ANIMDATA_HAS_DRIVERS(id)   ((id)->adt && (id)->adt->drivers.first)
 
#define ANIMDATA_HAS_NLA(id)
 
#define ANIMDATA_FILTER_CASES(id, adtOk, nlaOk, driversOk, nlaKeysOk, legacyActionOk, layeredActionOk)
 
#define ANIMCHANNEL_NEW_CHANNEL_FULL(bmain, channel_data, channel_type, owner_id, fcurve_owner_id, ale_statement)
 
#define ANIMCHANNEL_NEW_CHANNEL(bmain, channel_data, channel_type, owner_id, fcurve_owner_id)    ANIMCHANNEL_NEW_CHANNEL_FULL(bmain, channel_data, channel_type, owner_id, fcurve_owner_id, {})
 
#define ANIMCHANNEL_ACTIVEOK(ale)    (!(filter_mode & ANIMFILTER_ACTIVE) || !(ale->adt) || (ale->adt->flag & ADT_UI_ACTIVE))
 
#define ANIMCHANNEL_SELOK(test_func)
 
#define ANIMCHANNEL_SELEDITOK(test_func)    (!(filter_mode & ANIMFILTER_SELEDIT) || !(filter_mode & ANIMFILTER_FOREDIT) || (test_func))
 

Functions

static Keyactedit_get_shapekeys (bAnimContext *ac)
 
static bool actedit_get_context (bAnimContext *ac, SpaceAction *saction)
 
static bool graphedit_get_context (bAnimContext *ac, SpaceGraph *sipo)
 
static bool nlaedit_get_context (bAnimContext *ac, SpaceNla *snla)
 
bool ANIM_animdata_context_getdata (bAnimContext *ac)
 
bool ANIM_animdata_get_context (const bContext *C, bAnimContext *ac)
 
bool ANIM_animdata_can_have_greasepencil (const eAnimCont_Types type)
 
static void key_data_from_adt (bAnimListElem &ale, AnimData *adt)
 
static bAnimListElemmake_new_animlistelem (Main *bmain, void *data, const eAnim_ChannelType datatype, ID *owner_id, ID *fcurve_owner_id)
 
static bool skip_fcurve_selected_data (bAnimContext *ac, FCurve *fcu, ID *owner_id, const eAnimFilter_Flags filter_mode)
 
static bool name_matches_dopesheet_filter (const bDopeSheet *ads, const char *name)
 
static bool skip_fcurve_with_name (bAnimContext *ac, FCurve *fcu, eAnim_ChannelType channel_type, void *owner, ID *owner_id)
 
static bool ale_name_matches_dopesheet_filter (const bDopeSheet &ads, bAnimListElem &ale)
 
static bool fcurve_has_errors (bAnimContext *ac, const FCurve *fcu)
 
static FCurveanimfilter_fcurve_next (bAnimContext *ac, FCurve *first, eAnim_ChannelType channel_type, const eAnimFilter_Flags filter_mode, void *owner, ID *owner_id)
 
static size_t animfilter_fcurves (bAnimContext *ac, ListBase *anim_data, FCurve *first, eAnim_ChannelType fcurve_type, const eAnimFilter_Flags filter_mode, void *owner, ID *owner_id, ID *fcurve_owner_id)
 
static bool fcurve_span_selection_matters (const eAnimFilter_Flags filter_mode)
 
static bool fcurve_span_must_be_selected (const eAnimFilter_Flags filter_mode)
 
static size_t animfilter_fcurves_span (bAnimContext *ac, ListBase *anim_data, Span< FCurve * > fcurves, const animrig::slot_handle_t slot_handle, const eAnimFilter_Flags filter_mode, ID *animated_id, ID *fcurve_owner_id)
 
static size_t animfilter_act_group (bAnimContext *ac, ListBase *anim_data, bAction *act, animrig::slot_handle_t slot_handle, bActionGroup *agrp, eAnimFilter_Flags filter_mode, ID *owner_id)
 
static size_t animfilter_action_slot (bAnimContext *ac, ListBase *anim_data, animrig::Action &action, animrig::Slot &slot, const eAnimFilter_Flags filter_mode, ID *animated_id)
 
static size_t animfilter_action_slots (bAnimContext *ac, ListBase *anim_data, animrig::Action &action, const eAnimFilter_Flags filter_mode, ID *owner_id)
 
static size_t animfilter_action (bAnimContext *ac, ListBase *anim_data, animrig::Action &action, const animrig::slot_handle_t slot_handle, const eAnimFilter_Flags filter_mode, ID *owner_id)
 
static size_t animfilter_nla (bAnimContext *ac, ListBase *anim_data, AnimData *adt, const eAnimFilter_Flags filter_mode, ID *owner_id)
 
static size_t animfilter_nla_controls (bAnimContext *ac, ListBase *anim_data, AnimData *adt, eAnimFilter_Flags filter_mode, ID *owner_id)
 
static size_t animfilter_block_data (bAnimContext *ac, ListBase *anim_data, ID *id, const eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_shapekey (bAnimContext *ac, ListBase *anim_data, Key *key, const eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_grease_pencil_layer (bAnimContext *ac, ListBase *anim_data, GreasePencil *grease_pencil, blender::bke::greasepencil::Layer &layer, const eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_grease_pencil_layer_node_recursive (bAnimContext *ac, ListBase *anim_data, GreasePencil *grease_pencil, blender::bke::greasepencil::TreeNode &node, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_grease_pencil_layers_data (bAnimContext *ac, ListBase *anim_data, GreasePencil *grease_pencil, const eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_gpencil_layers_data_legacy (bAnimContext *ac, ListBase *anim_data, bGPdata *gpd, const eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_grease_pencil_data (bAnimContext *ac, ListBase *anim_data, GreasePencil *grease_pencil, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_grease_pencil (bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_gpencil (bAnimContext *ac, ListBase *anim_data, bGPdata *gpd, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_cachefile (bAnimContext *ac, ListBase *anim_data, CacheFile *cache_file, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_mask_data (bAnimContext *ac, ListBase *anim_data, Mask *mask, const eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_mask (bAnimContext *ac, ListBase *anim_data, void *, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_nodetree_group (bAnimContext *ac, ListBase *anim_data, ID *owner_id, bNodeTree *ntree, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_nodetree (bAnimContext *ac, ListBase *anim_data, ID *owner_id, bNodeTree *ntree, const eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_linestyle (bAnimContext *ac, ListBase *anim_data, Scene *sce, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_texture (bAnimContext *ac, ListBase *anim_data, Tex *tex, ID *owner_id, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_textures (bAnimContext *ac, ListBase *anim_data, ID *owner_id, const eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_material (bAnimContext *ac, ListBase *anim_data, Material *ma, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_materials (bAnimContext *ac, ListBase *anim_data, Object *ob, const eAnimFilter_Flags filter_mode)
 
static void animfilter_modifier_idpoin_cb (void *afm_ptr, Object *ob, ID **idpoin, int)
 
static size_t animdata_filter_ds_modifiers (bAnimContext *ac, ListBase *anim_data, Object *ob, const eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_particles (bAnimContext *ac, ListBase *anim_data, Object *ob, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_obdata (bAnimContext *ac, ListBase *anim_data, Object *ob, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_keyanim (bAnimContext *ac, ListBase *anim_data, Object *ob, Key *key, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_obanim (bAnimContext *ac, ListBase *anim_data, Object *ob, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_dopesheet_ob (bAnimContext *ac, ListBase *anim_data, Base *base, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_world (bAnimContext *ac, ListBase *anim_data, Scene *sce, World *wo, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_scene (bAnimContext *ac, ListBase *anim_data, Scene *sce, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_dopesheet_scene (bAnimContext *ac, ListBase *anim_data, Scene *sce, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_ds_movieclip (bAnimContext *ac, ListBase *anim_data, MovieClip *clip, eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_dopesheet_movieclips (bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode)
 
static bool animdata_filter_base_is_ok (bAnimContext *ac, Base *base, const eObjectMode object_mode, const eAnimFilter_Flags filter_mode)
 
static int ds_base_sorting_cmp (const void *base1_ptr, const void *base2_ptr)
 
static Base ** animdata_filter_ds_sorted_bases (bAnimContext *ac, const Scene *scene, ViewLayer *view_layer, const eAnimFilter_Flags filter_mode, size_t *r_usable_bases)
 
static size_t animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data, eAnimFilter_Flags filter_mode)
 
static short animdata_filter_dopesheet_summary (bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode, size_t *items)
 
static size_t animdata_filter_animchan (bAnimContext *ac, ListBase *anim_data, bAnimListElem *channel, const eAnimFilter_Flags filter_mode)
 
static size_t animdata_filter_remove_invalid (ListBase *anim_data)
 
static size_t animdata_filter_remove_duplis (ListBase *anim_data)
 
size_t ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
 

Macro Definition Documentation

◆ ANIMCHANNEL_ACTIVEOK

◆ ANIMCHANNEL_NEW_CHANNEL

◆ ANIMCHANNEL_NEW_CHANNEL_FULL

#define ANIMCHANNEL_NEW_CHANNEL_FULL ( bmain,
channel_data,
channel_type,
owner_id,
fcurve_owner_id,
ale_statement )
Value:
if (filter_mode & ANIMFILTER_TMP_PEEK) { \
return 1; \
} \
{ \
bmain, channel_data, channel_type, (ID *)owner_id, fcurve_owner_id); \
if (ale) { \
BLI_addtail(anim_data, ale); \
items++; \
ale_statement \
} \
} \
(void)0
@ ANIMFILTER_TMP_PEEK
static bAnimListElem * make_new_animlistelem(Main *bmain, void *data, const eAnim_ChannelType datatype, ID *owner_id, ID *fcurve_owner_id)
Definition DNA_ID.h:413

Add a new animation channel, taking into account the "peek" flag, which is used to just check whether any channels will be added (but without needing them to actually get created).

Warning
This causes the calling function to return early if we're only "peeking" for channels.

Definition at line 547 of file anim_filter.cc.

Referenced by animfilter_act_group(), animfilter_fcurves(), and animfilter_nla().

◆ ANIMCHANNEL_SELEDITOK

#define ANIMCHANNEL_SELEDITOK ( test_func)     (!(filter_mode & ANIMFILTER_SELEDIT) || !(filter_mode & ANIMFILTER_FOREDIT) || (test_func))

Quick macro to test if an anim-channel (F-Curve) is selected ok for editing purposes

  • *_SELEDIT means that only selected curves will have visible+editable key-frames.

checks here work as follows: 1) SELEDIT off - don't need to consider the implications of this option. 2) FOREDIT off - we're not considering editing, so channel is ok still. 3) test_func (i.e. selection test) - only if selected, this test will pass.

Definition at line 588 of file anim_filter.cc.

Referenced by animfilter_fcurve_next().

◆ ANIMCHANNEL_SELOK

◆ ANIMDATA_FILTER_CASES

#define ANIMDATA_FILTER_CASES ( id,
adtOk,
nlaOk,
driversOk,
nlaKeysOk,
legacyActionOk,
layeredActionOk )

Quick macro to test for all three above usability tests, performing the appropriate provided action for each when the AnimData context is appropriate.

Priority order for this goes (most important, to least): AnimData blocks, NLA, Drivers, Keyframes.

For this to work correctly, a standard set of data needs to be available within the scope that this

Gets called in:

  • ListBase anim_data;
  • bDopeSheet *ads;
  • bAnimListElem *ale;
  • size_t items;
  • id: ID block which should have an AnimData pointer following it immediately, to use
  • adtOk: line or block of code to execute for AnimData-blocks case (usually #ANIMDATA_ADD_ANIMDATA).
  • nlaOk: line or block of code to execute for NLA tracks+strips case
  • driversOk: line or block of code to execute for Drivers case
  • nlaKeysOk: line or block of code for NLA Strip Keyframes case
  • legacyActionOk: line or block of code for Keyframes from legacy Actions
  • layeredActionOk: line or block of code for Keyframes from layered Actions

The checks for the various cases are as follows: 0) top level: checks for animdata and also that all the F-Curves for the block will be visible 1) animdata check: for filtering animdata blocks only 2A) nla tracks: include animdata block's data as there are NLA tracks+strips there 2B) actions to convert to nla: include animdata block's data as there is an action that can be converted to a new NLA strip, and the filtering options allow this 2C) allow non-animated data-blocks to be included so that data-blocks can be added 3) drivers: include drivers from animdata block (for Drivers mode in Graph Editor) 4A) nla strip keyframes: these are the per-strip controls for time and influence 4B) normal keyframes: only when there is an active action 4C) normal keyframes: only when there is an Animation assigned

Definition at line 500 of file anim_filter.cc.

Referenced by animdata_filter_ds_obanim(), animdata_filter_ds_scene(), and animfilter_block_data().

◆ ANIMDATA_HAS_ACTION_LAYERED

#define ANIMDATA_HAS_ACTION_LAYERED ( id)    false

Definition at line 452 of file anim_filter.cc.

◆ ANIMDATA_HAS_ACTION_LEGACY

#define ANIMDATA_HAS_ACTION_LEGACY ( id)     ((id)->adt && (id)->adt->action && (id)->adt->action->wrap().is_action_legacy())

Definition at line 445 of file anim_filter.cc.

◆ ANIMDATA_HAS_DRIVERS

#define ANIMDATA_HAS_DRIVERS ( id)    ((id)->adt && (id)->adt->drivers.first)

Definition at line 456 of file anim_filter.cc.

◆ ANIMDATA_HAS_NLA

#define ANIMDATA_HAS_NLA ( id)
Value:
((id)->adt && (id)->adt->nla_tracks.first && \
(!(id)->adt->action || (id)->adt->action->wrap().is_action_legacy()))

Definition at line 459 of file anim_filter.cc.

◆ BEGIN_ANIMFILTER_SUBCHANNELS

◆ END_ANIMFILTER_SUBCHANNELS

Function Documentation

◆ actedit_get_context()

◆ actedit_get_shapekeys()

◆ ale_name_matches_dopesheet_filter()

static bool ale_name_matches_dopesheet_filter ( const bDopeSheet & ads,
bAnimListElem & ale )
static

◆ ANIM_animdata_can_have_greasepencil()

bool ANIM_animdata_can_have_greasepencil ( const eAnimCont_Types type)

◆ ANIM_animdata_context_getdata()

bool ANIM_animdata_context_getdata ( bAnimContext * ac)

Obtain current anim-data context, given that context info from Blender context has already been set:

  • AnimContext to write to is provided as pointer to var on stack so that we don't have allocation/freeing costs (which are not that avoidable with channels).
    Returns
    whether the operation was successful.
    Note
    This may also update the space data. For example, SpaceAction::action is set to the currently active object's Action.

Definition at line 309 of file anim_filter.cc.

References actedit_get_context(), bAnimContext::data, graphedit_get_context(), nlaedit_get_context(), bAnimContext::sl, SPACE_ACTION, SPACE_CLIP, SPACE_CONSOLE, SPACE_EMPTY, SPACE_FILE, SPACE_GRAPH, SPACE_IMAGE, SPACE_INFO, SPACE_NLA, SPACE_NODE, SPACE_OUTLINER, SPACE_PROPERTIES, SPACE_SCRIPT, SPACE_SEQ, SPACE_SPREADSHEET, SPACE_STATUSBAR, SPACE_TEXT, SPACE_TOPBAR, SPACE_USERPREF, SPACE_VIEW3D, and bAnimContext::spacetype.

Referenced by ANIM_animdata_get_context(), recalcData_actedit(), and recalcData_graphedit().

◆ ANIM_animdata_filter()

size_t ANIM_animdata_filter ( bAnimContext * ac,
ListBase * anim_data,
eAnimFilter_Flags filter_mode,
void * data,
eAnimCont_Types datatype )

This function filters the active data source to leave only animation channels suitable for usage by the caller. It will return the length of the list

Parameters
anim_dataIs a pointer to a ListBase, to which the filtered animation channels will be placed for use.
filter_modehow should the data be filtered - bit-mapping accessed flags.

Definition at line 3882 of file anim_filter.cc.

References AnimData::action, bAnimContext::ads, SpaceAction::ads, Key::adt, Object::adt, ANIMCHANNEL_NEW_CHANNEL, ANIMCONT_ACTION, ANIMCONT_CHANNEL, ANIMCONT_DOPESHEET, ANIMCONT_DRIVERS, ANIMCONT_FCURVES, ANIMCONT_GPENCIL, ANIMCONT_MASK, ANIMCONT_NLA, ANIMCONT_NONE, ANIMCONT_SHAPEKEY, ANIMCONT_TIMELINE, animdata_filter_animchan(), animdata_filter_dopesheet(), animdata_filter_dopesheet_summary(), animdata_filter_grease_pencil(), animdata_filter_mask(), animdata_filter_remove_duplis(), animdata_filter_remove_invalid(), animdata_filter_shapekey(), animfilter_action(), ANIMFILTER_ANIMDATA, ANIMFILTER_NODUPLIS, ANIMTYPE_ANIMDATA, BLI_assert, BLI_assert_msg, bAnimContext::bmain, data, LIKELY, bAnimContext::obact, printf, bAnimContext::sl, AnimData::slot_handle, UNLIKELY, UNUSED_VARS_NDEBUG, and wrap().

Referenced by achannel_setting_flush_widget_cb(), action_channel_region_draw(), action_main_region_draw(), actkeys_channels_get_selected_extents(), actkeys_find_list_element_at_position(), actkeys_framejump_exec(), actkeys_mselect_channel_only(), actkeys_mselect_column(), actkeys_mselect_single(), actkeys_select_leftright(), actkeys_select_linked_exec(), ANIM_animdata_keyframe_callback(), anim_channels_for_selection(), ANIM_deselect_keys_in_animation_editors(), ANIM_editkeyframes_refresh(), ANIM_frame_channel_y_extents(), ANIM_set_active_channel(), ANIM_sync_animchannels_to_data(), animchannels_clean_empty_exec(), animchannels_delete_exec(), animchannels_enable_exec(), animchannels_group_channels(), animchannels_group_exec(), animchannels_rearrange_exec(), animchannels_ungroup_exec(), apply_fcu_segment_function(), bake_action_keys(), bake_graph_keys(), blend_to_default_graph_keys(), box_select_action(), box_select_anim_channels(), box_select_elem(), box_select_nla_strips(), btw_smooth_allocate_operator_data(), btw_smooth_graph_keys(), cachefile_to_keylist(), channels_bake_exec(), clean_action_keys(), clean_graph_keys(), columnselect_action_keys(), columnselect_graph_keys(), convert_keys_to_samples(), convert_samples_to_keys(), copy_action_keys(), copy_graph_keys(), count_fcurves_hidden_by_filter(), create_ghost_curves(), createTransActionData(), createTransGraphEditData(), createTransNlaData(), decimate_graph_keys(), delete_action_keys(), delete_graph_keys(), deselect_action_keys(), deselect_all_fcurves(), deselect_graph_keys(), deselect_nla_strips(), draw_nla_main_data(), duplicate_action_keys(), duplicate_graph_keys(), ease_graph_keys(), ED_gpencil_anim_copybuf_copy(), ED_gpencil_anim_copybuf_paste(), ED_nla_postop_refresh(), equalize_graph_keys(), gaussian_smooth_allocate_operator_data(), gaussian_smooth_graph_keys(), get_active_fcurve_channel(), get_graph_keyframe_extents(), get_keyframe_extents(), get_nearest_fcurve_verts_list(), get_nlastrip_extents(), graph_channel_region_draw(), graph_draw_curves(), graph_driver_delete_invalid_exec(), graph_fmodifier_add_exec(), graph_fmodifier_paste_exec(), graph_has_selected_control_points(), graph_refresh_fcurve_colors(), graphkeys_channel_view_pick_invoke(), graphkeys_euler_filter_exec(), graphkeys_mselect_column(), graphkeys_select_key_handles(), graphkeys_select_leftright(), graphkeys_select_linked_exec(), graphkeys_smooth_exec(), graphkeys_view_selected_channels_exec(), graphop_editable_keyframes_poll(), graphop_selected_fcurve_poll(), graphop_visible_keyframes_poll(), graphview_curves_hide_exec(), graphview_curves_reveal_exec(), blender::ed::greasepencil::grease_pencil_copy_keyframes(), blender::ed::greasepencil::grease_pencil_paste_keyframes(), initialize_box_select_anim_data(), insert_action_keys(), insert_graph_keys(), keyframe_jump_exec(), markers_selectkeys_between(), markers_selectkeys_between(), match_slope_graph_keys(), mirror_action_keys(), mirror_graph_keys(), mouse_anim_channels(), mouse_nla_tracks(), nla_fmodifier_add_exec(), nla_fmodifier_copy_exec(), nla_fmodifier_paste_exec(), nla_panel_context(), nla_track_region_draw(), nla_tracks_get_selected_extents(), nlaedit_add_meta_exec(), nlaedit_add_sound_exec(), nlaedit_add_tracks_empty(), nlaedit_add_tracks_existing(), nlaedit_add_transition_exec(), nlaedit_apply_scale_exec(), nlaedit_clear_scale_exec(), nlaedit_delete_exec(), nlaedit_delete_tracks_exec(), nlaedit_disable_tweakmode(), nlaedit_duplicate_exec(), nlaedit_enable_tweakmode_exec(), nlaedit_get_editable_tracks(), nlaedit_make_single_user_exec(), nlaedit_move_down_exec(), nlaedit_move_up_exec(), nlaedit_remove_meta_exec(), nlaedit_select_leftright(), nlaedit_snap_exec(), nlaedit_split_exec(), nlaedit_strip_at_region_position(), nlaedit_swap_exec(), nlaedit_sync_actlen_exec(), nlaedit_toggle_mute_exec(), nlatrack_truncate_temporary_tracks(), nlatracks_pushdown_exec(), ob_keyframes_loop(), ob_to_keylist(), paste_action_keys(), paste_graph_keys(), posttrans_action_clean(), rearrange_animchannels_filter_visible(), rearrange_gpencil_channels(), rearrange_grease_pencil_channels(), recalcData_actedit(), recalcData_graphedit(), blender::animrig::reevaluate_fcurve_errors(), region_select_action_keys(), region_select_elem(), rename_anim_channels(), reset_bezts(), scale_from_neighbor_graph_keys(), scene_keyframes_loop(), scene_to_keylist(), screen_ctx_active_editable_fcurve(), screen_ctx_sel_actions_impl(), screen_ctx_sel_edit_fcurves_(), screen_ctx_selected_editable_keyframes(), screen_ctx_selected_nla_strips(), select_anim_channel_keys(), select_moreless_action_keys(), select_moreless_graph_keys(), seteasing_graph_keys(), setexpo_action_keys(), setexpo_graph_keys(), setflag_anim_channels(), sethandles_action_keys(), sethandles_graph_keys(), setipo_graph_keys(), setkeytype_action_keys(), shear_graph_keys(), snap_action_keys(), snap_graph_keys(), special_aftertrans_update__actedit(), special_aftertrans_update__graph(), special_aftertrans_update__nla(), store_original_bezt_arrays(), sum_selected_keyframes(), summary_keyframes_loop(), summary_to_keylist(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and update_depsgraph().

◆ ANIM_animdata_get_context()

bool ANIM_animdata_get_context ( const bContext * C,
bAnimContext * ac )

Obtain current anim-data context from Blender Context info

  • AnimContext to write to is provided as pointer to var on stack so that we don't have allocation/freeing costs (which are not that avoidable with channels).
  • Clears data and sets the information from Blender Context which is useful
    Returns
    whether the operation was successful.

Definition at line 357 of file anim_filter.cc.

References ANIM_animdata_context_getdata(), bAnimContext::area, BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), bAnimContext::bmain, CTX_data_depsgraph_pointer(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_data(), bAnimContext::depsgraph, ED_context_get_markers(), bAnimContext::markers, bAnimContext::obact, bAnimContext::region, bAnimContext::regiontype, bAnimContext::scene, scene, bAnimContext::sl, bAnimContext::spacetype, and bAnimContext::view_layer.

Referenced by achannel_setting_flush_widget_cb(), action_channel_region_draw(), action_circle_select_exec(), action_header_region_draw(), action_main_region_draw(), actkeys_bake_exec(), actkeys_box_select_exec(), actkeys_box_select_invoke(), actkeys_clean_exec(), actkeys_clickselect_exec(), actkeys_columnselect_exec(), actkeys_copy_exec(), actkeys_delete_exec(), actkeys_deselectall_exec(), actkeys_duplicate_exec(), actkeys_easing_exec(), actkeys_expo_exec(), actkeys_framejump_exec(), actkeys_handletype_exec(), actkeys_insertkey_exec(), actkeys_ipo_exec(), actkeys_keytype_exec(), actkeys_lassoselect_exec(), actkeys_mirror_exec(), actkeys_paste_exec(), actkeys_previewrange_exec(), actkeys_select_leftright_exec(), actkeys_select_leftright_invoke(), actkeys_select_less_exec(), actkeys_select_linked_exec(), actkeys_select_more_exec(), actkeys_snap_exec(), actkeys_viewall(), ANIM_deselect_keys_in_animation_editors(), ANIM_sync_animchannels_to_data(), animchannels_box_select_exec(), animchannels_channel_select_keys_invoke(), animchannels_clean_empty_exec(), animchannels_collapse_exec(), animchannels_delete_exec(), animchannels_enable_exec(), animchannels_expand_exec(), animchannels_group_exec(), animchannels_mouseclick_invoke(), animchannels_rearrange_exec(), animchannels_rename_invoke(), animchannels_select_filter_modal(), animchannels_selectall_exec(), animchannels_setflag_exec(), animchannels_ungroup_exec(), blend_offset_exec(), blend_to_default_exec(), blend_to_ease_exec(), blend_to_neighbor_exec(), breakdown_exec(), btw_smooth_exec(), btw_smooth_modal_update(), channels_bake_exec(), createTransActionData(), createTransGraphEditData(), createTransNlaData(), decimate_exec(), drivers_editor_show_exec(), ease_exec(), ed_marker_select_leftright_exec(), gaussian_smooth_exec(), gaussian_smooth_modal_update(), graph_channel_region_draw(), graph_circle_select_exec(), graph_driver_delete_invalid_exec(), graph_driver_delete_invalid_poll(), graph_fmodifier_add_exec(), graph_fmodifier_copy_exec(), graph_fmodifier_paste_exec(), graph_has_selected_control_points(), graph_main_region_draw(), graph_panel_context(), graph_refresh_fcurve_colors(), graph_slider_invoke(), graphkeys_bake_exec(), graphkeys_box_select_exec(), graphkeys_box_select_invoke(), graphkeys_channel_view_pick_invoke(), graphkeys_clean_exec(), graphkeys_clear_ghostcurves_exec(), graphkeys_click_insert_exec(), graphkeys_click_insert_invoke(), graphkeys_clickselect_exec(), graphkeys_columnselect_exec(), graphkeys_copy_exec(), graphkeys_create_ghostcurves_exec(), graphkeys_delete_exec(), graphkeys_deselectall_exec(), graphkeys_duplicate_exec(), graphkeys_easing_exec(), graphkeys_equalize_handles_exec(), graphkeys_euler_filter_exec(), graphkeys_expo_exec(), graphkeys_framejump_exec(), graphkeys_handletype_exec(), graphkeys_insertkey_exec(), graphkeys_ipo_exec(), graphkeys_keys_to_samples_exec(), graphkeys_lassoselect_exec(), graphkeys_mirror_exec(), graphkeys_paste_exec(), graphkeys_previewrange_exec(), graphkeys_samples_to_keys_exec(), graphkeys_select_key_handles_exec(), graphkeys_select_leftright_exec(), graphkeys_select_leftright_invoke(), graphkeys_select_less_exec(), graphkeys_select_linked_exec(), graphkeys_select_more_exec(), graphkeys_smooth_exec(), graphkeys_snap_cursor_value_exec(), graphkeys_snap_exec(), graphkeys_sound_to_samples_invoke(), graphkeys_view_selected_channels_exec(), graphkeys_viewall(), graphop_active_fcurve_poll(), graphop_editable_keyframes_poll(), graphop_selected_fcurve_poll(), graphop_visible_keyframes_poll(), graphview_curves_hide_exec(), graphview_curves_reveal_exec(), keyframe_jump_exec(), match_slope_exec(), nla_fmodifier_add_exec(), nla_fmodifier_copy_exec(), nla_fmodifier_paste_exec(), nla_main_region_draw(), nla_panel_context(), nla_track_region_draw(), nlaedit_add_actionclip_exec(), nlaedit_add_actionclip_invoke(), nlaedit_add_meta_exec(), nlaedit_add_sound_exec(), nlaedit_add_tracks_exec(), nlaedit_add_transition_exec(), nlaedit_apply_scale_exec(), nlaedit_box_select_exec(), nlaedit_box_select_invoke(), nlaedit_clear_scale_exec(), nlaedit_clickselect_exec(), nlaedit_delete_exec(), nlaedit_delete_tracks_exec(), nlaedit_deselectall_exec(), nlaedit_disable_tweakmode_exec(), nlaedit_duplicate_exec(), nlaedit_enable_tweakmode_exec(), nlaedit_make_single_user_exec(), nlaedit_move_down_exec(), nlaedit_move_up_exec(), nlaedit_objects_add_exec(), nlaedit_previewrange_exec(), nlaedit_remove_meta_exec(), nlaedit_select_leftright_exec(), nlaedit_select_leftright_invoke(), nlaedit_snap_exec(), nlaedit_split_exec(), nlaedit_swap_exec(), nlaedit_sync_actlen_exec(), nlaedit_toggle_mute_exec(), nlaedit_viewall(), nlatracks_mouseclick_invoke(), nlatracks_pushdown_exec(), push_pull_exec(), scale_average_exec(), scale_from_neighbor_exec(), screen_animation_region_tag_redraw(), screen_ctx_active_editable_fcurve(), screen_ctx_sel_actions_impl(), screen_ctx_sel_edit_fcurves_(), screen_ctx_selected_editable_keyframes(), screen_ctx_selected_nla_strips(), shear_exec(), special_aftertrans_update__actedit(), special_aftertrans_update__graph(), special_aftertrans_update__nla(), time_offset_exec(), and view_curve_in_graph_editor_exec().

◆ animdata_filter_animchan()

◆ animdata_filter_base_is_ok()

◆ animdata_filter_dopesheet()

◆ animdata_filter_dopesheet_movieclips()

static size_t animdata_filter_dopesheet_movieclips ( bAnimContext * ac,
ListBase * anim_data,
const eAnimFilter_Flags filter_mode )
static

◆ animdata_filter_dopesheet_ob()

◆ animdata_filter_dopesheet_scene()

◆ animdata_filter_dopesheet_summary()

◆ animdata_filter_ds_cachefile()

◆ animdata_filter_ds_gpencil()

◆ animdata_filter_ds_keyanim()

◆ animdata_filter_ds_linestyle()

◆ animdata_filter_ds_material()

◆ animdata_filter_ds_materials()

static size_t animdata_filter_ds_materials ( bAnimContext * ac,
ListBase * anim_data,
Object * ob,
const eAnimFilter_Flags filter_mode )
static

◆ animdata_filter_ds_modifiers()

◆ animdata_filter_ds_movieclip()

◆ animdata_filter_ds_nodetree()

◆ animdata_filter_ds_nodetree_group()

◆ animdata_filter_ds_obanim()

◆ animdata_filter_ds_obdata()

◆ animdata_filter_ds_particles()

◆ animdata_filter_ds_scene()

◆ animdata_filter_ds_sorted_bases()

static Base ** animdata_filter_ds_sorted_bases ( bAnimContext * ac,
const Scene * scene,
ViewLayer * view_layer,
const eAnimFilter_Flags filter_mode,
size_t * r_usable_bases )
static

◆ animdata_filter_ds_texture()

◆ animdata_filter_ds_textures()

static size_t animdata_filter_ds_textures ( bAnimContext * ac,
ListBase * anim_data,
ID * owner_id,
const eAnimFilter_Flags filter_mode )
static

Definition at line 2652 of file anim_filter.cc.

References animdata_filter_ds_texture(), G, G_DEBUG, GS, ID_PA, MAX_MTEX, ID::name, printf, and tex.

Referenced by animdata_filter_ds_particles().

◆ animdata_filter_ds_world()

◆ animdata_filter_gpencil_layers_data_legacy()

◆ animdata_filter_grease_pencil()

◆ animdata_filter_grease_pencil_data()

◆ animdata_filter_grease_pencil_layer()

static size_t animdata_filter_grease_pencil_layer ( bAnimContext * ac,
ListBase * anim_data,
GreasePencil * grease_pencil,
blender::bke::greasepencil::Layer & layer,
const eAnimFilter_Flags filter_mode )
static

◆ animdata_filter_grease_pencil_layer_node_recursive()

◆ animdata_filter_grease_pencil_layers_data()

static size_t animdata_filter_grease_pencil_layers_data ( bAnimContext * ac,
ListBase * anim_data,
GreasePencil * grease_pencil,
const eAnimFilter_Flags filter_mode )
static

◆ animdata_filter_mask()

◆ animdata_filter_mask_data()

static size_t animdata_filter_mask_data ( bAnimContext * ac,
ListBase * anim_data,
Mask * mask,
const eAnimFilter_Flags filter_mode )
static

◆ animdata_filter_remove_duplis()

static size_t animdata_filter_remove_duplis ( ListBase * anim_data)
static

◆ animdata_filter_remove_invalid()

static size_t animdata_filter_remove_invalid ( ListBase * anim_data)
static

Definition at line 3829 of file anim_filter.cc.

References ANIMTYPE_NONE, BLI_freelinkN(), and LISTBASE_FOREACH_MUTABLE.

Referenced by ANIM_animdata_filter().

◆ animdata_filter_shapekey()

◆ animfilter_act_group()

◆ animfilter_action()

◆ animfilter_action_slot()

◆ animfilter_action_slots()

static size_t animfilter_action_slots ( bAnimContext * ac,
ListBase * anim_data,
animrig::Action & action,
const eAnimFilter_Flags filter_mode,
ID * owner_id )
static

◆ animfilter_block_data()

◆ animfilter_fcurve_next()

◆ animfilter_fcurves()

static size_t animfilter_fcurves ( bAnimContext * ac,
ListBase * anim_data,
FCurve * first,
eAnim_ChannelType fcurve_type,
const eAnimFilter_Flags filter_mode,
void * owner,
ID * owner_id,
ID * fcurve_owner_id )
static

◆ animfilter_fcurves_span()

static size_t animfilter_fcurves_span ( bAnimContext * ac,
ListBase * anim_data,
Span< FCurve * > fcurves,
const animrig::slot_handle_t slot_handle,
const eAnimFilter_Flags filter_mode,
ID * animated_id,
ID * fcurve_owner_id )
static

Add bAnimListElems to anim_data for each F-Curve in fcurves.

Parameters
slot_handleThe slot handle that these F-Curves animate. This is used later to look up the ID* of the user of the slot, which in turn is used to construct a suitable F-Curve label for in the channels list.
owner_idThe ID whose 'animdata->action' pointer was followed to get to these F-Curves. This ID may be animated by a different slot than referenced by slot_handle, so do not treat this as "the ID animated by these F-Curves".
fcurve_owner_idThe ID that holds these F-Curves. Typically an Action, but can be any ID, for example in the case of drivers.

Definition at line 1359 of file anim_filter.cc.

References bAnimContext::ads, ADS_FILTER_ONLY_ERRORS, ale_name_matches_dopesheet_filter(), ANIMFILTER_ACTIVE, ANIMFILTER_CURVE_VISIBLE, ANIMFILTER_FOREDIT, ANIMFILTER_TMP_PEEK, ANIMTYPE_FCURVE, BLI_addtail(), BLI_assert, bAnimContext::bmain, FCURVE_ACTIVE, fcurve_has_errors(), FCURVE_PROTECTED, FCURVE_SELECTED, fcurve_span_must_be_selected(), fcurve_span_selection_matters(), FCURVE_VISIBLE, bDopeSheet::filterflag, ActionSlot::handle, make_new_animlistelem(), MEM_freeN(), bDopeSheet::searchstr, skip_fcurve_selected_data(), and bAnimListElem::slot_handle.

Referenced by animfilter_act_group(), and animfilter_action_slot().

◆ animfilter_modifier_idpoin_cb()

◆ animfilter_nla()

◆ animfilter_nla_controls()

◆ ds_base_sorting_cmp()

static int ds_base_sorting_cmp ( const void * base1_ptr,
const void * base2_ptr )
static

Definition at line 3598 of file anim_filter.cc.

References Object::id, ID::name, and Base::object.

Referenced by animdata_filter_ds_sorted_bases().

◆ fcurve_has_errors()

static bool fcurve_has_errors ( bAnimContext * ac,
const FCurve * fcu )
static

◆ fcurve_span_must_be_selected()

static bool fcurve_span_must_be_selected ( const eAnimFilter_Flags filter_mode)
inlinestatic

Definition at line 1336 of file anim_filter.cc.

References ANIMFILTER_FOREDIT, ANIMFILTER_SEL, and ANIMFILTER_SELEDIT.

Referenced by animfilter_fcurves_span().

◆ fcurve_span_selection_matters()

static bool fcurve_span_selection_matters ( const eAnimFilter_Flags filter_mode)
inlinestatic

◆ graphedit_get_context()

◆ key_data_from_adt()

static void key_data_from_adt ( bAnimListElem & ale,
AnimData * adt )
static

Set ale so that it points to the top-most 'summary' channel of the given adt. So this is either the Animation or the Action, or empty.

Definition at line 597 of file anim_filter.cc.

References AnimData::action, bAnimListElem::adt, Mask::adt, ALE_ACT, ALE_ACTION_LAYERED, ALE_NONE, bAnimListElem::datatype, blender::animrig::Action::is_action_layered(), and bAnimListElem::key_data.

Referenced by make_new_animlistelem().

◆ make_new_animlistelem()

static bAnimListElem * make_new_animlistelem ( Main * bmain,
void * data,
const eAnim_ChannelType datatype,
ID * owner_id,
ID * fcurve_owner_id )
static

Definition at line 615 of file anim_filter.cc.

References AnimData::action, bAnimListElem::adt, bArmature::adt, bGPdata::adt, bNodeTree::adt, CacheFile::adt, Camera::adt, Curve::adt, FreestyleLineStyle::adt, Key::adt, Lattice::adt, Light::adt, Mask::adt, Material::adt, PointCloud::adt, Speaker::adt, Tex::adt, World::adt, ALE_ACT, ALE_ACTION_LAYERED, ALE_ACTION_SLOT, ALE_ALL, ALE_FCURVE, ALE_GPFRAME, ALE_GREASE_PENCIL_CEL, ALE_GREASE_PENCIL_DATA, ALE_GREASE_PENCIL_GROUP, ALE_GROUP, ALE_MASKLAY, ALE_NLASTRIP, ALE_NONE, ALE_OB, ALE_SCE, 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, GreasePencilLayerTreeGroup::base, BKE_animdata_from_id(), BKE_keyblock_curval_rnapath_get(), BLI_assert_msg, BLI_findindex(), Key::block, bAnimListElem::bmain, bAnimListElem::data, data, bAnimListElem::datatype, EXPANDED_GPD, EXPANDED_MCLIP, blender::animrig::fcurve_find_in_assigned_slot(), bAnimListElem::fcurve_owner_id, FILTER_ARM_OBJD, FILTER_CACHEFILE_OBJD, FILTER_CAM_OBJD, FILTER_CUR_OBJD, FILTER_CURVES_OBJD, FILTER_LAM_OBJD, FILTER_LATTICE_OBJD, FILTER_LS_SCED, FILTER_MAT_OBJD, FILTER_MESH_OBJD, FILTER_NTREE_DATA, FILTER_PART_OBJD, FILTER_POINTS_OBJD, FILTER_SKE_OBJD, FILTER_SPK_OBJD, FILTER_TEX_DATA, FILTER_VOLUME_OBJD, FILTER_WOR_SCED, AnimData::flag, bAction::flag, bActionGroup::flag, bAnimListElem::flag, bGPDlayer::flag, FCurve::flag, GreasePencil::flag, GreasePencilLayerTreeNode::flag, KeyBlock::flag, MaskLayer::flag, NlaTrack::flag, Object::flag, Scene::flag, GS, bAnimListElem::id, Object::id, ID_AC, bAnimListElem::index, bAnimListElem::key_data, key_data_from_adt(), linestyle, MEM_callocN, ID::name, Base::object, ActionSlot::slot_flags, NlaTrack::strips, tex, and bAnimListElem::type.

Referenced by animdata_filter_dopesheet_summary(), and animfilter_fcurves_span().

◆ name_matches_dopesheet_filter()

◆ nlaedit_get_context()

◆ skip_fcurve_selected_data()

◆ skip_fcurve_with_name()

static bool skip_fcurve_with_name ( bAnimContext * ac,
FCurve * fcu,
eAnim_ChannelType channel_type,
void * owner,
ID * owner_id )
static