{"record":{"id":"5a3a3b6b7cfa61d3","repo":"BabylonJS/Babylon.js","slug":"babylonscenepathtoobjectconverter-nested-property","errorCode":null,"errorMessage":"BabylonScenePathToObjectConverter: nested property paths are not yet supported (path \"${path}\").","messagePattern":"BabylonScenePathToObjectConverter: nested property paths are not yet supported \\(path \"(.+?)\"\\)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dev/loaders/src/glTF/2.0/Extensions/babylonScenePathToObjectConverter.ts","lineNumber":184,"sourceCode":"        if (!instance) {\r\n            throw new Error(`BabylonScenePathToObjectConverter: no ${collectionName} instance found with uniqueId ${uniqueId} (path \"${path}\").`);\r\n        }\r\n\r\n        // No property after the id → the ref itself is just a handle to the instance.\r\n        // The accessor's `get` and `getTarget` both return the instance.\r\n        if (parts.length === 2) {\r\n            return {\r\n                object: instance,\r\n                info: this._buildIdentityAccessor(instance),\r\n            };\r\n        }\r\n\r\n        // Walk the leaf descriptors for the requested property path. We keep this\r\n        // very simple right now: only one segment after the id is supported, which\r\n        // covers every property the initial leaves expose. Nested paths can be\r\n        // added later by extending the walker.\r\n        if (parts.length > 3) {\r\n            throw new Error(`BabylonScenePathToObjectConverter: nested property paths are not yet supported (path \"${path}\").`);\r\n        }\r\n        const propertyName = parts[2];\r\n        const leaf = (collection.__array__ as Record<string, IObjectAccessor<any, any, any> | boolean | undefined>)[propertyName];\r\n        if (!leaf || typeof leaf === \"boolean\") {\r\n            throw new Error(`BabylonScenePathToObjectConverter: property \"${propertyName}\" is not registered on ${collectionName} (path \"${path}\").`);\r\n        }\r\n\r\n        return {\r\n            object: instance,\r\n            info: leaf as AnyAccessor,\r\n        };\r\n    }\r\n\r\n    private _getCollectionArray(collectionName: string): readonly any[] {\r\n        switch (collectionName) {\r\n            case \"transformNodes\":\r\n                return this._scene.transformNodes;\r\n            case \"meshes\":\r","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/loaders/src/glTF/2.0/Extensions/babylonScenePathToObjectConverter.ts#L166-L202","documentation":"The current walker supports exactly one property segment after the instance id (path length of at most 3 segments: prefix + collection + id + property). Deeper nested paths — e.g. \".../meshes/7/position/x\" — are explicitly rejected with this error, since nested property traversal is not yet implemented for the Babylon scene-object leaves.","triggerScenarios":"convert() called with more than three slash-separated segments after the prefix, such as \".../transformNodes/42/position/x\", \".../meshes/9/rotationQuaternion/y\", or any property-of-property reference.","commonSituations":"Porting paths written for the generic glTF animation-pointer style (which allows nested traversal) to the Babylon converter; assuming sub-component addressing like vector components works; generating paths from a generic schema that doesn't know this converter's one-segment limit.","solutions":["Flatten the path to a single registered property, e.g. use \".../transformNodes/42/position\" instead of \".../transformNodes/42/position/x\".","If you need the sub-component, read the returned accessor's value and index into it yourself after conversion.","Check which leaf properties the collection exposes (__array__ descriptors) and address only those directly; extend the walker if nested support is genuinely required."],"exampleFix":"// before\nconverter.convert(`${prefix}transformNodes/42/position/x`); // nested\n// after\nconst info = converter.convert(`${prefix}transformNodes/42/position`);\nconst x = info.accessor.get()[0];","handlingStrategy":"validation","validationCode":"const parts = path.slice(BABYLON_SCENE_OBJECT_MODEL_PREFIX.length).split(\"/\").filter(Boolean);\nif (parts.length > 3) {\n  throw new Error(`Nested property paths unsupported: ${path}`);\n}\nconverter.convert(path);","typeGuard":"function isShallowPropertyPath(path: string): boolean {\n  const parts = path.slice(BABYLON_SCENE_OBJECT_MODEL_PREFIX.length).split(\"/\").filter(Boolean);\n  return parts.length <= 3;\n}","tryCatchPattern":"try {\n  const info = converter.convert(path);\n} catch (e) {\n  // nested path: fall back to the single-property accessor and index manually\n}","preventionTips":["Address only top-level registered properties; fetch sub-components from the accessor value yourself","Validate segment count (<= 3 after prefix) in path builders","Document the one-segment property limit for anyone writing pointers"],"tags":["gltf","json-pointer","babylon","unsupported-feature"],"backgroundTag":"nested-path-unsupported","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}