[Feature Request] Cloth.vertices without Garbage generation

Feature Request:

Please could you add API hooks for getting the vertices/normals from cloth without GC allocations?

Something like GetVertices(Vertices[ ] myArray) would be great.

The same thing already exists in Mesh.GetVertices to avoid GC allocs.

Currently we’re attaching items to cloth vertices, so each frame we’re calling the vertices property, and with 12 characters and 20 attachments that quickly becomes about 2MB per frame :frowning: We can’t have smooth playback as the garbage collection happens too frequently and takes too long.

I think it should be quite an easy thing to add to the API.

Please let me know your thoughts.

Thanks,

Hey Andrew, we actually have a pull request for this, in the queues for being merged. Hopefully a back-port is an option too. I’ll let @SeanParkinson update you.

1 Like

Oh this is music to my ears :slight_smile: Thanks for the update - super appreciated to be kept in the loop! I will not submit the bug-report for this one then.

Yeah, this won’t get accepted as a bug report - because it may be treated as a feature request if you take into consideration that .normals and .vertices allocating API was added a while back, before we had this focus on performance by default. Thanks for the heads up.

bump :wink: any idea what the status is of that pull request?

bump anyone know when this pull request might come through? :slight_smile: