02-02-2026, 02:37 PM
(This post was last modified: 02-02-2026, 02:52 PM by Eritar.
Edit Reason: Code blocks formatting
)
Hi!
I'm trying to test the Obi Softbody add-on, and I need to retrieve the mesh data from the SkinnedMeshRenderer.
In my current implementation (without softbody), I set three Graphics Buffers of position, normal and tangent streams of the SkinnedMeshRenderer, and then access their offsets.
However, when I try to skin the SMR with Softbody Skinner, I retrieve initial vertex data like it was in the viewport before the simulation.
As far as I understand, Softbody Skinner should update skinned mesh renderer buffers after a simulation tick, and it should work, but I'm obviously missing something.
Thank you very much for your time!
I'm trying to test the Obi Softbody add-on, and I need to retrieve the mesh data from the SkinnedMeshRenderer.
In my current implementation (without softbody), I set three Graphics Buffers of position, normal and tangent streams of the SkinnedMeshRenderer, and then access their offsets.
However, when I try to skin the SMR with Softbody Skinner, I retrieve initial vertex data like it was in the viewport before the simulation.
As far as I understand, Softbody Skinner should update skinned mesh renderer buffers after a simulation tick, and it should work, but I'm obviously missing something.
Code:
TryGetComponent<SkinnedMeshRenderer>(out var smr);
Mesh skinMesh = smr.sharedMesh;
using GraphicsBuffer skinPositionsBuffer = smr.GetVertexBuffer();
using GraphicsBuffer skinNormalsBuffer = smr.GetVertexBuffer();
using GraphicsBuffer skinTangentsBuffer = smr.GetVertexBuffer();
int[] skinPositionStrideOffset =
{
skinMesh.GetVertexBufferStride(positionStream),
skinMesh.GetVertexAttributeOffset(VertexAttribute.Position),
};
int[] skinNormalStrideOffset =
{
skinMesh.GetVertexBufferStride(normalStream),
skinMesh.GetVertexAttributeOffset(VertexAttribute.Normal),
};
int[] skinTangentStrideOffset =
{
skinMesh.GetVertexBufferStride(tangentStream),
skinMesh.GetVertexAttributeOffset(VertexAttribute.Tangent),
};Thank you very much for your time!

