TrackedPoseDriver.cs using ENABLE_VR
Unity 2019.1 fresh install, I removed and disabled all VR stuff and added InputSystem and for some strange reason it seems that ENABLE_VR is defined by default. I can't find any documentation about this define, is it possible that it's a bug and it's enabled by unityengine?
I'm 99% certain that ENABLE_VR is part of the Platform Dependent Compilation but undocumented: https://docs.unity3d.com/Manual/PlatformDependentCompilation.html So it should be controlled by the Project Settings options: https://docs.unity3d.com/Manual/VROverview.html
Does it always come back as true even after you disabled VR?
@jackpr-unity, do you have any idea about this?
@JiaUnity yes, even when I disabled VR it still remained true. I also tried #undef ENABLE_VR and even that wouldn't work.
Hi @icyh4mmer , that sounds like an engine bug to me. I'd appreciate it if you would file the bug through our bug reporter. You can do so by navigating to the menu bar -> Help -> Report a bug.
Hi @icyh4mmer - sorry for the delay in getting back to you.
If you're interested in seeing if XR is enabled in 2019.1, I suggest referring to https://docs.unity3d.com/ScriptReference/XR.XRSettings.html
This is not an issue with the InputSystem package, so I must close it. Thank you for bringing this issue to our attention - I'll follow up on it internally. If you find more issues please feel free to reach out through our forums (https://forum.unity.com/) or by filing a bug through the editor (menu bar -> Help -> Report a bug).
A bit more information: ENABLE_VR is defined at the platform level. It is not affected by disabling settings anywhere. It is used internally to say "hey - this platform might use VR bits at some point somewhere."
Sorry for the late reply, I was absent for some time. @jackpr-unity So if I understand correctly this is always defined and the input system is using this define and in that case it always references XR which creates a dependency on XR even when you are not using it. So I guess this is still an input system bug, because it is using a wrong define which forces you to enable XR.
Where do you see ENABLE_VR being used? You mention TrackedPoseDriver.cs in your title. That script is a part of the XR Legacy Input Helpers package, not the InputSystem package.
@icyh4mmer ^
@jackpr-unity I'm terribly sorry, I checked everything again step by step and everything seems to be in order, however, there seems to be a bug where you disable a package and it will still somehow stay in the project, and after you enable it again editor will crash, I think this is what happened the last time. I'll try to reproduce the issue and create a ticket, sorry for bothering you :)
@jackpr-unity Also, I did find the TrackedPoseDriver.cs in InputSystem package:

Thanks for pointing out TrackedPoseDriver. I have no idea why that's there. I'm going to have to look more into it.
Thanks for taking the time to help make this all better! I really appreciate it.
It turns out that TrackedPoseDriver exists in this package because it is very different than the one in the XRLegacyInputHelpers package. That makes sense - it grabs input from this package rather than through legacy means.
Is the existence of this script causing you any problems?
The ENABLE_VR define shouldn't be causing problems enabling or disabling specific VR SDKs or VR in general. If you're having a problem with that then I would appreciate it if you would file an issue through the editor bug reporter.
I get the ENABLE_VR defined despite empty new project with no packages at all (really, every single package removed, including disabling all the built-in packages. Only the package manager GUI package is left. This is in Unity version 2019.2.0f1, so definitely a unity bug
@olabrahammar as I explained above: ENABLE_VR is a preprocessor directive defined at the platform level. It is not affected by disabling settings anywhere. It is used internally to say "hey - this platform might use VR bits at some point somewhere."
If you're using Windows or Android as your build platform, for example, it is expected that ENABLE_VR will always be set because there are VR SDKs that target those build platforms.
Ok i see, thanks Jack! This must be new behaviour though, we did not have the ENABLE_VR set in 2018.2.16f1 i believe - we have some older code that uses this flag to decide if to reference Oculus stuff when building for Oculus Go/Android. Do you happen to know what preprocessor directive to use instead, to discern if we are building for VR headset?
@olabrahammar
To discern if you are building with VR enabled, I would use https://docs.unity3d.com/ScriptReference/XR.XRSettings.html.
XRSettings.supportedDevices lists out the SDKs that you have enabled in Settings->XR Settings-> VR SDKs.
@jackpr-unity Sorry for late reply again, just to reply, everything seems fine now, because in the version I'm using now, there is also UNITY_INPUT_SYSTEM_ENABLE_XR in the same #if, and now everything checks out.