[Bf-blender-cvs] [e4df8b005fe] master: Fix T64805: Can't generate particle hair edit 'comb cache' in blender 2.8

Sergey Sharybin noreply at git.blender.org
Tue Jul 2 15:19:25 CEST 2019


Commit: e4df8b005fef68a58a60e277286e689cf5dbac95
Author: Sergey Sharybin
Date:   Mon Jul 1 16:11:43 2019 +0200
Branches: master
https://developer.blender.org/rBe4df8b005fef68a58a60e277286e689cf5dbac95

Fix T64805: Can't generate particle hair edit 'comb cache' in blender 2.8

Reviewers: brecht

Reviewed By: brecht

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

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

M	source/blender/modifiers/intern/MOD_particlesystem.c

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

diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c
index 5d7b380a751..021e61bd46d 100644
--- a/source/blender/modifiers/intern/MOD_particlesystem.c
+++ b/source/blender/modifiers/intern/MOD_particlesystem.c
@@ -138,8 +138,16 @@ static void deformVerts(ModifierData *md,
     }
     /* TODO(sergey): This is not how particles were working prior to copy on
      * write, but now evaluation is similar to case when one duplicates the
-     * object. In that case particles were doing reset here. */
-    psys->recalc |= ID_RECALC_PSYS_RESET;
+     * object. In that case particles were doing reset here.
+     *
+     * Don't do reset when entering particle edit mode, as that will destroy the edit mode data.
+     * Shouldn't be an issue, since particles are supposed to be evaluated once prior to entering
+     * edit mode anyway.
+     * Could in theory be an issue when everything is done in a script, but then solution is
+     * not known to me. */
+    if (ctx->object->mode != OB_MODE_PARTICLE_EDIT) {
+      psys->recalc |= ID_RECALC_PSYS_RESET;
+    }
   }
 
   /* make new mesh */
@@ -193,10 +201,10 @@ static void deformVerts(ModifierData *md,
                          psmd->mesh_final->totedge != psmd->totdmedge ||
                          psmd->mesh_final->totface != psmd->totdmface)) {
     psys->recalc |= ID_RECALC_PSYS_RESET;
-    psmd->totdmvert = psmd->mesh_final->totvert;
-    psmd->totdmedge = psmd->mesh_final->totedge;
-    psmd->totdmface = psmd->mesh_final->totface;
   }
+  psmd->totdmvert = psmd->mesh_final->totvert;
+  psmd->totdmedge = psmd->mesh_final->totedge;
+  psmd->totdmface = psmd->mesh_final->totface;
 
   if (!(ctx->object->transflag & OB_NO_PSYS_UPDATE)) {
     struct Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);



More information about the Bf-blender-cvs mailing list