Fix procedural Skinned Mesh creation from code

https://forum.flaxengine.com/t/issues-with-creating-skinnedmodel-procedurally/2627
This commit is contained in:
2026-06-29 15:18:21 +02:00
parent 42b701e969
commit 593b989958
2 changed files with 3 additions and 5 deletions
+1 -2
View File
@@ -70,8 +70,7 @@ namespace
if (accessor.AllocateBuffer(MeshBufferType::Vertex0, vertexCount, vb0layout))
return true;
auto positionStream = accessor.Position();
ASSERT(positionStream.IsLinear(PixelFormat::R32G32B32_Float));
positionStream.SetLinear(vertices);
positionStream.Set(Span<Float3>(vertices, vertexCount));
}
// Vertex Buffer 1 (general purpose components)
@@ -44,7 +44,7 @@ namespace
// Index Buffer
{
if (accessor.AllocateBuffer(MeshBufferType::Index, triangleCount, indexFormat))
if (accessor.AllocateBuffer(MeshBufferType::Index, triangleCount * 3, indexFormat))
return true;
auto indexStream = accessor.Index();
ASSERT(indexStream.IsLinear(indexFormat));
@@ -73,8 +73,7 @@ namespace
return true;
auto positionStream = accessor.Position();
ASSERT(positionStream.IsLinear(PixelFormat::R32G32B32_Float));
positionStream.SetLinear(vertices);
positionStream.Set(Span<Float3>(vertices, vertexCount));
if (normals)
{
auto normalStream = accessor.Normal();