Hair editing: Use original object's particles for drawing

This allows to rely on brush to update children positions,
and avoid tag of object. Makes it way faster to comb with
children enabled.
This commit is contained in:
2018-06-15 17:22:31 +02:00
parent 5ac7068c5f
commit ca2be6912d
2 changed files with 46 additions and 22 deletions

View File

@@ -4232,12 +4232,7 @@ 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);
}
DEG_id_tag_update(&ob->id, DEG_TAG_SELECT_UPDATE);
}
else {
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -4505,12 +4500,7 @@ 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);
}
DEG_id_tag_update(&ob->id, DEG_TAG_SELECT_UPDATE);
}
else {
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);