Hotrian / HeadlessOverlayToolkit

Create Cross Application OpenVR Overlays! Made with Unity.
59 stars 16 forks source link

SteamVR_UpdatesPoses could not be found #4

Open James-Firth opened 8 years ago

James-Firth commented 8 years ago

Apologies if this is a silly issue (been a long time since I did Unity dev and haven't done any standalone C# dev)

When I open the project in Unity to launch the ExampleContent scene I get the error:

Assets/SteamVR/Scripts/SteamVR_Render.cs(349,17): error CS0246: The type or namespace name `SteamVR_UpdatePoses' could not be found. Are you missing a using directive or an assembly reference?

EDIT: I'm running Unity 5.4.0f3, seems this repo only works with 5.3?

Hotrian commented 8 years ago

Yes, this repo has only been tested against Unity 5.3.5f1. Looks like bjennings76 upgraded it for Unity 5.4+ but I haven't had a chance to test this out.

The reason I stopped at 5.3.5f1 is because 5.4+ integrates Native VR Support, but Unity's developers overlooked the Init method or rather they set it up to automatically Init through OpenVR as a regular Application. Because this is meant to be an Overlay Utility tool that does not draw a scene, it cannot open as a regular Application. If I'm not mistaken, OpenVR will automatically close other applications launched as VR Applications when a new VR Application opens, since only one can draw a scene. As such, this project as well as OpenVRDesktopDisplayPortal and OpenVRTwitchChat must be launched as a EVRApplicationType.VRApplication_Overlay, or one of the other types (Utility or Background I believe) in order to access the OpenVR APIs without drawing a scene.

I attempted to upgrade this project to Unity 5.4 in the past, but couldn't find a way to Init as an Overlay application using Native VR Support. I believe bjennings76 worked around this by not using Native VR Support in 5.4, though as s/he says:

There are a number of warnings on deprecated calls that pop up

In Unity 5.3.5f1 I don't have any warnings (except maybe a few about unused variables), so I believe this is Unity 5.4 warning him/her about not using Native VR Support.

Edit: That pull request by bjennings76 is on OVRDDP's repo, but if you check the commit you can see s/he only upgraded 8 files that belong to SteamVR's stuff, so you should be able to use those files in place of the ones here on HOTK's repo and it should work on Unity 5.4

Hotrian commented 8 years ago

The class you are missing is over here on the OpenVR Repo and I didn't notice you needed it because you don't need it on Unity 5.0/5.1/5.2/5.3 due to #if !(UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0) bjennings76 changed those lines to read #if !(UNITY_5_3_OR_NEWER || UNITY_5_2 || UNITY_5_1 || UNITY_5_0) so newer versions of Unity will also ignore those lines of code.

There are a number of extra classes that I stripped from HOTK/OVRDDP/OVRTC since they weren't being used anyway on Unity 5.3.5f1, though I didn't realize that would introduce issues with Unity 5.4.

James-Firth commented 8 years ago

Thanks for the detailed response! I managed to get it working last night (forget exactly how I did though).

On another machine I've installed 5.3.5 and that's been working smoothly :)