diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-15 12:41:30 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-15 18:20:02 +0300 |
commit | aa312621dc33253bcf2f8947f42d23fe93a77468 (patch) | |
tree | 5f36154555539c99b579c091bd7ad569a88cff83 | |
parent | 979c48fd66e73d649fd674b349e40820773a7229 (diff) |
Particle edit: Re-cache edit path if it's NULL
This is what old particle drawing code was doing.
-rw-r--r-- | source/blender/draw/modes/particle_mode.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/draw/modes/particle_mode.c b/source/blender/draw/modes/particle_mode.c index 7f1a62a88ce..49e7d24c113 100644 --- a/source/blender/draw/modes/particle_mode.c +++ b/source/blender/draw/modes/particle_mode.c @@ -149,13 +149,20 @@ static void draw_update_ptcache_edit(Object *object_eval, /* NOTE: Get flag from particle system coming from drawing object. * this is where depsgraph will be setting flags to. */ + const DRWContextState *draw_ctx = DRW_context_state_get(); + Scene *scene_orig = (Scene *)DEG_get_original_id(&draw_ctx->scene->id); + Object *object_orig = DEG_get_original_object(object_eval); if (psys->flag & PSYS_HAIR_UPDATED) { - const DRWContextState *draw_ctx = DRW_context_state_get(); - Scene *scene_orig = (Scene *)DEG_get_original_id(&draw_ctx->scene->id); - Object *object_orig = DEG_get_original_object(object_eval); PE_update_object(draw_ctx->depsgraph, scene_orig, object_orig, 0); } - BLI_assert(edit->pathcache != NULL); + if (edit->pathcache == NULL) { + Depsgraph *depsgraph = draw_ctx->depsgraph; + psys_cache_edit_paths(depsgraph, + scene_orig, object_orig, + edit, + DEG_get_ctime(depsgraph), + DEG_get_mode(depsgraph) == DAG_EVAL_RENDER); + } } static void particle_edit_cache_populate(void *vedata, |