Unity-Technologies / EditorXR

Author XR in XR
Other
925 stars 167 forks source link

Menus not appearing on hands in Standalone Builds (stencilRef error) #568

Closed rileydutton closed 4 years ago

rileydutton commented 4 years ago

When running the EditorXR in a Standalone build, most things seem to be working fine (e.g. I can use the thumbstick on my Oculus controller to bring up Workspaces). However, the tooltips and other menus that should appear on the controllers are not showing up. Here is my console log if that helps...I assume it's something to do with the stencilRef error?

Note that I do not get this error when running the project in the Editor Play mode.

Initialize engine version: 2018.4.12f1 (59ddc4c59b4f)
GfxDevice: creating device client; threaded=1
Direct3D:
    Version:  Direct3D 11.0 [level 11.1]
    Renderer: NVIDIA TITAN V (ID=0x1d81)
    Vendor:   
    VRAM:     12079 MB
    Driver:   26.21.14.3602
Begin MonoManager ReloadAssembly
- Completed reload, in  1.163 seconds
<RI> Initializing input.

<RI> Input initialized.

<RI> Initialized touch support.

Created eye textures with a "separate" layout.  The "multi-pass" stereo mode will be used.

(Filename:  Line: 2308)

UnloadTime: 0.605700 ms
A scripted object (probably UnityEditor.Experimental.EditorVR.Workspaces.InspectorListViewController?) has a different serialization layout when loading. (Read 340 bytes but expected 424 bytes)
Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?

(Filename:  Line: 2001)

Unloading 5 Unused Serialized files (Serialized files now loaded: 0)
NullReferenceException: Object reference not set to an instance of an object
  at UnityEditor.Experimental.EditorVR.Menus.RadialMenuSlot.set_stencilRef (System.Byte value) [0x00000] in <8b10e9740d0e4350add22177b4cdbd2d>:0 
  at UnityEditor.Experimental.EditorVR.Menus.RadialMenuUI.Setup () [0x00043] in <8b10e9740d0e4350add22177b4cdbd2d>:0 
  at UnityEditor.Experimental.EditorVR.Menus.RadialMenu.Start () [0x0004e] in <8b10e9740d0e4350add22177b4cdbd2d>:0 

(Filename: <8b10e9740d0e4350add22177b4cdbd2d> Line: 0)

NullReferenceException: Object reference not set to an instance of an object
  at UnityEditor.Experimental.EditorVR.Menus.RadialMenuSlot.set_stencilRef (System.Byte value) [0x00000] in <8b10e9740d0e4350add22177b4cdbd2d>:0 
  at UnityEditor.Experimental.EditorVR.Menus.RadialMenuUI.Setup () [0x00043] in <8b10e9740d0e4350add22177b4cdbd2d>:0 
  at UnityEditor.Experimental.EditorVR.Menus.RadialMenu.Start () [0x0004e] in <8b10e9740d0e4350add22177b4cdbd2d>:0 

(Filename: <8b10e9740d0e4350add22177b4cdbd2d> Line: 0)

Unloading 2726 unused Assets to reduce memory usage. Loaded Objects now: 8438.
Total: 15.619100 ms (FindLiveObjects: 0.999300 ms CreateObjectMapping: 0.748000 ms MarkObjects: 11.930100 ms  DeleteObjects: 1.941000 ms)

Setting up 10 worker threads for Enlighten.
  Thread -> id: 9e8 -> priority: 1 
  Thread -> id: 2744 -> priority: 1 
  Thread -> id: 3410 -> priority: 1 
  Thread -> id: 2dec -> priority: 1 
  Thread -> id: 4084 -> priority: 1 
  Thread -> id: 40d0 -> priority: 1 
  Thread -> id: 6744 -> priority: 1 
  Thread -> id: 7248 -> priority: 1 
  Thread -> id: 3050 -> priority: 1 
  Thread -> id: 5488 -> priority: 1 
rileydutton commented 4 years ago

I was able to fix this for some weird reason by doing the following:

GameObject menuSlotObj = ObjectUtils.Instantiate(m_RadialMenuSlotTemplate.gameObject, m_SlotContainer, false);
RadialMenuSlot menuSlot = menuSlotObj.GetComponent<RadialMenuSlot>();

On line 213 of RadialMenuUI.cs