diff options
author | Hans Goudey <h.goudey@me.com> | 2022-02-21 21:07:14 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-02-21 21:07:14 +0300 |
commit | 9762dbe94e65e4f42061fdbb941a4c12660a6722 (patch) | |
tree | c8cb1d42a8889ae9e07494e2a591b49cbfe4da6b /source/blender/python | |
parent | 68a2dc58dee719dc37a0ba2b84c5488999c2a458 (diff) | |
parent | be6bcaa8c13dfca98e56d81afd3d19ba226c2699 (diff) |
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/mathutils/mathutils_bvhtree.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/python/mathutils/mathutils_bvhtree.c b/source/blender/python/mathutils/mathutils_bvhtree.c index 8adde14d82f..ead255a6716 100644 --- a/source/blender/python/mathutils/mathutils_bvhtree.c +++ b/source/blender/python/mathutils/mathutils_bvhtree.c @@ -1166,10 +1166,8 @@ static PyObject *C_BVHTree_FromObject(PyObject *UNUSED(cls), PyObject *args, PyO tree = BLI_bvhtree_new((int)tris_len, epsilon, PY_BVH_TREE_TYPE_DEFAULT, PY_BVH_AXIS_DEFAULT); if (tree) { orig_index = MEM_mallocN(sizeof(*orig_index) * (size_t)tris_len, __func__); - CustomData *pdata = &mesh->pdata; - orig_normal = CustomData_get_layer(pdata, CD_NORMAL); /* can be NULL */ - if (orig_normal) { - orig_normal = MEM_dupallocN(orig_normal); + if (!BKE_mesh_poly_normals_are_dirty(mesh)) { + orig_normal = MEM_dupallocN(BKE_mesh_poly_normals_ensure(mesh)); } for (i = 0; i < tris_len; i++, lt++) { |