Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/anim_deps.c
| Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "ED_anim_api.h" | #include "ED_anim_api.h" | ||||
| /* **************************** depsgraph tagging ******************************** */ | /* **************************** depsgraph tagging ******************************** */ | ||||
| /* Used from FModifiers rna callbacks. | |||||
| * There, we need to make sure corresponding property's RNA update functions are called. */ | |||||
| void ANIM_rna_updates_from_action_fcurve(Main *bmain, Scene *scene, bAction *act, FCurve *fcu) | |||||
| { | |||||
| if (fcu && fcu->rna_path) { | |||||
| ListBase *lb; | |||||
| ID *id_iter; | |||||
| /* Have to find all users of this action. */ | |||||
| FOREACH_MAIN_LISTBASE_BEGIN (bmain, lb) { | |||||
| FOREACH_MAIN_LISTBASE_ID_BEGIN (lb, id_iter) { | |||||
| AnimData *adt = BKE_animdata_from_id(id_iter); | |||||
| if (ELEM(NULL, adt, adt->action)) { | |||||
| continue; | |||||
| } | |||||
| if (adt->action == act) { | |||||
| PointerRNA id_ptr, prop_ptr; | |||||
| PropertyRNA *prop; | |||||
| RNA_id_pointer_create(id_iter, &id_ptr); | |||||
| if (RNA_path_resolve_property(&id_ptr, fcu->rna_path, &prop_ptr, &prop)) { | |||||
| RNA_property_update_main(bmain, scene, &prop_ptr, prop); | |||||
| } | |||||
| } | |||||
| } | |||||
| FOREACH_MAIN_LISTBASE_ID_END; | |||||
| } | |||||
| FOREACH_MAIN_LISTBASE_END; | |||||
| } | |||||
| } | |||||
| /* tags the given anim list element for refreshes (if applicable) | /* tags the given anim list element for refreshes (if applicable) | ||||
| * due to Animation Editor editing | * due to Animation Editor editing | ||||
| */ | */ | ||||
| void ANIM_list_elem_update(Main *bmain, Scene *scene, bAnimListElem *ale) | void ANIM_list_elem_update(Main *bmain, Scene *scene, bAnimListElem *ale) | ||||
| { | { | ||||
| ID *id; | ID *id; | ||||
| FCurve *fcu; | FCurve *fcu; | ||||
| AnimData *adt; | AnimData *adt; | ||||
| ▲ Show 20 Lines • Show All 404 Lines • Show Last 20 Lines | |||||