microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6.01k stars 2.12k forks source link

MRTK Custom Inspector for controller input action assignment crash #7581

Closed JordanHoareau closed 3 years ago

JordanHoareau commented 4 years ago

I'm sorry if bug has already been reported, I did not find him in the issues tracker.

Describe the bug

When I played at least once a scene containing MRTK component, the icons for controllers input action assignment disappears and 2 errors are displayed in Unity Console when I click on any Controller Input action Assignment in Editor mode. Only workaround find so far is reimport all assets.

To reproduce

Steps to reproduce the behavior:

  1. Go to Unity
  2. Go in Hierarchy > MixedRealityToolkit > MRTK Component > Controller Input Mapping Profile
  3. Open "Oculus Touch Left Hand Controller"
  4. Change input assignment for Oculus Touch Left controller
  5. Start the scene
  6. Stop the scene
  7. Go in Hierarchy > MixedRealityToolkit > MRTK Component > Controller Input Mapping Profile
  8. Open "Oculus Touch Left Hand Controller"
  9. Change input assignment for Oculus Touch Left controller

Expected behavior

Oculus Touch Left controller input action assignment window should display

Screenshots

MicrosoftTeams-image Controller Input Mapping Profile Editor UI when scene did not run

MicrosoftTeams-image (1) Controller Input Mapping Profile Editor UI after playing scene at least once

MicrosoftTeams-image (2) Error displayed in Unity console when trying to click on a Controller IA Assignment in Controller Input Mapping Profile Editor UI.

NullReferenceException: Object reference not set to an instance of an object UnityEditor.EditorWindow.Close () (at C:/buildslave/unity/build/Editor/Mono/EditorWindow.cs:910) Microsoft.MixedReality.Toolkit.Editor.ControllerPopupWindow.Show (Microsoft.MixedReality.Toolkit.Input.MixedRealityControllerMapping controllerMapping, UnityEditor.SerializedProperty interactionsList, Microsoft.MixedReality.Toolkit.Utilities.Handedness handedness) (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/ControllerPopupWindow.cs:193) Microsoft.MixedReality.Toolkit.Input.Editor.MixedRealityControllerMappingProfileInspector.RenderControllerList (UnityEditor.SerializedProperty controllerList) (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/Profiles/MixedRealityControllerMappingProfileInspector.cs:307) Microsoft.MixedReality.Toolkit.Input.Editor.MixedRealityControllerMappingProfileInspector.OnInspectorGUI () (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/Profiles/MixedRealityControllerMappingProfileInspector.cs:68) Microsoft.MixedReality.Toolkit.Utilities.Editor.MixedRealityInspectorUtility.DrawSubProfileEditor (UnityEngine.Object profileObject, System.Boolean renderProfileInBox) (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/Utilities/MixedRealityInspectorUtility.cs:522) Microsoft.MixedReality.Toolkit.Editor.BaseMixedRealityProfileInspector.RenderProfileInternal (UnityEditor.SerializedProperty property, System.Type profileType, System.Boolean showAddButton, System.Boolean renderProfileInBox, System.Type serviceType) (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/Profiles/BaseMixedRealityProfileInspector.cs:144) Microsoft.MixedReality.Toolkit.Editor.BaseMixedRealityProfileInspector.RenderProfile (UnityEditor.SerializedProperty property, System.Type profileType, System.Boolean showAddButton, System.Boolean renderProfileInBox, System.Type serviceType) (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/Profiles/BaseMixedRealityProfileInspector.cs:78) Microsoft.MixedReality.Toolkit.Input.Editor.MixedRealityInputSystemProfileInspector+<>c__DisplayClass33_0.<OnInspectorGUI>b__4 () (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/Profiles/MixedRealityInputSystemProfileInspector.cs:138) Microsoft.MixedReality.Toolkit.Editor.BaseMixedRealityProfileInspector.RenderFoldout (System.Boolean& currentState, System.String title, System.Action renderContent, System.String preferenceKey) (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/Profiles/BaseMixedRealityProfileInspector.cs:176) Microsoft.MixedReality.Toolkit.Input.Editor.MixedRealityInputSystemProfileInspector.OnInspectorGUI () (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/Profiles/MixedRealityInputSystemProfileInspector.cs:133) Microsoft.MixedReality.Toolkit.Utilities.Editor.MixedRealityInspectorUtility.DrawSubProfileEditor (UnityEngine.Object profileObject, System.Boolean renderProfileInBox) (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/Utilities/MixedRealityInspectorUtility.cs:522) Microsoft.MixedReality.Toolkit.Editor.BaseMixedRealityProfileInspector.RenderProfileInternal (UnityEditor.SerializedProperty property, System.Type profileType, System.Boolean showAddButton, System.Boolean renderProfileInBox, System.Type serviceType) (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/Profiles/BaseMixedRealityProfileInspector.cs:144) Microsoft.MixedReality.Toolkit.Editor.BaseMixedRealityProfileInspector.RenderProfile (UnityEditor.SerializedProperty property, System.Type profileType, System.Boolean showAddButton, System.Boolean renderProfileInBox, System.Type serviceType) (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/Profiles/BaseMixedRealityProfileInspector.cs:78) Microsoft.MixedReality.Toolkit.Editor.MixedRealityToolkitConfigurationProfileInspector+<>c__DisplayClass29_0.<OnEnable>b__1 () (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/Profiles/MixedRealityToolkitConfigurationProfileInspector.cs:158) Microsoft.MixedReality.Toolkit.Editor.MixedRealityToolkitConfigurationProfileInspector.OnInspectorGUI () (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/Profiles/MixedRealityToolkitConfigurationProfileInspector.cs:418) Microsoft.MixedReality.Toolkit.Editor.MixedRealityToolkitInspector.OnInspectorGUI () (at Library/PackageCache/com.capgemini.mixedrealitytoolkit@eec6628f46f3efca182341350c124ef8d1139b1e/MixedRealityToolkit/Inspectors/MixedRealityToolkitInspector.cs:69) UnityEditor.UIElements.InspectorElement+<CreateIMGUIInspectorFromEditor>c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:501) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) First error detail

Scope was not disposed! You should use the 'using' keyword or manually call Dispose. UnityEngine.Scope:Finalize() Second error detail

If applicable, add screenshots to help explain your problem.

Setup

Target platform

stale[bot] commented 4 years ago

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.

stale[bot] commented 4 years ago

This issue has been closed by an automated process because it is stale. If this is still an issue please add a new comment with more recent details and repro steps.

david-c-kline commented 3 years ago

Should be a relatively fast fix. Either @keveleigh or I will address soon.

RogPodge commented 3 years ago

Closing since the issue doesn't seem to present on the latest MRTK release.