-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing ActiveProfile at runtime does not work #4289
Comments
Comment from Julia: Seems like an issue that has provided significant pain for customer in the past |
At this point, I don't think that we can get this in for this iteration, so I'm removing this tag |
I have fixes for the invalidoperationexception when the collection changes as well as a nullreferenceexception caused by the gazeProviderPointingData being null after the profile is changed. Continuing to look at the other issues as they are encountered. |
Added a fix for the ui raycast camera not being property recreated. Encountering an issue where the DefaultCursor is being duplicated when switching profiles |
Moving to the 2.2.0 release. Current status:
|
@davidkline-ms Will this fix be available in MRTK 2.4.0? PR is still open. When do you plan to release new MRTK version? |
This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps. |
It would be great if this was put on the plan for the next release! |
(Ported to GitHub, reference 21522491)
Issue encountered using MRTK V2.0.0 RC1 Refresh
There's a property on MRTK.Instance called ActiveProfile, which supposedly will
swap out the profile and reset the configuration, but when I attempted to call
this I ran into a bunch of the below errors, and fixing just the camera related
errors exposed a lot more. I managed to "fix" these locally by actively by
hunting for objects that weren't cleaned up and fixing them up. Below is most
of the set of changes I had to make to allow swapping active profiles.
Changes I made to get this working in my project:
MixedRealityToolkit.cs:UpdateAllServices
loop was causing loop to fail due to the collection changing. Added a
ToList() on each to fix.
[davidkline-ms] addressing with try/catch(InvalidOperationException) for better performance.
UIRaycastCamera
Had to change destroy call to DestroyImmediate in FocusProvider.cs from
Destroy, as we needed to clean up references in a single frame.
Added IsNull check in MixedRealityInputModule.cs:
GetMousePointerEventDataForMrtkPointer to check for a destroyed
RaycastCamera, and find the new one in the scene if so. Also since
there is some delay I added a short circuit return for when
RaycastCamera was null.
ShellHandRayPointer
profiles, because we do not disable the linerenderer 100% of the time
when setting a shell hand ray pointer inactive. Had to add a foreach
loop to OnPostSceneQuery in the !IsActive branch to manually disable all
linerenderers.
Gaze Cursor
[davidkline-ms] Solving using DestroyImmediate to ensure correct re-creating.
WindowsMixedRealityDeviceManager: Disable()
dispose. We were trying to ref the disposed instances.
GestureRecognizreExtensions
destroyed instance.
Disabling the gaze cursor in the input profile does not work
InputSimulationService::OnHandDataChanged
UpdateHandInputSource on Left would cause handDataProvider to be
destroyed, so UpdateHandInputSource on the right hand would throw a null
ref
Issues I encountered but did not solve:
Gaze cursor behavior is wonky after swapping input profiles. Gaze cursor
would not become active until the first time the user air taps.
Gaze provider sometimes falls back to gaze when swapping to eye tracking.
There's already a UIRaycastCamera in the scene. It will be ignored, so please
delete it to avoid confusion.
UnityEngine.Debug:LogError(Object, Object)
Microsoft.MixedReality.Toolkit.Input.FocusProvider:Initialize() (at
Assets/MixedRealityToolkit.Services/InputSystem/FocusProvider.cs:416)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:InitializeAllServices() (at
Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:931)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:InitializeServiceLocator()
(at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:477)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:ResetConfiguration(MixedRealityToolkitConfigurationProfile)
(at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:116)
MissingReferenceException: The object of type 'Camera' has been destroyed but
you are still trying to access it.
Your script should either check if it is null or you should not destroy the
object.
Microsoft.MixedReality.Toolkit.Input.MixedRealityInputModule.GetMousePointerEventDataForMrtkPointer
(Microsoft.MixedReality.Toolkit.Input.MixedRealityInputModule+PointerData
pointerData) (at
Assets/MixedRealityToolkit.Services/InputSystem/MixedRealityInputModule.cs:176)
Microsoft.MixedReality.Toolkit.Input.MixedRealityInputModule.GetMousePointerEventData
(System.Int32 pointerId) (at
Assets/MixedRealityToolkit.Services/InputSystem/MixedRealityInputModule.cs:164)
UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent (System.Int32
id) (at
C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/InputModules/StandaloneInputModule.cs:504)
Microsoft.MixedReality.Toolkit.Input.MixedRealityInputModule.Process () (at
Assets/MixedRealityToolkit.Services/InputSystem/MixedRealityInputModule.cs:117)
UnityEngine.EventSystems.EventSystem.Update () (at
C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/EventSystem.cs:377)
The text was updated successfully, but these errors were encountered: