Same as 9f30555faf but the fix had to change a bit in `main` compared to `blender-v3.6-release` due to a refactor.
9f30555faf