Cleanup: simplify sorting during uv packing

Prevent double-sorting during uv packing with bounding-box packing.

Slight speed improvement, slight packing efficiency improvement.
This commit is contained in:
2023-03-30 11:30:49 +13:00
parent a62f6c8290
commit 9ea6771d10
4 changed files with 14 additions and 7 deletions

View File

@@ -1404,8 +1404,9 @@ static PyObject *M_Geometry_box_pack_2d(PyObject *UNUSED(self), PyObject *boxlis
return NULL; /* exception set */
}
const bool sort_boxes = true; /* Caution: BLI_box_pack_2d sorting is non-deterministic. */
/* Non Python function */
BLI_box_pack_2d(boxarray, len, &tot_width, &tot_height);
BLI_box_pack_2d(boxarray, len, sort_boxes, &tot_width, &tot_height);
boxPack_ToPyObject(boxlist, boxarray);
MEM_freeN(boxarray);