From 8a1860bd9aecddf611b64e3e842bdc8c76f15cc6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 14 Jun 2021 22:56:03 +1000 Subject: BMesh: support face-normal calculation in normal & looptri functions Support calculating face normals when tessellating. When this is done before updating vertex normals it gives ~20% performance improvement. Now vertex normal calculation only needs to perform a single pass on the mesh vertices when called after tessellation. Extended versions of normal & looptri update functions have been added: - BM_mesh_calc_tessellation_ex - BM_mesh_normals_update_ex Most callers don't need to be aware of this detail by using: - BKE_editmesh_looptri_and_normals_calc - BKE_editmesh_looptri_and_normals_calc_with_partial - EDBM_update also takes advantage of this, where calling EDBM_update with calc_looptri & calc_normals enabled uses the faster normal updating logic. --- source/blender/editors/object/object_relations.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/blender/editors/object/object_relations.c') diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index f3433833b5f..cdf12bcb5df 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -153,8 +153,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op) em = me->edit_mesh; - EDBM_mesh_normals_update(em); - BKE_editmesh_looptri_calc(em); + BKE_editmesh_looptri_and_normals_calc(em); /* Make sure the evaluated mesh is updated. * -- cgit v1.2.3