NativeArray version of GetBindposes() seems to give us direct pointer of the buffer but its length is fixed to existing bindposeCount.
It will not work with runtime generated mesh because old .bindposes property is probably the only way to change bindposeCount dynamically. And it is inefficient.
Tnanks!
Edit:
I could not find out how bindposeCount is determined for runtime-generated mesh in the document.
But if bindposeCount is automatically calculated when all bone indices decided like by calling
SetBoneWeights(NativeArray bonesPerVertex,NativeArray weights), it is enough for my use case.(I will check that when I have time)
But even if so, it is very unclear. Either way, to replace bindposes property properly, SetBindposes should exist, I suppose.
I added GetBindposes in 2022, but failed to add the setter that takes a NativeArray too.
I’m adding it right now - but it won’t appear until Unity 2023.
Thanks a lot! I’ve almost given up it.
Actually I did avoid this problem by having bindposes by myself, but it was possible because I have written entirely custom solution for animation-skinning and asset definitions like mesh. It is not a normal way to avoid this issue so I am glad to have such a common solution for this problem.
Anyway, I really do appreciate the fact that you guys doing very well to make us achieve high performance things recently.
Would it be possible to get these bindpose APIs on MeshData in 2023 as well? It’s often the one thing I have to jump back onto the main thread for when processing mesh data.
I’ve discussed this with the team that looks after the mesh api, and they are planning improvements to expose access to all skin weights, blend shapes etc, but this task is still being designed/discussed, so we’re not going to add this method into the MeshData until the team have fully decided how the larger api changes should look.
Hi, unfortunately, this work has been repeatedly deprioritized in favor of other tasks, so I don’t have much of an update to provide. The API is not available in versions 6.0 or 6.1. I have forwarded your message to the area’s product manager to ensure this topic is discussed at our next meeting. As Richard mentioned, there are still some details to be determined but we understand your need and recognize the use case.