Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-05-11 13:18:37 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-05-11 13:49:25 +0300
commitff3e9d0d90e105e0b6c9cd6e09189f420268d9ec (patch)
tree4a308f081911e00569ecbac0f56182b5d7d2983a
parent96584818b73ba7d248a6a495b5ce652e5677bce4 (diff)
Particle edit: Fix missing update after undo
Old code was doing draw-time calculations in some cases. just do the same for now.
-rw-r--r--source/blender/draw/modes/particle_mode.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/draw/modes/particle_mode.c b/source/blender/draw/modes/particle_mode.c
index b5a45a7e92d..dc08ba63cb3 100644
--- a/source/blender/draw/modes/particle_mode.c
+++ b/source/blender/draw/modes/particle_mode.c
@@ -139,10 +139,25 @@ static void particle_cache_init(void *vedata)
DRW_shgroup_uniform_float(stl->g_data->tip_points_group, "outlineWidth", &outline_width, 1);
}
-static void particle_edit_cache_populate(void *vedata, PTCacheEdit *edit)
+static void draw_update_ptcache_edit(Object *object, PTCacheEdit *edit)
+{
+ if (edit->psys && edit->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);
+ PE_update_object(draw_ctx->depsgraph, scene_orig, object_orig, 0);
+ }
+ BLI_assert(edit->pathcache != NULL);
+}
+
+
+static void particle_edit_cache_populate(void *vedata,
+ Object *object,
+ PTCacheEdit *edit)
{
PARTICLE_StorageList *stl = ((PARTICLE_Data *)vedata)->stl;
const DRWContextState *draw_ctx = DRW_context_state_get();
+ draw_update_ptcache_edit(object, edit);
ParticleEditSettings *pset = PE_settings(draw_ctx->scene);
{
struct Gwn_Batch *strands = DRW_cache_particles_get_edit_strands(edit);
@@ -171,7 +186,7 @@ static void particle_cache_populate(void *vedata, Object *object)
if (edit == NULL) {
continue;
}
- particle_edit_cache_populate(vedata, edit);
+ particle_edit_cache_populate(vedata, object, edit);
break;
}
}