Repository navigation
Show pins and 3D labels in the Quest app; fix the display modes, Space Setup capture and glTF export - #30
Merged
Conversation
The capture scene pointed SpatialPinManager.pinPrefab and LabelRenderer.labelPrefab at SpatialLabel.prefab, which a862495 deleted with the rest of the legacy sample (its message names only the NaughtyAttributes demo). No asset carries that GUID any more, so neither spawned anything: no pin and no 3D label ever showed, for vision server or Space Setup pins. LabelRenderer also had no labelRoot, so it returned early even with a prefab. - New first-party SpatialPin and SpatialLabel prefabs, made here from Unity's sphere, cylinder and quad meshes, URP Unlit materials and TextMesh Pro's Liberation Sans: a dot on the object with a stem, and the label on a dark plate above it, turned to face the viewer (SpatialLabelView). The legacy prefab was not restored: it came with the XR-AI-Florence2 sample with no recorded source or licence, and needed its deleted scripts, animator and font too. - LabelRenderer follows the pin manager: one label per pin, Space Setup pins included, moved with its pin and removed with it. The pipeline no longer re-renders every vision server pin after each capture, which stacked another copy of each label in the room every time. - Pins persist across captures, as the README says. Age pruning (6 s) is off by default and in the scene: before, each capture removed every earlier pin. A pin now stays until cleared or replaced by a newer pin of the same object (same track, same Space Setup anchor, or the same label nearby). ClearPins(source) no longer lets pins and their objects fall out of step. - Positions are smoothed along each object's track, not per Meta label: every class without one is OTHER, so a chair, a cup and a book were pulled toward each other. Two objects in one capture never share a track. - The scene gets pin and label roots outside the export root, and loses the legacy LoadingIcon (missing script and texture) and a reference to a lighting settings asset that was never committed. - BuildSceneTests fails on any unresolved reference in the build scene, so a deleted prefab cannot empty the room silently again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The trigger's boxes mode deactivated the GameObjects of the label renderer and the pin manager. In the shipped scene that is the CompanionScan object, which also holds the pipeline, the camera provider and the exporter, with the controller input on a child: the first trigger press from the default mode stopped capture and every button, the trigger that would switch back included. The labels mode switched the same object off and on, and never hid the camera preview, which hangs from the controller. The modes now only show and hide: BBoxRenderer.Visible switches the preview's canvas, LabelRenderer.Visible and SpatialPinManager.PinsVisible the label and pin objects. Boxes keep being drawn while hidden, so the preview's boxes always belong to its frame. The 2D boxes themselves never showed: copies of the runtime box stayed inactive, were placed from the container's centre instead of its corner, and their outline took the fill's 5% alpha. They are drawn now, with solid edges and the detection's label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MetaSceneCollector.trackingSpace was empty in the scene, and OVRLocatable.TrackingSpacePose.ComputeWorldPosition throws without one. With Space Setup done, every capture threw in its Space Setup step and never reached the vision server: no snapshot was sent and no pin was placed, from either source. The scene now names the rig's TrackingSpace. Without one, the collector uses the OVRCameraRig's, else takes the poses as world poses, and a failed Space Setup read is logged while the capture goes on to the vision server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e data Y wrote no glTF at all. The exporter looked UnityGLTF up by reflection with a GLTFSceneExporter(Transform[]) constructor and a two-parameter SaveGLTFandBin; UnityGLTF 2.20 has neither, so only the snapshot images reached the disk. The exporter now calls UnityGLTF directly (CompanionScan references UnityGLTFScripts), so a signature change fails the build instead. The scene's exporter also had no pin manager, boundary provider, Space Setup reader or snapshot store (the controller menu added only the store at run time), and no floor or scene mesh material, without which UnityGLTF leaves a mesh out. They are wired now, with a BoundaryProvider and a SnapshotFrameStore on the capture object that the pipeline shares, so an export holds the pins, the floor plan, the Space Setup data and the snapshots with their camera poses, as the README says. A failed Space Setup read no longer stops an export. Exports stay on the headset: uploadAfterExport stays off and the scene still has no GltfSyncClient, as the camera notice promises. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- README: what a pin and its label look like, that they persist until replaced by a newer pin of the same object (age pruning off), that the display modes keep capture and the buttons working, and that the Florence preset places no pins. - quest-capture-gltf: the pin update rules, LabelRenderer and SpatialLabelView, and the scene wiring the build scene now has (prefabs, roots outside the export root, tracking space, snapshot store, export materials). - scan-export-pipeline, spatial-capture-architecture: pins are smoothed per object and kept until replaced, not pruned by age. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The removed-assets row said none of the legacy files deleted in a862495 had a recorded source or licence. The sample's License/License.txt, deleted in the same commit, did name a source for loading.png: a Flaticon icon page (loading_39979), with no licence terms. The prefab, its scripts, animator controller, Roboto font asset and material, and the ConstantRotation script have no recorded source or licence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
454b4fd wrote in the README and three docs pages that a pin stays until the pins are cleared. Nothing in the app calls SpatialPinManager.ClearPins, so pins last until the app is closed; the pages now say so. Whether to add a clear-pins control is left open. The README also says that a newer detection of the same object updates its pin, as the docs pages do: only a Space Setup anchor replaces one outright. docs/quest-capture-gltf.md also said that the display modes never switch off a GameObject. They switch the pin and label objects; what they never switch off is the object that runs capture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Quest app showed no pins and no 3D labels. The capture scene's
SpatialPinManagerandLabelRendererboth pointed atSpatialLabel.prefab, whicha862495deleted with the rest of the legacy sample. So neither created anything, and nothing failed. TheLabelRendereralso had no label root, and without one it drew nothing, so it had never drawn a label in this scene, even beforea862495.The same path had five more problems:
This branch fixes all six, with new first-party pin and label prefabs. It also adds a test that fails on any unresolved reference in the build scene, so a deleted asset cannot empty the room silently again.
main@f17ac17. The vision server is unchanged.What changed
Pins and 3D labels show again (
aeb36f3)Assets/CompanionScan/Prefabs/SpatialPin.prefabis a dot on the object with a stem.SpatialLabel.prefabis the label on a dark plate above it. They are made in this repository from Unity's built-in sphere, cylinder and quad meshes, URP Unlit materials and TextMesh Pro's Liberation Sans.SpatialLabelViewturns a label about the vertical axis to face the viewer, keeps it upright, fits the plate to the text and shortens labels longer than 48 characters.XR-AI-Florence2sample with no recorded source or licence, and it needed its deleted scripts, animator controller and font too.LabelRenderera label root, andLabelRendererfalls back to its own object when none is set.LabelRenderernow follows the pin manager (SpatialPinManager.PinsChanged). Every pin gets one label, Space Setup pins included. The label moves with its pin and goes when the pin is removed. The pipeline connects the two if the scene does not.SpatialPinManager.enablePinLifecycleis now off by default and in the scene. When on, it drops pins more than 6 s older than a new one. It was on in the scene, so a capture removed the pins of any capture taken more than 6 s before it.ClearPinsremoves pins, but nothing in the app calls it yet (see Owner decisions).ClearPins(source)no longer lets pins and their objects fall out of step. A pin with no object left its slot behind, so later pins lined up with the wrong objects.OTHER, so a chair, a cup and a book were pulled toward each other. They are now smoothed per track:LoadingIcon(missing script and texture) is gone. So is a reference to a lighting settings asset that was never committed.BuildSceneTests(EditMode, 11 tests: 8 here, 1 in8d43899, 2 in4792bda) open the build scene.The display modes only show or hide (
1557d47)What broke. The trigger cycles boxes, labels and both, starting from both. The boxes mode deactivated the GameObjects of the label renderer and the pin manager.
CompanionScanobject. It also holds the pipeline, the camera provider and the exporter, with the controller input on a child.The fix.
BBoxRenderer.Visibleswitches the preview's canvas.LabelRenderer.VisibleandSpatialPinManager.PinsVisibleswitch the label and pin objects.2D boxes. They never showed:
They are now drawn with solid edges and the detection's label.
Space Setup no longer stops a capture (
8d43899)MetaSceneCollector.trackingSpacewas empty in the scene, andOVRLocatable.TrackingSpacePose.ComputeWorldPositionthrows without one. With Space Setup done, every capture threw in its Space Setup step and never reached the vision server. No snapshot was sent and no pin was placed, from either source.TrackingSpace. Without one, the collector uses theOVRCameraRig's, else it takes the poses as world poses.Y writes the glTF export (
4792bda)GLTFSceneExporter(Transform[])constructor and a two-parameterSaveGLTFandBin, and UnityGLTF 2.20 has neither. So no glTF was ever written.CompanionScan.asmdefreferencesUnityGLTFScripts), so a signature change fails the build instead.FloorPlan.matandSceneMesh.mat.BoundaryProviderand aSnapshotFrameStorenow sit on the capture object. The exporter uses both, and it shares the snapshot store with the pipeline.uploadAfterExportstays off, and the scene still has noGltfSyncClient, as the camera notice promises.BuildSceneTestschecks both.Docs (
454b4fd,c4f652e,cf7e68a)README.md:docs/quest-capture-gltf.md: the pin update rules,LabelRendererandSpatialLabelView, and the scene wiring.docs/scan-export-pipeline.mdanddocs/spatial-capture-architecture.md:The architecture page also says pins are smoothed per object.
cf7e68acorrects454b4fd, which said in all four places that pins stay until they are cleared. Nothing in the app clears them.docs/quest-capture-gltf.mdthat said the display modes never switch off a GameObject. They switch the pin and label objects, but never the object that runs capture.THIRD_PARTY.md(row added inaeb36f3, reworded inc4f652e): a row for the deleted legacy prefab and the files it used, and the new first-party prefabs that replace it.ConstantRotationscript.loading.png, the sample's deletedLicense/License.txtrecorded only a Flaticon icon page, with no licence terms.Verification
Run with Unity 6000.6.9f1 on Windows, in batch mode. The last commit,
cf7e68a, changes only the README and three docs pages. No Unity test or build step reads them.EditMode: 189 of 189 passed (
main: 178), atc4f652e.PlayMode: 67 tests: 42 passed, 24 skipped, 1 failed (
main: 43 tests, 18 passed).454b4fd. The two commits after it change onlyTHIRD_PARTY.mdand Markdown docs.CompanionScan_TEST_SERVER_URL), which was not set.XrSceneScreenshotTests.QaXrScene_CapturesControllersAndAnchors. Fix the Quest launch blockers: app label, permissions, camera notice and licences #28 had the same failure and the same 24 skips.New tests:
SpatialPinManagerTests:ClearPins(all, and by source),PinsChangedandPinsVisible.LabelRendererTests:CvPinPlacementTests:ControllerMenuUiStateTests:CycleDisplayMode_TogglesRenderersAndPins, which asserted the old behaviour: the boxes mode switched off the objects holding the label renderer and the pin manager.BBoxRendererAutoCreateTests: each box is drawn over its object, with its label.SpatialMapExporterTests: in the Editor, an export writes a glTF with the pins, the floor plan and the snapshots.Editor screenshots (not attached): a temporary PlayMode test, not committed, staged a capture in the Editor.
Debug-key APK, built at
454b4fdwithCommandLineBuild.BuildAndroidQuestand read withaapt2. Its package, version, target SDK, label and permissions are the same as the Fix the Quest launch blockers: app label, permissions, camera notice and licences #28 build:com.CompanionIntelligence.CompanionCapture;The build log was not kept.
Not verified
8d43899fixes;files/exports.8d43899,BuildSceneTestschecks only that the saved scene names the tracking space.CompanionCapture.unity, in the Editor or on a headset.BuildSceneTestsonly reads the saved scene, and the PlayMode tests and the screenshot test build their own objects.CvPinPlacementTestsruns both of its captures in the same frame.Owner decisions
Neither blocks this merge.
WALL_FACEandFLOOR. Without Space Setup it shows no pins or labels at all.trackMaxAgeSeconds).cf7e68a).Merge notes
Base and merges. The branch starts from
main@f17ac17, which includes Fix the Quest launch blockers: app label, permissions, camera notice and licences #28 and Vision server: opaque upload IDs, a delete route and optional retention; Dependabot ignores transformers majors #29.mainhas since gained Sign release builds in a protected release job #25 (f687aa2), andgit merge-treewith it is clean.The 41 files:
.metafiles.BuildSceneTestschecks the scene's wiring.Nothing deployed changes until the next APK is built.
🤖 Generated with Claude Code