The SceneObject's meshes list still carries a SceneMesh that
has been destroyed (or was never registered in the SceneModel).
SceneObject.removeMesh refuses to operate on missing meshes —
it requires the mesh to exist in the model — so this strategy
splices the stale entry out of the array directly.
The meshes array is readonly at the type level only; runtime
mutation is the SDK-internal pattern for this rare case. After
the splice the SceneObject is well-formed again.
The fix scans every entry in the SceneObject's meshes array
(not just the one named in context.danglingMeshId) so a single
pass clears every dangling reference, even if the inspection
only flagged one.
Auto-fix for
OBJECT_DANGLING_MESH.The SceneObject's
mesheslist still carries a SceneMesh that has been destroyed (or was never registered in the SceneModel).SceneObject.removeMeshrefuses to operate on missing meshes — it requires the mesh to exist in the model — so this strategy splices the stale entry out of the array directly.The
meshesarray isreadonlyat the type level only; runtime mutation is the SDK-internal pattern for this rare case. After the splice the SceneObject is well-formed again.The fix scans every entry in the SceneObject's
meshesarray (not just the one named incontext.danglingMeshId) so a single pass clears every dangling reference, even if the inspection only flagged one.