Depsgraph: Fix infinite viewport object update in CYcles render mode
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 21 Nov 2016 11:00:09 +0000 (12:00 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 21 Nov 2016 11:00:09 +0000 (12:00 +0100)
The issue was caused by wrong object re-tag needed to have proper dependnecies
update for OpenSubdiv.

source/blender/depsgraph/intern/builder/deg_builder.cc
source/blender/depsgraph/intern/depsgraph.cc

index 51d1e08d70a93620407149ed71c610d27c8e3e16..aedd00685b3956b8d0108c34f9311b6f41d9829b 100644 (file)
@@ -48,6 +48,8 @@
 
 #include "util/deg_util_foreach.h"
 
+#include <cstdio>
+
 namespace DEG {
 
 string deg_fcurve_id_name(const FCurve *fcu)
index 3502267d9ca1a1438dfd0b34003ab297507ef826..9a4a35a5a357edfc3cd46db06a76f7e46a502cf3 100644 (file)
@@ -371,8 +371,7 @@ DepsRelation *Depsgraph::add_new_relation(OperationDepsNode *from,
        if (comp_node->type == DEPSNODE_TYPE_GEOMETRY) {
                IDDepsNode *id_to = to->owner->owner;
                IDDepsNode *id_from = from->owner->owner;
-               Object *object_to = (Object *)id_to->id;
-               if (id_to != id_from && (object_to->recalc & OB_RECALC_ALL)) {
+               if (id_to != id_from && (id_to->id->tag & LIB_TAG_ID_RECALC_ALL)) {
                        if ((id_from->eval_flags & DAG_EVAL_NEED_CPU) == 0) {
                                id_from->tag_update(this);
                                id_from->eval_flags |= DAG_EVAL_NEED_CPU;