[Bf-blender-cvs] [67fc4f4bedd] master: Fix T66267: only add DEG cloth collision relations if collisions are enabled

Philipp Oeser noreply at git.blender.org
Mon Jul 1 12:34:09 CEST 2019


Commit: 67fc4f4bedded86a04d2bf98ca1642a12d9662b3
Author: Philipp Oeser
Date:   Mon Jul 1 11:32:10 2019 +0200
Branches: master
https://developer.blender.org/rB67fc4f4bedded86a04d2bf98ca1642a12d9662b3

Fix T66267: only add DEG cloth collision relations if collisions are
enabled

was detecting unneccessary dependency cycle

Reviewers: sergey, brecht

Maniphest Tasks: T66267

Differential Revision: https://developer.blender.org/D5160

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

M	source/blender/makesrna/intern/rna_cloth.c
M	source/blender/modifiers/intern/MOD_cloth.c

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

diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index c93833ef493..548ed656d7b 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -824,7 +824,7 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
   prop = RNA_def_property(srna, "use_collision", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_ENABLED);
   RNA_def_property_ui_text(prop, "Enable Collision", "Enable collisions with other objects");
-  RNA_def_property_update(prop, 0, "rna_cloth_update");
+  RNA_def_property_update(prop, 0, "rna_cloth_dependency_update");
 
   prop = RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_DISTANCE);
   RNA_def_property_float_sdna(prop, NULL, "epsilon");
diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c
index 3c4dd9f2c56..1a6d172d2f9 100644
--- a/source/blender/modifiers/intern/MOD_cloth.c
+++ b/source/blender/modifiers/intern/MOD_cloth.c
@@ -125,12 +125,14 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
 {
   ClothModifierData *clmd = (ClothModifierData *)md;
   if (clmd != NULL) {
-    DEG_add_collision_relations(ctx->node,
-                                ctx->object,
-                                clmd->coll_parms->group,
-                                eModifierType_Collision,
-                                NULL,
-                                "Cloth Collision");
+    if (clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_ENABLED) {
+      DEG_add_collision_relations(ctx->node,
+                                  ctx->object,
+                                  clmd->coll_parms->group,
+                                  eModifierType_Collision,
+                                  NULL,
+                                  "Cloth Collision");
+    }
     DEG_add_forcefield_relations(
         ctx->node, ctx->object, clmd->sim_parms->effector_weights, true, 0, "Cloth Field");
   }



More information about the Bf-blender-cvs mailing list