[Bf-blender-cvs] [aa312621dc3] blender2.8: Particle edit: Re-cache edit path if it's NULL
Sergey Sharybin
noreply at git.blender.org
Tue May 15 17:21:31 CEST 2018
Commit: aa312621dc33253bcf2f8947f42d23fe93a77468
Author: Sergey Sharybin
Date: Tue May 15 11:41:30 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBaa312621dc33253bcf2f8947f42d23fe93a77468
Particle edit: Re-cache edit path if it's NULL
This is what old particle drawing code was doing.
===================================================================
M source/blender/draw/modes/particle_mode.c
===================================================================
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,
More information about the Bf-blender-cvs
mailing list