diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-01 17:11:43 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-02 16:19:02 +0300 |
commit | e4df8b005fef68a58a60e277286e689cf5dbac95 (patch) | |
tree | 11e32ca0cb3a16da39bfc493602c736b9a0af1e5 /source/blender/modifiers/intern | |
parent | 26e6bb3fa371047e6d8d6f920128af1bcd0cfe65 (diff) |
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
Diffstat (limited to 'source/blender/modifiers/intern')
-rw-r--r-- | source/blender/modifiers/intern/MOD_particlesystem.c | 18 |
1 files changed, 13 insertions, 5 deletions
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); |