{"record":{"id":"d36ab52e07ba73f3","repo":"BabylonJS/Babylon.js","slug":"nodeindex-not-found-in-configuration-d36ab5","errorCode":null,"errorMessage":"nodeIndex not found in configuration","messagePattern":"nodeIndex not found in configuration","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dev/loaders/src/glTF/2.0/Extensions/KHR_node_selectability.pure.ts","lineNumber":126,"sourceCode":"                isVariable: true,\r\n            },\r\n            {\r\n                input: \"object\",\r\n                output: \"pickedMesh\",\r\n                inputBlockIndex: 2,\r\n                outputBlockIndex: 0,\r\n                isVariable: true,\r\n            },\r\n        ],\r\n        extraProcessor(gltfBlock, _declaration, _mapping, _arrays, serializedObjects, context, globalGLTF) {\r\n            // add the glTF to the configuration of the last serialized object\r\n            const serializedObject = serializedObjects[serializedObjects.length - 1];\r\n            serializedObject.config = serializedObject.config || {};\r\n            serializedObject.config.glTF = globalGLTF;\r\n            // find the listener nodeIndex value\r\n            const nodeIndex = gltfBlock.configuration?.[\"nodeIndex\"]?.value?.[0];\r\n            if (nodeIndex === undefined || typeof nodeIndex !== \"number\") {\r\n                throw new Error(\"nodeIndex not found in configuration\");\r\n            }\r\n            const variableName = \"pickedMesh_\" + nodeIndex;\r\n            // find the nodeIndex value\r\n            serializedObjects[1].config.variable = variableName;\r\n            context._userVariables[variableName] = {\r\n                className: \"Mesh\",\r\n                id: globalGLTF?.nodes?.[nodeIndex]._babylonTransformNode?.id,\r\n                uniqueId: globalGLTF?.nodes?.[nodeIndex]._babylonTransformNode?.uniqueId,\r\n            };\r\n            return serializedObjects;\r\n        },\r\n    });\r\n\r\n    AddObjectAccessorToKey(\"/nodes/{}/extensions/KHR_node_selectability/selectable\", {\r\n        get: (node: INode) => {\r\n            const tn = node._babylonTransformNode as any;\r\n            if (tn && tn.isPickable !== undefined) {\r\n                return tn.isPickable;\r","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/loaders/src/glTF/2.0/Extensions/KHR_node_selectability.pure.ts#L108-L144","documentation":"KHR_node_selectability attaches pick handlers by reading a numeric nodeIndex from the glTF block configuration and creating a 'pickedMesh_<index>' user variable. If the configuration block lacks a valid numeric nodeIndex, the extension cannot wire the selection logic and throws.","triggerScenarios":"Loading a glTF whose KHR_node_selectability serialized blocks are missing configuration['nodeIndex'] (or it is not a number) during extraProcessor.","commonSituations":"Assets written by hand or by exporters that don't populate block configuration; post-processing pipelines that rewrite NodeMaterial JSON and lose configuration entries.","solutions":["Add configuration.nodeIndex = { value: [<node index>] } to the offending block in the glTF.","Re-export the asset with correct KHR_node_selectability data.","Remove the extension if mesh selection is not required."],"exampleFix":"// before\n\"configuration\": null\n// after\n\"configuration\": { \"nodeIndex\": { \"value\": [12] } }","handlingStrategy":"validation","validationCode":"const idx = selectBlock?.configuration?.nodeIndex?.value?.[0];\nif (typeof idx !== 'number') throw new Error('KHR_node_selectability block missing numeric nodeIndex');","typeGuard":"function isSelectableBlock(block: any): boolean {\n  return typeof block?.configuration?.['nodeIndex']?.value?.[0] === 'number';\n}","tryCatchPattern":"try { await loader.loadAsync(url); } catch (e) {\n  if (e.message.includes('nodeIndex not found')) {\n    // proceed without selection handlers or repair the asset\n  } else throw e;\n}","preventionTips":["Lint glTF assets for KHR_node_selectability configuration before load.","Avoid hand-editing serialized NodeMaterial blocks; re-export instead.","Document required configuration keys for in-house exporters."],"tags":["gltf","extensions","configuration","picking"],"backgroundTag":"missing-config-key","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}