53 ob =
reinterpret_cast<Object *
>(object_id);
54 if (ob->
data != &
id) {
68 for (
int i = 0;
i < related_ids.size();
i++) {
69 ID *related_id = related_ids[
i];
81 related_ids.append_non_duplicates(owner_id);
85 switch (
GS(related_id->
name)) {
93 related_ids.append_non_duplicates(
data);
96 if (!particle_system->part) {
102 related_ids.append_non_duplicates(&particle_system->part->id);
109 Key *key =
reinterpret_cast<Key *
>(related_id);
112 related_ids.append_non_duplicates(key->
from);
120 related_ids.append_non_duplicates(&mat->
nodetree->
id);
133 ob =
reinterpret_cast<Object *
>(object_id);
134 bool object_uses_particle_settings =
false;
136 if (!particle_system->part) {
139 if (&particle_system->part->id != related_id) {
142 object_uses_particle_settings =
true;
145 if (object_uses_particle_settings) {
146 related_ids.append_non_duplicates(&ob->
id);
160 related_ids.append_non_duplicates(&node_tree->
id);
167 related_ids.append_non_duplicates(&key->
id);
183 for (
ID *related_id : related_ids) {
198 if (adt ==
nullptr) {
199 printf(
"ERROR: data-block type is not animatable (ID = %s)\n", (
id) ? (id->
name) :
"<None>");
205 if (adt->
action ==
nullptr) {
208 if (action ==
nullptr) {
210 char actname[
sizeof(
id->name) - 2];
219 Key *key =
reinterpret_cast<Key *
>(id);
257 if (
ELEM(
nullptr, adt, fcu)) {
261 const bool is_driver = fcu->
driver !=
nullptr;
312 if (adt->
action !=
nullptr) {
315 Action &action = act->wrap();
330 const int array_index)
352 for (
int layer_idx = action.
layer_array_num - 1; layer_idx >= 0; layer_idx--) {
357 switch (strip->type()) {
358 case Strip::Type::Keyframe: {
361 if (!channelbag_for_slot) {
364 const FCurve *fcu = channelbag_for_slot->fcurve_find({rna_path, array_index});
Functions and classes to work with Actions.
Functions to work with AnimData.
Blender kernel action and pose functionality.
void action_groups_remove_channel(bAction *act, FCurve *fcu)
bAction * BKE_action_add(Main *bmain, const char name[])
AnimData * BKE_animdata_ensure_id(ID *id)
void BKE_fcurve_free(FCurve *fcu)
Key * BKE_key_from_id(ID *id)
ID * BKE_id_owner_get(ID *id, const bool debug_relationship_assert=true)
#define FOREACH_MAIN_LISTBASE_ID_END
#define FOREACH_MAIN_LISTBASE_ID_BEGIN(_lb, _id)
General operations, lookup, etc. for materials.
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define SNPRINTF_UTF8(dst, format,...)
#define UNUSED_VARS_NDEBUG(...)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
@ ID_RECALC_ANIMATION_NO_FLUSH
#define ID_REAL_USERS(id)
BMesh const char void * data
void append_non_duplicates(const T &value)
const Layer * layer(int64_t index) const
bool is_action_legacy() const
bool is_action_layered() const
Slot * slot_for_handle(slot_handle_t handle)
blender::Span< const Strip * > strips() const
const Channelbag * channelbag_for_slot(const Slot &slot) const
bool action_fcurve_remove(Action &action, FCurve &fcu)
void animdata_fcurve_delete(AnimData *adt, FCurve *fcu)
Vector< ID * > find_related_ids(Main &bmain, ID &id)
bAction * id_action_ensure(Main *bmain, ID *id)
static void add_object_data_users(const Main &bmain, const ID &id, Vector< ID * > &related_ids)
Action * get_action(ID &animated_id)
bool animdata_remove_empty_action(AnimData *adt)
bool assign_action(bAction *action, ID &animated_id)
static bAction * find_related_action(Main &bmain, ID &id)
const FCurve * fcurve_find_by_rna_path(const AnimData &adt, StringRefNull rna_path, int array_index)
bNodeTree * node_tree_from_id(ID *id)
struct bNodeTree * nodetree