{"record":{"id":"23bcecca263049ed","repo":"stride3d/stride","slug":"failed-to-find-index-buffer-while-building-a-convex-hull-23bcec","errorCode":null,"errorMessage":"Failed to find index buffer while building a convex hull.","messagePattern":"Failed to find index buffer while building a convex hull\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Assets/Physics/ColliderShapeAssetCompiler.cs","lineNumber":270,"sourceCode":"                                combinedVerts.Add(rotatedMatrix.TranslationVector.Z);\n\n                                vertexIndex += stride;\n                            }\n\n                            var indexBufferRef = AttachedReferenceManager.GetAttachedReference(meshData.Draw.IndexBuffer.Buffer);\n                            byte[] indexData;\n                            if (indexBufferRef.Data != null)\n                            {\n                                indexData = ((BufferData)indexBufferRef.Data).Content;\n                            }\n                            else if (!string.IsNullOrEmpty(indexBufferRef.Url))\n                            {\n                                var dataAsset = assetManager.Load<Buffer>(indexBufferRef.Url);\n                                indexData = dataAsset.GetSerializationData().Content;\n                            }\n                            else\n                            {\n                                throw new Exception(\"Failed to find index buffer while building a convex hull.\");\n                            }\n\n                            var indexIndex = meshData.Draw.IndexBuffer.Offset;\n                            for (var v = 0; v < meshData.Draw.IndexBuffer.Count; v++)\n                            {\n                                if (meshData.Draw.IndexBuffer.Is32Bit)\n                                {\n                                    combinedIndices.Add(BitConverter.ToUInt32(indexData, indexIndex) + indexOffset);\n                                    indexIndex += 4;\n                                }\n                                else\n                                {\n                                    combinedIndices.Add(BitConverter.ToUInt16(indexData, indexIndex) + indexOffset);\n                                    indexIndex += 2;\n                                }\n                            }\n                        }\n","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Assets/Physics/ColliderShapeAssetCompiler.cs#L252-L288","documentation":"ColliderShapeAssetCompiler's convex hull builder requires a separate index buffer asset referenced by the mesh. When the index buffer URL cannot be loaded (assetManager.Load<Buffer> fails or the reference is absent), the compiler throws this Exception. The mesh data itself loaded, but the companion index buffer is missing.","triggerScenarios":"A convex hull collider shape references a mesh whose IndexBuffer asset URL is null, was renamed, or was deleted from the asset project while building collider data in DoCommandOverride.","commonSituations":"Deleting or moving the buffer asset after setting up a convex hull collider, broken asset references after renaming in an IDE instead of the editor, or an asset import that never produced the index buffer.","solutions":["Re-link the collider's mesh/index buffer reference in the editor so it points to an existing Buffer asset","Re-import the source model so the index buffer asset is regenerated","Check the referenced Url exists in the asset output and fix the broken reference","Recreate the collider shape if the reference is stale"],"exampleFix":"// before: asset deleted, reference dangles\nvar shape = new ConvexHullColliderShapeDesc { IndexBuffer = deletedBufferRef };\n// after: re-import model then reference the regenerated buffer\nvar shape = new ConvexHullColliderShapeDesc { IndexBuffer = reimportedIndexBufferRef };","handlingStrategy":"validation","validationCode":"var url = convexHull.IndexBuffer?.Url;\nif (string.IsNullOrEmpty(url) || !projectAssetExists(url))\n    throw new InvalidOperationException($\"Index buffer asset '{url}' referenced by convex hull is missing\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Rename/delete assets only through the editor so references update","Re-import models after source changes instead of patching references","Periodically run asset reference validation on the project","Avoid hand-editing .sdfloat asset files"],"tags":["physics","convex-hull","asset-compilation"],"backgroundTag":"resource-not-found","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}