[Bf-blender-cvs] [acdbf71578d] blender2.8: Hair editing: Only tag Copy-on-Write when children are enabled

Sergey Sharybin noreply at git.blender.org
Fri Jun 15 17:25:05 CEST 2018


Commit: acdbf71578dbd1d5280d57c5276cda23b4044d4c
Author: Sergey Sharybin
Date:   Fri Jun 15 10:11:50 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBacdbf71578dbd1d5280d57c5276cda23b4044d4c

Hair editing: Only tag Copy-on-Write when children are enabled

Without children we only need to update batch cache. This way
we don't re-evaluate the whole modifier stack just to perform
child particles redistribution.

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

M	source/blender/editors/physics/particle_edit.c

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

diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index eeb14951d43..78cc47cd1ba 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -4005,7 +4005,12 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
 		if (edit->psys) {
 			WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
 			BKE_particle_batch_cache_dirty(edit->psys, BKE_PARTICLE_BATCH_DIRTY_ALL);
-			DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE);
+			if (pset->flag & PE_DRAW_PART) {
+				DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE);
+			}
+			else {
+				DEG_id_tag_update(&ob->id, DEG_TAG_SELECT_UPDATE);
+			}
 		}
 		else {
 			DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -4273,7 +4278,12 @@ static int shape_cut_exec(bContext *C, wmOperator *UNUSED(op))
 		if (edit->psys) {
 			WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
 			BKE_particle_batch_cache_dirty(edit->psys, BKE_PARTICLE_BATCH_DIRTY_ALL);
-			DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE);
+			if (pset->flag & PE_DRAW_PART) {
+				DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE);
+			}
+			else {
+				DEG_id_tag_update(&ob->id, DEG_TAG_SELECT_UPDATE);
+			}
 		}
 		else {
 			DEG_id_tag_update(&ob->id, OB_RECALC_DATA);



More information about the Bf-blender-cvs mailing list