Depsgraph: Fix warning with Empty objects

This commit is contained in:
Sergey Sharybin 2017-11-21 15:47:47 +01:00
parent 83b3e3fe00
commit a80b74ab0d
1 changed files with 9 additions and 4 deletions

View File

@ -2092,10 +2092,15 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDDepsNode *id_node
if (GS(id_orig->name) == ID_OB) {
Object *object = (Object *)id_orig;
ID *object_data_id = (ID *)object->data;
OperationKey data_copy_on_write_key(object_data_id,
DEG_NODE_TYPE_COPY_ON_WRITE,
DEG_OPCODE_COPY_ON_WRITE);
add_relation(data_copy_on_write_key, copy_on_write_key, "Eval Order");
if (object_data_id != NULL) {
OperationKey data_copy_on_write_key(object_data_id,
DEG_NODE_TYPE_COPY_ON_WRITE,
DEG_OPCODE_COPY_ON_WRITE);
add_relation(data_copy_on_write_key, copy_on_write_key, "Eval Order");
}
else {
BLI_assert(object->type == OB_EMPTY);
}
}
}