Depsgraph: Fix/workaround crash when toggling edit mode

This commit is contained in:
Sergey Sharybin 2017-11-21 15:34:13 +01:00
parent 6ee7a02558
commit 99ffd7b35d
1 changed files with 11 additions and 0 deletions

View File

@ -2086,6 +2086,17 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDDepsNode *id_node
*/
}
GHASH_FOREACH_END();
/* TODO(sergey): This solves crash for now, but causes too many
* updates potentially.
*/
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");
}
}
} // namespace DEG