-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bounds do not seem to get generated on a created mesh... #743
Comments
Hi @andypoly , I was about to look into it. Is there a reason you closed it? From the top of my head: If If you found a case where this does not work properly, please report with a sample file. Thanks |
Ah so I closed because I thought I should be putting in https://github.com/Unity-Technologies/com.unity.cloud.gltfast instead - I am a bit unclear! I have put it there also now. As I tried to explain the submesh bounds are indeed valid, but as the Unity docs say you still have to recalculate the bounds for the whole mesh (even if one submesh) so you can not skip that bit. I could provide a project example but not really got the time! |
Thanks, got it! I'll check that. For now it doesn't matter where you post the bug issue. |
ok thanks! Note one workaround I tried is you can manually set the msh bounds instead of RecalculateBounds if that is too much. |
I confirmed it's broken for single-submesh meshes (for others it mysteriously works). The fix is currently going through testing and will land in the next release. |
## [6.10.1] - 2025-01-09 ### Added - Test for `ConvertBoneWeightsUInt8ToFloatInterleavedJob` - Test for `ConvertBoneWeightsUInt16ToFloatInterleavedJob` - *BoundsTests* which certifies correct mesh bounds. ### Changed - Downgraded package dependencies to version bundled with Editor. - `com.unity.collections` to version `1.2.4` (from `1.5.1`) - `com.unity.mathematics` to version `1.2.6` (from `1.3.1`) - When a position accessor lacks min/max properties, the corresponding error message is communicated via the `ICodeLogger` instead of a plain console log. ### Fixed - Build error when used along with packages that depend on `com.unity.collections` versions older than 1.5 (e.g. Polyspatial 1.x; fixes [#730](atteneder/glTFast#730)). - Invalid mesh bounds on meshes with one submesh (fixes [#743](atteneder/glTFast#743)). ### Removed ### Deprecated ### Security
fixed in 6.10.1 |
* feat(test): Added mesh bounds checks. * fix: Invalid mesh bounds on meshes with one submesh. fixes atteneder#743 * refactor: Removed unused parameter. * fix: Typo * fix: Updated number of test assets. * fix(test): Moved *Bounds* model into dedicated folder in order to fix editor importer tests.
Describe the bug
MeshGenerator calls GenerateMesh(),CreateMeshResultAsync which checks for "boundsAreValid".
If they are then it never calls msh.RecalculateBounds() which means post-load the mesh does not have any bounds applied (they are centre 0, size 0).
Expected behavior
Any generated meshes should have RecalculateBounds() called on them.
See https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Mesh.SetSubMesh.html
It says "Note that this only applies to the bounds of the SubMesh. You must call Mesh.RecalculateBounds to recalculate the bounds of the Mesh itself."
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
LATEST
2022.3.41
Builtin - but NA
Editor
The text was updated successfully, but these errors were encountered: