Skip to content

Commit e8956c1

Browse files
committed
Version 2.2b5 - Refactored actions, more xml docs, Unity 2018 support
Changes for v2.2b5: * Fixed an issue where the SteamVR_Actions assembly was not being auto referenced by the main assembly. (intellisense would not recognize the class) * Fixed an issue with nullchecks against unassigned actions returning false incorrectly. (headsetOnHead == null with no action assigned should return true) Changes for v2.2b4: * Fixed an issue in builds where actions and action sets were not deserializing correctly. * Added an option to turn on the action set debug text generation for builds in the manager. * Fixed an issue where automatic SteamVR Input calls on frame 0 would cause errors. Changes for v2.2b3: * Fixed a named action property generation issue * Fixed an issue with not removing missing default binding files from the action manifest Changes for v2.2b2: * Fixed an assembly definition issue during generation. * Added a warning to Edge users that they need to manually open the binding ui. Changes for v2.2: * Major Breaking Change: To allow for the new SteamVR plugin to use assembly definition files generated action properties have been moved to the SteamVR_Actions class. Since this was already breaking references to actions we've also created friendlier names. SteamVR_Input.__actions_default_in_GripGrab -> SteamVR_Actions.default_GripGrab * Breaking Change: SteamVR_Action_In.GetDeviceComponentName() has been renamed GetRenderModelComponentName because that is more descriptive. This is a non-localized string representing the render model's component. Not necessarily the physical component on the device. * Major Change: Added Indexer/property style action data access. Instead of booleanAction.GetStateDown(SteamVR_Input_Sources.LeftHand); you can now use booleanAction[SteamVR_Input_Sources.LeftHand].stateDown; Or if you don't need to restrict to a specific input source just access booleanAction.stateDown; * Fix for Mixed Reality camera configs. The Example actions now have a "mixedreality" action set with an "ExternalCamera" pose action. Set this pose to a tracker / controller and mixed reality should work again. By default the camera tracker type is bound to this action. You can also change the pose that's used in SteamVR/Resources/ExternalCamera. * When saving / generating actions the plugin will now automatically remove entries in default binding files for actions that no longer exist. * Auto loading OpenVR package for projects that don't have it (2018.1+) * Only updating actions that has been accessed. * Fixed issue where you would get old data from an action recently activated. * Fixed some issues with Unity 2018.3+ * Significant XML style documentation added in preparation for documentation generation * Added C# events with autocomplete to all actions. booleanAction[source].onStateDown += yourMethod will auto-generate a method with named variables! * Added C# events to all SteamVR_Behaviour_ActionType components * Added unrestricted input source shortcuts to actions. booleanAction.state is a short-cut to booleanAction[SteamVR_Input_Sources.Any].state. * Faster initialization. * Fixed some issues with actions not serializing properly. * Added DoNotDestroy checkbox to SteamVR_Behaviour component. * Active has been split into Active and ActiveBinding - ActiveBinding indicates the action has an active binding, Active indicates the binding is active as well as the containing action set. * Calls to action data will now only return valid data then the action is active. So actionBoolean.stateDown will always be false if the action is inactive. * Added delta parameter to Single, Vector2, Vector3 behaviour events * Added onState event to Boolean actions that fires when the action is true * Added onAxis event to Single, Vector2, and Vector3 actions that fires when the action is non-zero. * General input system performance increases Changes for v2.1.5: * Breaking Change: Skeleton actions no longer take a input source as a parameter since this doesn't make sense. A lot of skeleton action method signatures have changed * Added lots of new helpful functions to the skeleton behaviour and action classes. Finger curl, finger splay, reference poses, tracking level, bone names, etc. * Added SteamVR_Input.GetLocalizedName and SteamVR_Action_In.GetLocalizedName that will return the localized name of the device component to last use that action. "Left Hand Vive Controller Trackpad". You can specify which parts of the name you want as well. * Fixed a major slowdown with going in and out of the steamvr dashboard at runtime Changes for v2.1: * Major Breaking Change: Actions and ActionSets are no longer Scriptable Objects. Make sure to delete your existing SteamVR_Input folder with all your generated stuff in it. This means you will have to reset all Actions and Action Sets in all prefabs and scenes. * Breaking Change: DefaultAction and DefaultActionSet properties no longer exist. Good news: Generation is now near-instant, doesn't require looping through every prefab and every scene. Set defaults through the following format: public SteamVR_Action_Pose poseAction = SteamVR_Input.GetAction<SteamVR_Action_Pose>("Pose"); or public SteamVR_Action_Boolean interactWithUI = SteamVR_Input.__actions_default_in_InteractUI; * Breaking Change: actionSet.inActions and actionSet.outActions are no longer generated. We're moving all the actions directly to the set level. Previously: SteamVR_Input._default.inActions.GripGrab. Now: SteamVR_Input._default.GripGrab. Collisions of an In-Action with the same name as an Out-Action will be handled by prepending "in_" and "out_" to the field names. * Breaking Change: More extensive action set management. Swapped out ActivatePrimary and ActivateSecondary for a single Activate call. You can activate as many sets at once as you want. * Added ability to create partial input bindings to be used in plugins. Create a partial binding folder and include it in your plugin. When users import your plugin they will be presented with the option to import your actions and bindings. * Added better tracker support via access to other user paths. Poses can now be bound to user/foot/left, user/foot/right, etc. * Added access to action set priorities. If you activate an action set with a higher priority it will stop actions bound to the same button in lower priority sets from updating * Added action set visualization to live editor window * Added more extensive string access to actions. SteamVR_Input.GetAction(actionName), GetState(actionName, inputSource), GetFloat(actionName, inputSource), GetVector2(actionName, inputSource) * Added proximity sensor action and example. The interaction system will log when you put the headset on / take it off. (binding ui for this still needs fix) * Fixed some generation and loading issues with 2018.3 * Bolded [SteamVR] in Debug.log entries * Fixed a rigidbody issue with 2018.3 * Fixed some issues with delayed loading SteamVR. Added a test scene: SteamVR/Extras/SteamVR_ForceSteamVRMode.unity * Readded the laser pointer extra with an example scene: SteamVR/Extras/SteamVR_LaserPointer.unity * Fixed auto-enabling of vr mode in recent unity versions. (Reminder you can disable this in: Edit Menu -> Preferences -> SteamVR) * Fixed action set renaming so it renames all actions in its set. Does not currently modify default bindings though. * Fixed basic fallback hand support * Moved automatic enabling of VR in player settings to the SteamVR_Settings.asset file in SteamVR/Resources. This allows better per project settings * Gave better error when SteamVR fails to initialize with oculus devices
1 parent cd1e8f6 commit e8956c1

File tree

276 files changed

+18731
-8590
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

276 files changed

+18731
-8590
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "SteamVR_Editor",
3+
"references": [
4+
"SteamVR"
5+
],
6+
"optionalUnityReferences": [],
7+
"includePlatforms": [
8+
"Editor"
9+
],
10+
"excludePlatforms": [],
11+
"allowUnsafeCode": false,
12+
"overrideReferences": false,
13+
"precompiledReferences": [],
14+
"autoReferenced": true,
15+
"defineConstraints": []
16+
}

Assets/SteamVR/Editor/SteamVR_Editor.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/SteamVR/Editor/SteamVR_SkyboxEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ public override void OnInspectorGUI()
337337
DestroyImmediate(fx);
338338

339339
timer.Stop();
340-
Debug.Log(string.Format("Screenshot took {0} seconds.", timer.Elapsed));
340+
Debug.Log(string.Format("<b>[SteamVR]</b> Screenshot took {0} seconds.", timer.Elapsed));
341341
}
342342

343343
if (tempCamera != null)

Assets/SteamVR/Editor/SteamVR_UnitySettingsWindow.cs

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -119,53 +119,7 @@ static void Update()
119119
//window.title = "SteamVR";
120120
}
121121

122-
if (SteamVR_Preferences.AutoEnableVR)
123-
{
124-
// Switch to native OpenVR support.
125-
var updated = false;
126-
127-
if (!PlayerSettings.virtualRealitySupported)
128-
{
129-
PlayerSettings.virtualRealitySupported = true;
130-
updated = true;
131-
}
132-
133-
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
134-
var devices = UnityEditorInternal.VR.VREditor.GetVREnabledDevices(BuildTargetGroup.Standalone);
135-
#else
136-
var devices = UnityEditorInternal.VR.VREditor.GetVREnabledDevicesOnTargetGroup(BuildTargetGroup.Standalone);
137-
#endif
138-
var hasOpenVR = false;
139-
foreach (var device in devices)
140-
if (device.ToLower() == "openvr")
141-
hasOpenVR = true;
142-
143-
144-
if (!hasOpenVR)
145-
{
146-
string[] newDevices;
147-
if (updated)
148-
{
149-
newDevices = new string[] { "OpenVR" };
150-
}
151-
else
152-
{
153-
newDevices = new string[devices.Length + 1];
154-
for (int i = 0; i < devices.Length; i++)
155-
newDevices[i] = devices[i];
156-
newDevices[devices.Length] = "OpenVR";
157-
updated = true;
158-
}
159-
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
160-
UnityEditorInternal.VR.VREditor.SetVREnabledDevices(BuildTargetGroup.Standalone, newDevices);
161-
#else
162-
UnityEditorInternal.VR.VREditor.SetVREnabledDevicesOnTargetGroup(BuildTargetGroup.Standalone, newDevices);
163-
#endif
164-
}
165-
166-
if (updated)
167-
Debug.Log("Switching to native OpenVR support.");
168-
}
122+
SteamVR_Settings.AutoEnableVR();
169123

170124
var dlls = new string[]
171125
{
@@ -179,10 +133,10 @@ static void Update()
179133
continue;
180134

181135
if (AssetDatabase.DeleteAsset("Assets/" + path))
182-
Debug.Log("Deleting " + path);
136+
Debug.Log("<b>[SteamVR]</b> Deleting " + path);
183137
else
184138
{
185-
Debug.Log(path + " in use; cannot delete. Please restart Unity to complete upgrade.");
139+
Debug.Log("<b>[SteamVR]</b> " + path + " in use; cannot delete. Please restart Unity to complete upgrade.");
186140
}
187141
}
188142

Assets/SteamVR/Editor/SteamVR_Update.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Valve.VR
1818
[InitializeOnLoad]
1919
public class SteamVR_Update : EditorWindow
2020
{
21-
const string currentVersion = "2.0";
21+
const string currentVersion = "2.1";
2222
const string versionUrl = "http://media.steampowered.com/apps/steamvr/unitypluginversion.txt";
2323
const string notesUrl = "http://media.steampowered.com/apps/steamvr/unityplugin-v{0}.txt";
2424
const string pluginUrl = "http://u3d.as/content/valve-corporation/steam-vr-plugin";
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using UnityEngine;
2+
using System.Collections;
3+
4+
namespace Valve.VR.Extras
5+
{
6+
/// <summary>
7+
/// This is an example class of how to force steamvr initialization. You still need to have vr mode enabled
8+
/// but you can have the top sdk set to None, then this script will force it to OpenVR after a second
9+
/// </summary>
10+
public class SteamVR_ForceSteamVRMode : MonoBehaviour
11+
{
12+
public GameObject vrCameraPrefab;
13+
14+
public GameObject[] disableObjectsOnLoad;
15+
16+
private IEnumerator Start()
17+
{
18+
yield return new WaitForSeconds(1f); // just here to show that you can wait a while.
19+
20+
SteamVR.Initialize(true);
21+
22+
while (SteamVR.initializedState != SteamVR.InitializedStates.InitializeSuccess)
23+
yield return null;
24+
25+
for (int disableIndex = 0; disableIndex < disableObjectsOnLoad.Length; disableIndex++)
26+
{
27+
GameObject toDisable = disableObjectsOnLoad[disableIndex];
28+
if (toDisable != null)
29+
toDisable.SetActive(false);
30+
}
31+
32+
GameObject.Instantiate(vrCameraPrefab);
33+
}
34+
}
35+
}

Assets/SteamVR/Input/SteamVR_Action_List.cs.meta renamed to Assets/SteamVR/Extras/SteamVR_ForceSteamVRMode.cs.meta

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)