|
Blender
V3.3
|
#include "MEM_guardedalloc.h"#include <string.h>#include "BKE_action.h"#include "BKE_anim_data.h"#include "BKE_animsys.h"#include "BKE_context.h"#include "BKE_fcurve.h"#include "BKE_fcurve_driver.h"#include "BKE_global.h"#include "BKE_idtype.h"#include "BKE_lib_id.h"#include "BKE_lib_query.h"#include "BKE_main.h"#include "BKE_nla.h"#include "BKE_node.h"#include "BKE_report.h"#include "DNA_ID.h"#include "DNA_anim_types.h"#include "DNA_light_types.h"#include "DNA_material_types.h"#include "DNA_node_types.h"#include "DNA_space_types.h"#include "DNA_windowmanager_types.h"#include "DNA_world_types.h"#include "BLI_alloca.h"#include "BLI_dynstr.h"#include "BLI_listbase.h"#include "BLI_string.h"#include "BLI_utildefines.h"#include "DEG_depsgraph.h"#include "BLO_read_write.h"#include "RNA_access.h"#include "RNA_path.h"#include "CLG_log.h"Go to the source code of this file.
Classes | |
| struct | AllFCurvesCbWrapper |
Macros | |
| #define | ANIMDATA_IDS_CB(first) |
| #define | ANIMDATA_NODETREE_IDS_CB(first, NtId_Type) |
| #define | RENAMEFIX_ANIM_IDS(first) |
| #define | RENAMEFIX_ANIM_NODETREE_IDS(first, NtId_Type) |
Typedefs | |
| typedef struct AllFCurvesCbWrapper | AllFCurvesCbWrapper |
Functions | |
| bool | id_type_can_have_animdata (const short id_type) |
| bool | id_can_have_animdata (const ID *id) |
| AnimData * | BKE_animdata_from_id (const ID *id) |
| AnimData * | BKE_animdata_ensure_id (ID *id) |
| bool | BKE_animdata_set_action (ReportList *reports, ID *id, bAction *act) |
| bool | BKE_animdata_action_editable (const AnimData *adt) |
| bool | BKE_animdata_action_ensure_idroot (const ID *owner, bAction *action) |
| void | BKE_animdata_free (ID *id, const bool do_id_user) |
| bool | BKE_animdata_id_is_animated (const struct ID *id) |
| void | BKE_animdata_foreach_id (AnimData *adt, LibraryForeachIDData *data) |
| AnimData * | BKE_animdata_copy (Main *bmain, AnimData *adt, const int flag) |
| bool | BKE_animdata_copy_id (Main *bmain, ID *id_to, ID *id_from, const int flag) |
| static void | animdata_copy_id_action (Main *bmain, ID *id, const bool set_newid, const bool do_linked_id) |
| void | BKE_animdata_copy_id_action (Main *bmain, ID *id) |
| void | BKE_animdata_duplicate_id_action (struct Main *bmain, struct ID *id, const eDupli_ID_Flags duplicate_flags) |
| void | BKE_animdata_merge_copy (Main *bmain, ID *dst_id, ID *src_id, eAnimData_MergeCopy_Modes action_mode, bool fix_drivers) |
| static bool | animpath_matches_basepath (const char path[], const char basepath[]) |
| static void | animpath_update_basepath (FCurve *fcu, const char *old_basepath, const char *new_basepath) |
| static void | action_move_fcurves_by_basepath (bAction *srcAct, bAction *dstAct, const char *src_basepath, const char *dst_basepath) |
| static void | animdata_move_drivers_by_basepath (AnimData *srcAdt, AnimData *dstAdt, const char *src_basepath, const char *dst_basepath) |
| void | BKE_animdata_transfer_by_basepath (Main *bmain, ID *srcID, ID *dstID, ListBase *basepaths) |
| static bool | check_rna_path_is_valid (ID *owner_id, const char *path) |
| static char * | rna_path_rename_fix (ID *owner_id, const char *prefix, const char *oldName, const char *newName, char *oldpath, bool verify_paths) |
| static bool | fcurves_path_rename_fix (ID *owner_id, const char *prefix, const char *oldName, const char *newName, const char *oldKey, const char *newKey, ListBase *curves, bool verify_paths) |
| static bool | drivers_path_rename_fix (ID *owner_id, ID *ref_id, const char *prefix, const char *oldName, const char *newName, const char *oldKey, const char *newKey, ListBase *curves, bool verify_paths) |
| static bool | nlastrips_path_rename_fix (ID *owner_id, const char *prefix, const char *oldName, const char *newName, const char *oldKey, const char *newKey, ListBase *strips, bool verify_paths) |
| char * | BKE_animsys_fix_rna_path_rename (ID *owner_id, char *old_path, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, bool verify_paths) |
| void | BKE_action_fix_paths_rename (ID *owner_id, bAction *act, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, bool verify_paths) |
| void | BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, ID *ref_id, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, bool verify_paths) |
| static bool | fcurves_path_remove_fix (const char *prefix, ListBase *curves) |
| static bool | nlastrips_path_remove_fix (const char *prefix, ListBase *strips) |
| bool | BKE_animdata_fix_paths_remove (ID *id, const char *prefix) |
| static void | fcurves_apply_cb (ID *id, ListBase *fcurves, ID_FCurve_Edit_Callback func, void *user_data) |
| static void | nlastrips_apply_all_curves_cb (ID *id, ListBase *strips, AllFCurvesCbWrapper *wrapper) |
| static void | adt_apply_all_fcurves_cb (ID *id, AnimData *adt, void *wrapper_data) |
| void | BKE_fcurves_id_cb (ID *id, ID_FCurve_Edit_Callback func, void *user_data) |
| void | BKE_fcurves_main_cb (Main *bmain, ID_FCurve_Edit_Callback func, void *user_data) |
| void | BKE_animdata_main_cb (Main *bmain, ID_AnimData_Edit_Callback func, void *user_data) |
| void | BKE_animdata_fix_paths_rename_all (ID *ref_id, const char *prefix, const char *oldName, const char *newName) |
| void | BKE_animdata_fix_paths_rename_all_ex (Main *bmain, ID *ref_id, const char *prefix, const char *oldName, const char *newName, const int oldSubscript, const int newSubscript, const bool verify_paths) |
| void | BKE_animdata_blend_write (BlendWriter *writer, struct AnimData *adt) |
| void | BKE_animdata_blend_read_data (BlendDataReader *reader, AnimData *adt) |
| void | BKE_animdata_blend_read_lib (BlendLibReader *reader, ID *id, AnimData *adt) |
| void | BKE_animdata_blend_read_expand (struct BlendExpander *expander, AnimData *adt) |
Variables | |
| static CLG_LogRef | LOG = {"bke.anim_sys"} |
| #define ANIMDATA_IDS_CB | ( | first | ) |
| #define ANIMDATA_NODETREE_IDS_CB | ( | first, | |
| NtId_Type | |||
| ) |
| #define RENAMEFIX_ANIM_IDS | ( | first | ) |
| #define RENAMEFIX_ANIM_NODETREE_IDS | ( | first, | |
| NtId_Type | |||
| ) |
| typedef struct AllFCurvesCbWrapper AllFCurvesCbWrapper |
|
static |
Definition at line 495 of file anim_data.c.
References action_groups_add_channel(), action_groups_add_new(), action_groups_clear_tempflags(), action_groups_remove_channel(), AGRP_TEMP, animpath_matches_basepath(), animpath_update_basepath(), BKE_action_group_find_name(), BLI_addtail(), BLI_freelinkN(), BLI_listbase_is_empty(), bActionGroup::channels, CLOG_ERROR, bAction::curves, ELEM, ListBase::first, bActionGroup::flag, G, G_DEBUG, bAction::groups, FCurve::grp, LOG, bActionGroup::name, bActionGroup::next, FCurve::next, NULL, and FCurve::rna_path.
Referenced by BKE_animdata_transfer_by_basepath().
Definition at line 1135 of file anim_data.c.
References AnimData::action, bAction::curves, AnimData::drivers, fcurves_apply_cb(), ListBase::first, AllFCurvesCbWrapper::func, NlaTrack::next, AnimData::nla_tracks, nlastrips_apply_all_curves_cb(), NlaTrack::strips, AnimData::tmpact, and AllFCurvesCbWrapper::user_data.
Referenced by BKE_fcurves_id_cb(), and BKE_fcurves_main_cb().
|
static |
Definition at line 346 of file anim_data.c.
References AnimData::action, BKE_animdata_from_id(), BKE_id_copy(), bAction::id, bNodeTree::id, ID_IS_LINKED, ID_NEW_SET, id_us_min(), ntree, ntreeFromID(), and AnimData::tmpact.
Referenced by BKE_animdata_copy_id_action(), and BKE_animdata_duplicate_id_action().
|
static |
Definition at line 585 of file anim_data.c.
References animpath_matches_basepath(), animpath_update_basepath(), BLI_addtail(), BLI_remlink(), AnimData::drivers, and LISTBASE_FOREACH_MUTABLE.
Referenced by BKE_animdata_transfer_by_basepath().
|
static |
Helper heuristic for determining if a path is compatible with the basepath
| path | Full RNA-path from some data (usually an F-Curve) to compare |
| basepath | Shorter path fragment to look for |
Definition at line 469 of file anim_data.c.
References STRPREFIX.
Referenced by action_move_fcurves_by_basepath(), animdata_move_drivers_by_basepath(), and animpath_update_basepath().
|
static |
Definition at line 475 of file anim_data.c.
References animpath_matches_basepath(), BLI_assert, BLI_sprintfN(), MEM_freeN, FCurve::rna_path, and STREQ.
Referenced by action_move_fcurves_by_basepath(), and animdata_move_drivers_by_basepath().
| void BKE_action_fix_paths_rename | ( | struct ID * | owner_id, |
| struct bAction * | act, | ||
| const char * | prefix, | ||
| const char * | oldName, | ||
| const char * | newName, | ||
| int | oldSubscript, | ||
| int | newSubscript, | ||
| bool | verify_paths | ||
| ) |
Fix all the paths for the given ID + Action.
This is just an external wrapper for the F-Curve fixing function, with input validity checks on top of the basic method.
<prefix><["><name><"]> i.e. pose.bones["Bone"]. Definition at line 915 of file anim_data.c.
References BLI_array_alloca, BLI_sprintfN(), BLI_str_escape(), bAction::curves, ELEM, fcurves_path_rename_fix(), MEM_freeN, and NULL.
Referenced by constraint_bone_name_fix(), and joined_armature_fix_links_constraints().
Definition at line 169 of file anim_data.c.
References AnimData::actstrip, ADT_NLA_EDIT_ON, AnimData::flag, NULL, and AnimData::tmpact.
Referenced by BKE_animdata_set_action().
Definition at line 177 of file anim_data.c.
References GS, bAction::idroot, ID::name, and NULL.
Referenced by BKE_animdata_set_action(), and BKE_animdata_transfer_by_basepath().
| void BKE_animdata_blend_read_data | ( | BlendDataReader * | reader, |
| AnimData * | adt | ||
| ) |
Definition at line 1443 of file anim_data.c.
References AnimData::act_track, AnimData::actstrip, BKE_fcurve_blend_read_data(), BKE_nla_blend_read_data(), BLO_read_data_address, BLO_read_list(), AnimData::driver_array, AnimData::drivers, AnimData::nla_tracks, and NULL.
Referenced by armature_blend_read_data(), BKE_gpencil_blend_read_data(), cache_file_blend_read_data(), camera_blend_read_data(), curve_blend_read_data(), curves_blend_read_data(), lattice_blend_read_data(), light_blend_read_data(), lightprobe_blend_read_data(), linestyle_blend_read_data(), material_blend_read_data(), mesh_blend_read_data(), metaball_blend_read_data(), movieclip_blend_read_data(), ntreeBlendReadData(), object_blend_read_data(), particle_settings_blend_read_data(), pointcloud_blend_read_data(), scene_blend_read_data(), shapekey_blend_read_data(), simulation_blend_read_data(), speaker_blend_read_data(), texture_blend_read_data(), volume_blend_read_data(), and world_blend_read_data().
| void BKE_animdata_blend_read_expand | ( | struct BlendExpander * | expander, |
| AnimData * | adt | ||
| ) |
Definition at line 1491 of file anim_data.c.
References AnimData::action, BKE_fcurve_blend_read_expand(), BKE_nla_blend_read_expand(), BLO_expand, AnimData::drivers, AnimData::nla_tracks, and AnimData::tmpact.
Referenced by expand_id().
| void BKE_animdata_blend_read_lib | ( | BlendLibReader * | reader, |
| ID * | id, | ||
| AnimData * | adt | ||
| ) |
Definition at line 1472 of file anim_data.c.
References AnimData::action, BKE_fcurve_blend_read_lib(), BKE_nla_blend_read_lib(), BLO_read_id_address, AnimData::drivers, id, ID::lib, AnimData::nla_tracks, NULL, and AnimData::tmpact.
Referenced by lib_link_id().
| void BKE_animdata_blend_write | ( | BlendWriter * | writer, |
| struct AnimData * | adt | ||
| ) |
Definition at line 1421 of file anim_data.c.
References BKE_fcurve_blend_write(), BKE_nla_blend_write(), BLO_write_string(), BLO_write_struct, AnimData::drivers, LISTBASE_FOREACH, AnimData::nla_tracks, and AnimData::overrides.
Referenced by armature_blend_write(), cache_file_blend_write(), camera_blend_write(), curve_blend_write(), curves_blend_write(), greasepencil_blend_write(), lattice_blend_write(), light_blend_write(), lightprobe_blend_write(), linestyle_blend_write(), mask_blend_write(), material_blend_write(), mesh_blend_write(), metaball_blend_write(), movieclip_blend_write(), ntreeBlendWrite(), object_blend_write(), particle_settings_blend_write(), pointcloud_blend_write(), scene_blend_write(), shapekey_blend_write(), simulation_blend_write(), speaker_blend_write(), texture_blend_write(), volume_blend_write(), and world_blend_write().
Make a copy of the given AnimData - to be used when copying data-blocks.
| flag | Control ID pointers management, see LIB_ID_CREATE_.../LIB_ID_COPY_... flags in BKE_lib_id.h |
Definition at line 275 of file anim_data.c.
References AnimData::action, BKE_fcurves_copy(), BKE_id_copy_ex(), BKE_nla_tracks_copy_from_adt(), BLI_assert, BLI_listbase_clear(), AnimData::driver_array, AnimData::drivers, id_us_plus(), LIB_ID_COPY_ACTIONS, LIB_ID_CREATE_NO_MAIN, LIB_ID_CREATE_NO_USER_REFCOUNT, MEM_dupallocN, NULL, AnimData::overrides, and AnimData::tmpact.
Referenced by BKE_animdata_copy_id(), BKE_libblock_copy_ex(), ED_armature_join_objects_exec(), and ED_gpencil_join_objects_exec().
| flag | Control ID pointers management, see LIB_ID_CREATE_.../LIB_ID_COPY_... flags in BKE_lib_id.h |
Definition at line 327 of file anim_data.c.
References IdAdtTemplate::adt, BKE_animdata_copy(), BKE_animdata_free(), BKE_animdata_from_id(), GS, LIB_ID_CREATE_NO_USER_REFCOUNT, and ID::name.
Referenced by make_links_data_exec().
Copy AnimData Actions.
Definition at line 372 of file anim_data.c.
References animdata_copy_id_action(), and ID_IS_OVERRIDE_LIBRARY.
| void BKE_animdata_duplicate_id_action | ( | struct Main * | bmain, |
| struct ID * | id, | ||
| const eDupli_ID_Flags | duplicate_flags | ||
| ) |
Definition at line 378 of file anim_data.c.
References animdata_copy_id_action(), USER_DUP_ACT, and USER_DUP_LINKED_ID.
Ensure AnimData exists in the given ID-block (when supported).
Definition at line 90 of file anim_data.c.
References AnimData::act_influence, IdAdtTemplate::adt, id_can_have_animdata(), MEM_callocN, and NULL.
Referenced by BKE_animdata_transfer_by_basepath(), do_versions_ipos_to_animato(), ED_id_action_ensure(), nlaedit_objects_add_exec(), object_speaker_add_exec(), and verify_driver_fcurve().
Fix the path after removing elements that are not ID (e.g., node). Return true if any animation data was affected.
Definition at line 1067 of file anim_data.c.
References AnimData::action, IdAdtTemplate::adt, bAction::curves, AnimData::drivers, fcurves_path_remove_fix(), id_can_have_animdata(), LISTBASE_FOREACH, AnimData::nla_tracks, nlastrips_path_remove_fix(), NULL, and AnimData::tmpact.
Referenced by clip_delete_plane_track(), clip_delete_track(), and nodeRemoveNode().
| void BKE_animdata_fix_paths_rename | ( | struct ID * | owner_id, |
| struct AnimData * | adt, | ||
| struct ID * | ref_id, | ||
| const char * | prefix, | ||
| const char * | oldName, | ||
| const char * | newName, | ||
| int | oldSubscript, | ||
| int | newSubscript, | ||
| bool | verify_paths | ||
| ) |
Fix all the paths for the given ID+AnimData
<prefix><["><name><"]> i.e. pose.bones["Bone"]. Definition at line 958 of file anim_data.c.
References AnimData::action, BLI_array_alloca, BLI_sprintfN(), BLI_str_escape(), bAction::curves, DEG_id_tag_update(), AnimData::drivers, drivers_path_rename_fix(), ELEM, fcurves_path_rename_fix(), ListBase::first, bAction::id, ID_RECALC_COPY_ON_WRITE, MEM_freeN, NlaTrack::next, AnimData::nla_tracks, nlastrips_path_rename_fix(), NULL, NlaTrack::strips, and AnimData::tmpact.
Referenced by SEQ_ensure_unique_name(), and texture_slot_move_exec().
| void BKE_animdata_fix_paths_rename_all | ( | struct ID * | ref_id, |
| const char * | prefix, | ||
| const char * | oldName, | ||
| const char * | newName | ||
| ) |
See BKE_animdata_fix_paths_rename_all_ex
Definition at line 1287 of file anim_data.c.
References BKE_animdata_fix_paths_rename_all_ex(), and G.
Referenced by BKE_mask_layer_rename(), BKE_view_layer_rename(), and ED_armature_bone_rename().
| void BKE_animdata_fix_paths_rename_all_ex | ( | struct Main * | bmain, |
| struct ID * | ref_id, | ||
| const char * | prefix, | ||
| const char * | oldName, | ||
| const char * | newName, | ||
| int | oldSubscript, | ||
| int | newSubscript, | ||
| bool | verify_paths | ||
| ) |
Fix all RNA-Paths throughout the database (directly access the Global.main version).
<prefix><["><name><"]> i.e. pose.bones["Bone"] Definition at line 1296 of file anim_data.c.
References Main::armatures, Main::cachefiles, Main::cameras, Main::curves, ListBase::first, Main::gpencils, Main::hair_curves, id, Main::lattices, Main::lights, Main::linestyles, Main::masks, Main::materials, Main::meshes, Main::metaballs, Main::movieclips, Main::nodetrees, Main::objects, Main::particles, Main::pointclouds, RENAMEFIX_ANIM_IDS, RENAMEFIX_ANIM_NODETREE_IDS, Main::scenes, Main::shapekeys, Main::simulations, Main::speakers, Main::textures, Main::volumes, and Main::worlds.
Referenced by BKE_animdata_fix_paths_rename_all(), and version_node_socket_index_animdata().
| void BKE_animdata_foreach_id | ( | struct AnimData * | adt, |
| struct LibraryForeachIDData * | data | ||
| ) |
Callback used by lib_query to walk over all ID usages (mimics foreach_id callback of IDTypeInfo structure).
Definition at line 257 of file anim_data.c.
References AnimData::action, BKE_fcurve_foreach_id(), BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL, BKE_LIB_FOREACHID_PROCESS_IDSUPER, BKE_nla_strip_foreach_id(), data, AnimData::drivers, IDWALK_CB_USER, LISTBASE_FOREACH, AnimData::nla_tracks, NlaStrip::strips, and AnimData::tmpact.
Referenced by library_foreach_ID_link().
Free AnimData used by the nominated ID-block, and clear ID-block's AnimData pointer.
Definition at line 197 of file anim_data.c.
References AnimData::action, IdAdtTemplate::adt, BKE_fcurves_free(), BKE_nla_tracks_free(), AnimData::driver_array, AnimData::drivers, bAction::id, id_can_have_animdata(), id_us_min(), MEM_freeN, MEM_SAFE_FREE, AnimData::nla_tracks, NULL, and AnimData::tmpact.
Referenced by animchannels_clean_empty_exec(), BKE_animdata_copy_id(), BKE_libblock_free_data(), BKE_mesh_clear_geometry(), clear_animdata_fn(), curves_free_data(), make_object_duplilist_real(), ntreeFreeTree(), pointcloud_free_data(), simulation_free_data(), and volume_free_data().
Definition at line 76 of file anim_data.c.
References IdAdtTemplate::adt, id_can_have_animdata(), and NULL.
Referenced by animdata_copy_id_action(), BKE_animdata_copy_id(), BKE_animdata_id_is_animated(), BKE_animdata_merge_copy(), BKE_animdata_set_action(), BKE_animdata_transfer_by_basepath(), and BKE_fcurves_id_cb().
Return true if the ID-block has non-empty AnimData.
Definition at line 238 of file anim_data.c.
References AnimData::action, BKE_animdata_from_id(), BLI_listbase_is_empty(), bAction::curves, AnimData::drivers, AnimData::nla_tracks, NULL, and AnimData::overrides.
Referenced by BKE_object_moves_in_time(), and blender::io::AbstractHierarchyWriter::check_is_animated().
| void BKE_animdata_main_cb | ( | Main * | bmain, |
| ID_AnimData_Edit_Callback | func, | ||
| void * | user_data | ||
| ) |
Definition at line 1177 of file anim_data.c.
References ANIMDATA_IDS_CB, ANIMDATA_NODETREE_IDS_CB, Main::armatures, Main::cachefiles, Main::cameras, Main::curves, ListBase::first, Main::gpencils, Main::hair_curves, id, Main::lattices, Main::lights, Main::linestyles, Main::masks, Main::materials, Main::meshes, Main::metaballs, Main::movieclips, Main::nodetrees, Main::objects, Main::palettes, Main::particles, Main::pointclouds, Main::scenes, Main::shapekeys, Main::simulations, Main::speakers, Main::textures, Main::volumes, and Main::worlds.
Referenced by BKE_fcurves_main_cb(), blo_do_versions_280(), and blo_do_versions_300().
| void BKE_animdata_merge_copy | ( | struct Main * | bmain, |
| struct ID * | dst_id, | ||
| struct ID * | src_id, | ||
| eAnimData_MergeCopy_Modes | action_mode, | ||
| bool | fix_drivers | ||
| ) |
Merge copies of the data from the src AnimData into the destination AnimData.
Definition at line 387 of file anim_data.c.
References AnimData::action, ADT_MERGECOPY_SRC_COPY, ADT_MERGECOPY_SRC_REF, ADT_NLA_EDIT_ON, BKE_animdata_from_id(), BKE_fcurves_copy(), BKE_id_copy(), BKE_nla_tracks_copy(), BLI_movelisttolist(), CLOG_ERROR, FCurve::driver, DRIVER_TARGETS_LOOPER_END, DRIVER_TARGETS_USED_LOOPER_BEGIN, AnimData::drivers, ELEM, ListBase::first, AnimData::flag, id_us_plus(), LOG, DriverVar::next, FCurve::next, AnimData::nla_tracks, NULL, src, AnimData::tmpact, tracks, and ChannelDriver::variables.
Referenced by ED_armature_join_objects_exec(), and ED_gpencil_join_objects_exec().
| bool BKE_animdata_set_action | ( | struct ReportList * | reports, |
| struct ID * | id, | ||
| struct bAction * | act | ||
| ) |
Set active action used by AnimData from the given ID-block.
Called when user tries to change the active action of an AnimData block (via RNA, Outliner, etc.)
| reports | Can be NULL. |
| id | The owner of the animation data |
| act | The Action to set, or NULL to clear. |
Definition at line 118 of file anim_data.c.
References AnimData::action, BKE_animdata_action_editable(), BKE_animdata_action_ensure_idroot(), BKE_animdata_from_id(), BKE_report(), BKE_reportf(), id, bAction::id, id_us_min(), id_us_plus(), ID::name, NULL, RPT_ERROR, and RPT_WARNING.
Referenced by actionset_id_fn(), unlink_action_fn(), and unlinkact_animdata_fn().
| void BKE_animdata_transfer_by_basepath | ( | struct Main * | bmain, |
| struct ID * | srcID, | ||
| struct ID * | dstID, | ||
| struct ListBase * | basepaths | ||
| ) |
Move animation data from source to destination if its paths are based on basepaths.
Transfer the animation data from srcID to dstID where the srcID animation data is based off basepath, creating new AnimData and associated data as necessary.
| basepaths | A list of AnimationBasePathChange. |
Definition at line 601 of file anim_data.c.
References AnimData::action, action_move_fcurves_by_basepath(), animdata_move_drivers_by_basepath(), BKE_action_add(), BKE_animdata_action_ensure_idroot(), BKE_animdata_ensure_id(), BKE_animdata_from_id(), CLOG_ERROR, CLOG_WARN, DEG_id_tag_update(), AnimData::drivers, ELEM, ListBase::first, G, G_DEBUG, bAction::id, ID_RECALC_COPY_ON_WRITE, id_us_min(), LISTBASE_FOREACH, LOG, ID::name, and NULL.
Referenced by blender::ed::space_node::node_group_make_insert_selected(), blender::ed::space_node::node_group_separate_selected(), and blender::ed::space_node::node_group_ungroup().
| char* BKE_animsys_fix_rna_path_rename | ( | struct ID * | owner_id, |
| char * | old_path, | ||
| const char * | prefix, | ||
| const char * | oldName, | ||
| const char * | newName, | ||
| int | oldSubscript, | ||
| int | newSubscript, | ||
| bool | verify_paths | ||
| ) |
Get a "fixed" version of the given path old_path.
This is just an external wrapper for the RNA-Path fixing function, with input validity checks on top of the basic method.
<prefix><["><name><"]> i.e. pose.bones["Bone"]. Definition at line 860 of file anim_data.c.
References BLI_array_alloca, BLI_sprintfN(), BLI_str_escape(), CLOG_WARN, ELEM, G, G_DEBUG, LOG, MEM_freeN, NULL, result, and rna_path_rename_fix().
Referenced by gpencil_joined_fix_animdata_cb(), and joined_armature_fix_animdata_cb().
| void BKE_fcurves_id_cb | ( | ID * | id, |
| ID_FCurve_Edit_Callback | func, | ||
| void * | user_data | ||
| ) |
Definition at line 1157 of file anim_data.c.
References adt_apply_all_fcurves_cb(), BKE_animdata_from_id(), NULL, and user_data.
Referenced by do_versions_after_linking_280(), blender::deg::AnimationBackup::init_from_id(), blender::deg::AnimatedPropertyStorage::initializeFromID(), and update_mapping_node_inputs_and_properties().
| void BKE_fcurves_main_cb | ( | struct Main * | bmain, |
| ID_FCurve_Edit_Callback | func, | ||
| void * | user_data | ||
| ) |
Apply the given callback function on all F-Curves attached to data in main database.
Definition at line 1166 of file anim_data.c.
References adt_apply_all_fcurves_cb(), BKE_animdata_main_cb(), and user_data.
Referenced by do_versions_after_linking_270(), ED_armature_join_objects_exec(), and ED_gpencil_join_objects_exec().
Definition at line 670 of file anim_data.c.
References NULL, ptr, RNA_id_pointer_create(), and RNA_path_resolve_property().
Referenced by rna_path_rename_fix().
|
static |
Definition at line 778 of file anim_data.c.
References BLI_strncpy(), curves, FCurve::driver, DRIVER_TARGETS_LOOPER_END, DRIVER_TARGETS_USED_LOOPER_BEGIN, ListBase::first, GS, ID_OB, DriverVar::next, FCurve::next, NULL, FCurve::rna_path, rna_path_rename_fix(), STREQ, and ChannelDriver::variables.
Referenced by BKE_animdata_fix_paths_rename().
|
static |
Definition at line 1106 of file anim_data.c.
References ListBase::first, FCurve::next, and user_data.
Referenced by adt_apply_all_fcurves_cb(), and nlastrips_apply_all_curves_cb().
Definition at line 1025 of file anim_data.c.
References BKE_fcurve_free(), BLI_remlink(), curves, FCurve::next, FCurve::rna_path, and STRPREFIX.
Referenced by BKE_animdata_fix_paths_remove(), and nlastrips_path_remove_fix().
|
static |
Definition at line 743 of file anim_data.c.
References BLI_strncpy(), curves, FCurve::grp, bActionGroup::name, FCurve::next, NULL, FCurve::rna_path, rna_path_rename_fix(), and STREQ.
Referenced by BKE_action_fix_paths_rename(), BKE_animdata_fix_paths_rename(), and nlastrips_path_rename_fix().
Definition at line 66 of file anim_data.c.
References GS, id, id_type_can_have_animdata(), ID::name, and NULL.
Referenced by BKE_animdata_ensure_id(), BKE_animdata_fix_paths_remove(), BKE_animdata_free(), and BKE_animdata_from_id().
| bool id_type_can_have_animdata | ( | short | id_type | ) |
Check if the given ID-block can have AnimData.
Definition at line 57 of file anim_data.c.
References BKE_idtype_get_info_from_idcode(), IDTypeInfo::flags, IDTYPE_FLAGS_NO_ANIMDATA, and NULL.
Referenced by id_can_have_animdata(), and wm_context_member_from_ptr().
|
static |
Definition at line 1119 of file anim_data.c.
References NlaStrip::act, bAction::curves, fcurves_apply_cb(), ListBase::first, AllFCurvesCbWrapper::func, NlaStrip::next, NlaStrip::strips, and AllFCurvesCbWrapper::user_data.
Referenced by adt_apply_all_fcurves_cb().
Definition at line 1049 of file anim_data.c.
References NlaStrip::act, bAction::curves, fcurves_path_remove_fix(), ListBase::first, NlaStrip::next, and NlaStrip::strips.
Referenced by BKE_animdata_fix_paths_remove().
|
static |
Definition at line 832 of file anim_data.c.
References NlaStrip::act, bAction::curves, fcurves_path_rename_fix(), ListBase::first, NlaStrip::next, NULL, and NlaStrip::strips.
Referenced by BKE_animdata_fix_paths_rename().
|
static |
Definition at line 685 of file anim_data.c.
References BLI_dynstr_append(), BLI_dynstr_free(), BLI_dynstr_get_cstring(), BLI_dynstr_nappend(), BLI_dynstr_new(), check_rna_path_is_valid(), MEM_freeN, and NULL.
Referenced by BKE_animsys_fix_rna_path_rename(), drivers_path_rename_fix(), and fcurves_path_rename_fix().
|
static |
Definition at line 50 of file anim_data.c.
Referenced by action_move_fcurves_by_basepath(), BKE_animdata_merge_copy(), BKE_animdata_transfer_by_basepath(), and BKE_animsys_fix_rna_path_rename().