ViveSoftware / ViveInputUtility-Unity

A toolkit that helps developing/prototyping VR apps.
http://u3d.as/uF7
Other
357 stars 82 forks source link

Removing OpenVR from SDK list can be confusing #120

Closed wirelessdreamer closed 5 years ago

wirelessdreamer commented 5 years ago

Preferences -> VIU Settings -> Vive

automatically keeps OpenVR on the list of SDK's. so when a user removes OpenVR from

Player -> XR Settings -> VR SDK's, it gets automatically added back in, with the user not being sure why.

Please add a log message to the console when the SDK gets added in from this option so if a user removes it from the SDK list, and it is auto added back in it tells them something like:

OpenVR SDK added automatically, because Preferences -> VIU Settings -> Vive is enabled

wirelessdreamer commented 5 years ago

Not only is it confusing, but VIU Settings keeps turning VIVE support back on when it gets disabled, making Oculus Store builds is a pain, as you constantly have to re-enter the settings menu and keep turning it off. it feels like every other time I press play I'm back in turning it off again.

chengnay commented 5 years ago

@wirelessdreamer Do you mean when you unchecked VIU Settings "VIVE", it will automatically turn on by itself?

wirelessdreamer commented 5 years ago

Yes

On Mon, May 13, 2019, 6:18 AM ChengNan Yang notifications@github.com wrote:

@wirelessdreamer https://github.com/wirelessdreamer Do you mean when you unchecked VIU Settings "VIVE", it will automatically turn on by itself?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ViveSoftware/ViveInputUtility-Unity/issues/120#issuecomment-491764103, or mute the thread https://github.com/notifications/unsubscribe-auth/AABCHPJXDINIWYTAVEF22STPVE6AHANCNFSM4HLZZYNA .

chengnay commented 5 years ago

Could you try the following code, public static void ApplyChanges() { if (!s_isDirty) { return; } s_isDirty = false;

s_projectSettingAsset.Update();

string updatedSDKName = "";

if (s_devicesProp != null)
{
    if (s_devicesProp.arraySize != s_enabledSDKNames.Count)
    {
        s_devicesProp.arraySize = s_enabledSDKNames.Count;
    }

    for (int i = s_enabledSDKNames.Count - 1; i >= 0; --i)
    {
        s_devicesProp.GetArrayElementAtIndex(i).stringValue = s_enabledSDKNames[i];
        updatedSDKName = s_enabledSDKNames[i];
    }
}

s_enabledProp.boolValue = s_vrEnabled;

if (!string.IsNullOrEmpty(updatedSDKName) && s_vrEnabled)
{
    Debug.Log(updatedSDKName + " is added to the VR SDK list.");
}

s_projectSettingAsset.ApplyModifiedProperties();

}

Just replace the function ApplyChanges() line 199 in VIUSettingsEditor.cs. Is this something that you would like to have?

wirelessdreamer commented 5 years ago

I updated the message on my side to: Debug.Log(updatedSDKName + " is added to the VR SDK list, Remove SDK from Preferences -> VIU Settings if you want to disable it.");

Until i was familiar with VIU I didn't know its settings were stored under preferences, so can be hard to locate the setting.

On Mon, May 13, 2019 at 6:24 AM ChengNan Yang notifications@github.com wrote:

Could you try the following code, public static void ApplyChanges() { if (!s_isDirty) { return; } s_isDirty = false;

s_projectSettingAsset.Update();

string updatedSDKName = "";

if (s_devicesProp != null) { if (s_devicesProp.arraySize != s_enabledSDKNames.Count) { s_devicesProp.arraySize = s_enabledSDKNames.Count; }

for (int i = s_enabledSDKNames.Count - 1; i >= 0; --i)
{
    s_devicesProp.GetArrayElementAtIndex(i).stringValue = s_enabledSDKNames[i];
    updatedSDKName = s_enabledSDKNames[i];
}

}

s_enabledProp.boolValue = s_vrEnabled;

if (!string.IsNullOrEmpty(updatedSDKName) && s_vrEnabled) { Debug.Log(updatedSDKName + " is added to the VR SDK list."); }

s_projectSettingAsset.ApplyModifiedProperties();

}

Just replace the function ApplyChanges() in VIUSettingsEditor.cs. Is this something that you would like to have?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ViveSoftware/ViveInputUtility-Unity/issues/120#issuecomment-491765683, or mute the thread https://github.com/notifications/unsubscribe-auth/AABCHPIBTWYVS2RDT4ZS2RLPVE6UHANCNFSM4HLZZYNA .

wirelessdreamer commented 5 years ago

The initial issue was actually caused by SteamVR in SteamVR_AutoEnableVR.cs

for anyone else seeing this disable SteamVR_Settings.instance.autoEnableVR or just comment out the logic related to that in the file.

chengnay commented 5 years ago

The initial issue was actually caused by SteamVR in SteamVR_AutoEnableVR.cs

for anyone else seeing this disable SteamVR_Settings.instance.autoEnableVR or just comment out the logic related to that in the file.

If it is not added by VIU, do you think adding the message in VIU is necessary?

wirelessdreamer commented 5 years ago

I never saw a message for vive devices from that when I was testing here, only from the oculus device I was testing. I'd say go ahead and pull it, then close this ticket. Thanks for looking into it.

wirelessdreamer commented 5 years ago

The solution i ended up going with was Editing SteamVR/Editor/SteamVR_AutoEnableVR.cs I commented out most of the file, as its obnoxious behavior was what caused my issues. Its an upstream problem not VIU.