[Bf-blender-cvs] [a54235e0c63] blender2.8: Particle mode: Support children drawing

Sergey Sharybin noreply at git.blender.org
Thu Jun 7 11:35:31 CEST 2018


Commit: a54235e0c6345faed6b7f709039ff6efa64d2549
Author: Sergey Sharybin
Date:   Thu Jun 7 11:25:13 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBa54235e0c6345faed6b7f709039ff6efa64d2549

Particle mode: Support children drawing

The issue is that children drawing is done by object mode,
which operates with data from evaluated context. But that
data needs edit mode's cache to be properly updated first.

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

M	source/blender/blenkernel/intern/particle_system.c
M	source/blender/makesrna/intern/rna_sculpt_paint.c

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

diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index a2d9891ec2d..8d6991ff9f4 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -4217,6 +4217,18 @@ void particle_system_update(struct Depsgraph *depsgraph, Scene *scene, Object *o
 	if (!psys_check_enabled(ob, psys, use_render_params))
 		return;
 
+	if (DEG_is_active(depsgraph)) {
+		if (psys->orig_psys != NULL && psys->orig_psys->edit != NULL) {
+			psys_cache_edit_paths(
+			        depsgraph,
+			        (Scene *)DEG_get_original_id(&scene->id),
+			        DEG_get_original_object(ob),
+			        psys->orig_psys->edit,
+			        DEG_get_ctime(depsgraph),
+			        DEG_get_mode(depsgraph) == DAG_EVAL_RENDER);
+		}
+	}
+
 	cfra = DEG_get_ctime(depsgraph);
 
 	sim.depsgraph = depsgraph;
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 12b080a9284..a26aceda3b9 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -162,6 +162,8 @@ static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr))
 	if (!edit)
 		return;
 
+	if (ob) DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
+
 	BKE_particle_batch_cache_dirty(edit->psys, BKE_PARTICLE_BATCH_DIRTY_ALL);
 	psys_free_path_cache(edit->psys, edit);
 	DEG_id_tag_update(&CTX_data_scene(C)->id, DEG_TAG_COPY_ON_WRITE);



More information about the Bf-blender-cvs mailing list