realitycollective / com.realitytoolkit.player

The camera service module of the Reality Toolkit. Use this module to set up a camera rig for XR apps and games in no time.
https://realitytoolkit.realitycollective.net/
MIT License
0 stars 0 forks source link

Init package with CameraService v1 #2

Closed FejZa closed 1 year ago

FejZa commented 1 year ago

Reality Collective - Reality Toolkit Pull Request

Overview

This is a carry over from core into a dedicated package. Here's the overview of important changes compared to the previous camera service implementation:

TLDR: The rig is now a prefab

SimonDarksideJ commented 1 year ago

When importing without the toolkit present, I get the following errors: image

SimonDarksideJ commented 1 year ago

Maybe we should move the package installer to Utilities?

SimonDarksideJ commented 1 year ago

No property listed for the new prefab variable in the editor image Likely needs the inspector checking

SimonDarksideJ commented 1 year ago

Removing the Camera service DELETES the existing rig in the scene, don't think it should do that. Shouldn't automatically clear up when the service is removed

SimonDarksideJ commented 1 year ago

If I alter the XRCameraRig in the scene, my changes are destroyed when the camera service is viewed in the Service Manager inspector. I.E. I add some components or additional rig objects.

What is the expected behaviour here?

SimonDarksideJ commented 1 year ago

Build script does not have all the required dependencies,

      dependencies: '{"development": "github.com/realitycollective/com.realitycollective.buildtools.git"}'
    secrets: inherit

Missing the Service Framework for the test build

FejZa commented 1 year ago

Thanks @SimonDarksideJ, I'll look into the clean up and inspector. Adding the package without the toolkit is not a supported scenario and hence not an issue.

FejZa commented 1 year ago

Well it's a PREFAB, you are not supposed to edit it in the scene and not apply the changes

FejZa commented 1 year ago

But let me look into a way to maybe support this or at leat auto-apply changes. Might not even be an issue anymore once the service does not delete the rig on clean up

SimonDarksideJ commented 1 year ago

Prefab is being destroyed and recreated in the scene whenever the camera service is inspected.

Replication Instructions:

  1. Add the camera service and set the runtime platforms (everything used for testing)
  2. See the XRCameraRig prefab loaded into the scene
  3. Rename the XRCamera prefab
  4. Inspect the camera system again

Expected: The Rig and managing script are still in the scene, the prefab should remain untouched

Actual: The rig is destroyed and replaced with the original

SimonDarksideJ commented 1 year ago

The scene is not marked dirty when the camera is added to the scene:

Replication Instructions:

  1. Create a new scene and add the service manager
  2. Add the camera service and set the runtime platforms (everything used for testing)
  3. See the XRCameraRig prefab loaded into the scene and scene is dirty.
  4. Remove the XRCameraRig and save (scene now has Service Manager and Light ONLY)
  5. Open the scene file in a text editor for comparison
  6. Open the scene again in Unity
  7. Note that the XRCameraRig is added but scene is not marked as dirty
  8. Open the unity scene file again and compare, no change found
  9. Return to Unity, Save the scene and reopen
  10. Compare scene file again, no change

Expected: If and when the scene is altered by the Camera Service, it should be marked as dirty

Actual: Apart from the initial change when the Camera is removed and the first prefab added, the scene is never marked dirty.

SimonDarksideJ commented 1 year ago

Well it's a PREFAB, you are not supposed to edit it in the scene and not apply the changes

Fair enough, we should ensure this is clearly documented that each camera provider will give its own prefab configured in the way it should be used. The flow being that the XRRig will be replaced at runtime with the prefab required.

FejZa commented 1 year ago

Ok once the new SF package is out in the wild I can update dependencies on this one and it should pass build validation.