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.
This commit is contained in:
2018-06-15 10:11:50 +02:00
parent ed3d693cb1
commit acdbf71578

View File

@@ -4005,8 +4005,13 @@ 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);
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);
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
@@ -4273,8 +4278,13 @@ 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);
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);
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);