Depsgraph: Fix missing relations for objects which are indirectly linked
This is a corresponding part of 7dda3cf
.
This commit is contained in:
@@ -113,6 +113,41 @@ extern "C" {
|
|||||||
|
|
||||||
namespace DEG {
|
namespace DEG {
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
struct BuilderWalkUserData {
|
||||||
|
DepsgraphRelationBuilder *builder;
|
||||||
|
Main *bmain;
|
||||||
|
Scene *scene;
|
||||||
|
};
|
||||||
|
|
||||||
|
static void modifier_walk(void *user_data,
|
||||||
|
struct Object * /*ob*/,
|
||||||
|
struct Object **obpoin,
|
||||||
|
int /*cb_flag*/)
|
||||||
|
{
|
||||||
|
BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
|
||||||
|
if (*obpoin) {
|
||||||
|
data->builder->build_object(data->bmain, data->scene, *obpoin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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(data->bmain, data->scene, (Object *)id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* namespace */
|
||||||
|
|
||||||
/* ***************** */
|
/* ***************** */
|
||||||
/* Relations Builder */
|
/* Relations Builder */
|
||||||
|
|
||||||
@@ -407,6 +442,21 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o
|
|||||||
"[ObLocal -> ObParent]");
|
"[ObLocal -> ObParent]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ob->modifiers.first != NULL) {
|
||||||
|
BuilderWalkUserData data;
|
||||||
|
data.builder = this;
|
||||||
|
data.bmain = bmain;
|
||||||
|
data.scene = scene;
|
||||||
|
modifiers_foreachObjectLink(ob, modifier_walk, &data);
|
||||||
|
}
|
||||||
|
if (ob->constraints.first != NULL) {
|
||||||
|
BuilderWalkUserData data;
|
||||||
|
data.builder = this;
|
||||||
|
data.bmain = bmain;
|
||||||
|
data.scene = scene;
|
||||||
|
BKE_constraints_id_loop(&ob->constraints, constraint_walk, &data);
|
||||||
|
}
|
||||||
|
|
||||||
/* object constraints */
|
/* object constraints */
|
||||||
if (ob->constraints.first != NULL) {
|
if (ob->constraints.first != NULL) {
|
||||||
OperationKey constraint_key(&ob->id,
|
OperationKey constraint_key(&ob->id,
|
||||||
|
Reference in New Issue
Block a user