diff options
Diffstat (limited to 'source/blender')
3 files changed, 69 insertions, 46 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 565218d8be0..eff6b34fee6 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -118,51 +118,6 @@ namespace DEG { namespace { -struct BuilderWalkUserData { - DepsgraphNodeBuilder *builder; -}; - -static void modifier_walk(void *user_data, - struct Object * /*object*/, - struct ID **idpoin, - int /*cb_flag*/) -{ - BuilderWalkUserData *data = (BuilderWalkUserData *)user_data; - ID *id = *idpoin; - if (id == NULL) { - return; - } - switch (GS(id->name)) { - case ID_OB: - data->builder->build_object(NULL, - (Object *)id, - DEG_ID_LINKED_INDIRECTLY); - break; - case ID_TE: - data->builder->build_texture((Tex *)id); - break; - default: - /* pass */ - break; - } -} - -void constraint_walk(bConstraint * /*con*/, - ID **idpoin, - bool /*is_reference*/, - void *user_data) -{ - BuilderWalkUserData *data = (BuilderWalkUserData *)user_data; - if (*idpoin) { - ID *id = *idpoin; - if (GS(id->name) == ID_OB) { - data->builder->build_object(NULL, - (Object *)id, - DEG_ID_LINKED_INDIRECTLY); - } - } -} - void free_copy_on_write_datablock(void *id_v) { ID *id = (ID *)id_v; @@ -1436,4 +1391,53 @@ void DepsgraphNodeBuilder::build_lightprobe(Object *object) build_animdata(&probe->id); } +/* **** ID traversal callbacks functions **** */ + +void DepsgraphNodeBuilder::modifier_walk(void *user_data, + struct Object * /*object*/, + struct ID **idpoin, + int /*cb_flag*/) +{ + BuilderWalkUserData *data = (BuilderWalkUserData *)user_data; + ID *id = *idpoin; + if (id == NULL) { + return; + } + switch (GS(id->name)) { + case ID_OB: + data->builder->build_object(NULL, + (Object *)id, + DEG_ID_LINKED_INDIRECTLY); + break; + case ID_TE: + data->builder->build_texture((Tex *)id); + break; + default: + /* pass */ + break; + } +} + +void DepsgraphNodeBuilder::constraint_walk(bConstraint * /*con*/, + ID **idpoin, + bool /*is_reference*/, + void *user_data) +{ + BuilderWalkUserData *data = (BuilderWalkUserData *)user_data; + ID *id = *idpoin; + if (id == NULL) { + return; + } + switch (GS(id->name)) { + case ID_OB: + data->builder->build_object(NULL, + (Object *)id, + DEG_ID_LINKED_INDIRECTLY); + break; + default: + /* pass */ + break; + } +} + } // namespace DEG diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index 8dfbc4fa37c..fd72ae527b8 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -233,6 +233,20 @@ protected: }; vector<SavedEntryTag> saved_entry_tags_; + struct BuilderWalkUserData { + DepsgraphNodeBuilder *builder; + }; + + static void modifier_walk(void *user_data, + struct Object *object, + struct ID **idpoin, + int cb_flag); + + static void constraint_walk(bConstraint *constraint, + ID **idpoin, + bool is_reference, + void *user_data); + /* State which never changes, same for the whole builder time. */ Main *bmain_; Depsgraph *graph_; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc index 4600bfedf28..5ac49f540b1 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc @@ -50,6 +50,7 @@ extern "C" { #include "BKE_action.h" #include "BKE_armature.h" +#include "BKE_constraint.h" } /* extern "C" */ #include "DEG_depsgraph.h" @@ -70,7 +71,11 @@ void DepsgraphNodeBuilder::build_pose_constraints(Object *object, bPoseChannel *pchan, int pchan_index) { - /* create node for constraint stack */ + /* Pull indirect dependencies via constraints. */ + BuilderWalkUserData data; + data.builder = this; + BKE_constraints_id_loop(&pchan->constraints, constraint_walk, &data); + /* Create node for constraint stack. */ add_operation_node(&object->id, DEG_NODE_TYPE_BONE, pchan->name, function_bind(BKE_pose_constraints_evaluate, _1, |