* Clamp invalid per-face slot numbers to match rendering logic.
* When objects have no slots, ensure faces get assigned to an empty slot.
* Refactor code to avoid strong coupling between far away code.
Pull Request: https://projects.blender.org/blender/blender/pulls/132728