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);
119 if (mat->nodetree &&
ID_REAL_USERS(&mat->nodetree->id) == 1) {
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;
281 if (adt->
action !=
nullptr) {
284 Action &action = act->wrap();
299 const int array_index)
320 for (
int layer_idx = action.
layer_array_num - 1; layer_idx >= 0; layer_idx--) {
325 switch (strip->type()) {
329 if (!channelbag_for_slot) {
332 const FCurve *fcu = channelbag_for_slot->fcurve_find({
rna_path, array_index});
351 if (!adt || !adt->
action) {
359 if (!adt || !adt->
action) {
Functions and classes to work with Actions.
Functions to work with AnimData.
Blender kernel action and pose functionality.
#define FOREACH_MAIN_LISTBASE_ID_END
#define FOREACH_MAIN_LISTBASE_ID_BEGIN(_lb, _id)
General operations, lookup, etc. for materials.
#define SNPRINTF_UTF8(dst, format,...)
#define ID_REAL_USERS(id)
#define BLI_assert_unreachable()
#define UNUSED_VARS_NDEBUG(...)
#define BLI_assert_msg(a, msg)
void append_non_duplicates(const T &value)
const Layer * layer(int64_t index) const
Slot * slot_for_handle(slot_handle_t handle)
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)
Span< FCurve * > fcurves_for_action_slot(Action &action, slot_handle_t slot_handle)
Action * get_action(ID &animated_id)
bool animdata_remove_empty_action(AnimData *adt)
Span< FCurve * > fcurves_for_assigned_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)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
bAction * BKE_action_add(Main *bmain, const char name[])
AnimData * BKE_animdata_ensure_id(ID *id)
Key * BKE_key_from_id(ID *id)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void DEG_id_tag_update(ID *id, unsigned int flags)
BMesh const char void * data
void BKE_fcurve_free(FCurve *fcu)
@ ID_RECALC_ANIMATION_NO_FLUSH
ID_Type GS(const char *name)
ID * BKE_id_owner_get(ID *id, const bool debug_relationship_assert=true)
void DEG_relations_tag_update(Main *bmain)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
ListBaseT< FCurve > drivers
ListBaseT< Object > objects
ListBaseT< struct ParticleSystem > particlesystem