Now that we have new GetBindposes in 2022.2, How about SetBindposes?

I would like to SetBindposes with NativeArray.

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.

2 Likes

Hey, you’re absolutely right.

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 for reporting it!

6 Likes

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.

1 Like

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.

1 Like

Thanks for the additional feedback!

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.

But it will be coming at some point :slight_smile:

4 Likes

Would it be possible to get an update on this?

I would like to be able to set bind poses and bone weights using the MeshData API.

I am doing procedural skinning during world creation in my project and it’s lame having to go back to the main thread.

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.

1 Like