[Bf-blender-cvs] [17041bd895e] blender2.8: Depsgraph: Fix unwanted node tree copy-over

Sergey Sharybin noreply at git.blender.org
Tue Apr 17 12:53:37 CEST 2018


Commit: 17041bd895eadca1bff3bf88bc8b0f9982fe4573
Author: Sergey Sharybin
Date:   Tue Apr 17 12:47:28 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB17041bd895eadca1bff3bf88bc8b0f9982fe4573

Depsgraph: Fix unwanted node tree copy-over

Was caused by two things from the past:

- Tagging would set id->recalc to COW update flag.
  This one is to be ignored.

- Particle tagging will use psys recalc flags on id->recalc,
  but we only need to use flags from particles. Otherwise
  it will be some collisions in bit masks.

===================================================================

M	source/blender/depsgraph/intern/depsgraph_tag.cc
M	source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
M	source/blender/makesdna/DNA_ID.h

===================================================================

diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 6a6ebd1be44..bf5d594f97e 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -410,7 +410,7 @@ void deg_graph_id_tag_update(Main *bmain, Depsgraph *graph, ID *id, int flag)
 		}
 		deg_graph_id_tag_legacy_compat(bmain, id, (eDepsgraph_Tag)0);
 	}
-	id->recalc |= flag;
+	id->recalc |= (flag & PSYS_RECALC);
 	int current_flag = flag;
 	while (current_flag != 0) {
 		eDepsgraph_Tag tag =
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
index 91790522590..f6a37c49d32 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
@@ -649,7 +649,9 @@ ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph,
 				 * everything is done by node tree update function which
 				 * only copies socket values.
 				 */
-				const int ignore_flag = (ID_RECALC_DRAW | ID_RECALC_ANIMATION);
+				const int ignore_flag = (ID_RECALC_DRAW |
+				                         ID_RECALC_ANIMATION |
+				                         ID_RECALC_COPY_ON_WRITE);
 				if ((id_cow->recalc & ~ignore_flag) == 0) {
 					return id_cow;
 				}
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 778aaec7d19..ba4b0970313 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -460,6 +460,7 @@ enum {
 	LIB_TAG_NOT_ALLOCATED     = 1 << 16,
 };
 
+/* WARNING - when adding flags check on PSYS_RECALC */
 enum {
 	/* RESET_AFTER_USE, used by update code (depsgraph). */
 	ID_RECALC_NONE  = 0,



More information about the Bf-blender-cvs mailing list