[Bf-blender-cvs] [f314d9ce474] blender2.8: Depsgrapph: Fix/workaround for missing hair

Sergey Sharybin noreply at git.blender.org
Wed Jan 17 11:23:33 CET 2018


Commit: f314d9ce474924a972b89fba4c8a6ba1c0aeb4b3
Author: Sergey Sharybin
Date:   Wed Jan 17 11:18:52 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBf314d9ce474924a972b89fba4c8a6ba1c0aeb4b3

Depsgrapph: Fix/workaround for missing hair

The issue was happening because dependency graph did not inform particle
settings as modified. This is a regression caused by tagging and flushing
mechanism refactor.

The real fix would be to make particle settings to use ID level recalc flags
rather than own flags, which will also simplify relations around particle system,
and particle settings evaluation.

Reported by Mai in IRC.

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

M	source/blender/depsgraph/intern/depsgraph_tag.cc

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

diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index b2e32b766e7..f364ac52b38 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -189,7 +189,24 @@ void depsgraph_tag_to_component_opcode(const ID *id,
 		case DEG_TAG_PSYS_TYPE:
 		case DEG_TAG_PSYS_CHILD:
 		case DEG_TAG_PSYS_PHYS:
-			*component_type = DEG_NODE_TYPE_EVAL_PARTICLES;
+			if (id_type == ID_PA) {
+				/* NOTES:
+				 * - For particle settings node we need to use different
+				 *   component. Will be nice to get this unified with object,
+				 *   but we can survive for now with single exception here.
+				 *   Particles needs reconsideration anyway,
+				 * - We do direct injection of particle settings recalc flag
+				 *   here. This is what we need to do for until particles
+				 *   are switched away from own recalc flag and are using
+				 *   ID->recalc flags instead.
+				 */
+				ParticleSettings *particle_settings = (ParticleSettings *)id;
+				particle_settings->recalc |= (tag & DEG_TAG_PSYS_ALL);
+				*component_type = DEG_NODE_TYPE_PARAMETERS;
+			}
+			else {
+				*component_type = DEG_NODE_TYPE_EVAL_PARTICLES;
+			}
 			break;
 		case DEG_TAG_COPY_ON_WRITE:
 			*component_type = DEG_NODE_TYPE_COPY_ON_WRITE;



More information about the Bf-blender-cvs mailing list