diff options
author | Peter Kim <pk15950@gmail.com> | 2022-02-18 11:08:53 +0300 |
---|---|---|
committer | Peter Kim <pk15950@gmail.com> | 2022-02-18 11:08:53 +0300 |
commit | b0274e50da58bc1f0086794a16029ec6e2e9b927 (patch) | |
tree | 899523f00f00702e08556a2d504784b7fdaddaa6 /viewport_vr_preview | |
parent | 4803bc04f3fc6b0cfcda638d9aa89dee40e6bfc5 (diff) |
VR: Add action bindings for Vive Focus 3 controller
Although the HTC Vive Focus 3 controller extension is currently not
supported by any OpenXR runtimes (save for the dedicated Focus 3
runtime in developer early-access), the bindings are still useful to
have for the future.
Diffstat (limited to 'viewport_vr_preview')
-rw-r--r-- | viewport_vr_preview/action_map.py | 22 | ||||
-rw-r--r-- | viewport_vr_preview/configs/default.py | 70 | ||||
-rw-r--r-- | viewport_vr_preview/defaults.py | 303 | ||||
-rw-r--r-- | viewport_vr_preview/gui.py | 3 |
4 files changed, 261 insertions, 137 deletions
diff --git a/viewport_vr_preview/action_map.py b/viewport_vr_preview/action_map.py index 46b6dd65..6c62c05d 100644 --- a/viewport_vr_preview/action_map.py +++ b/viewport_vr_preview/action_map.py @@ -79,8 +79,11 @@ def vr_create_actions(context: bpy.context): if amb.name == defaults.VRDefaultActionbindings.REVERB_G2.value: if not scene.vr_actions_enable_reverb_g2: continue - elif amb.name == defaults.VRDefaultActionbindings.COSMOS.value: - if not scene.vr_actions_enable_cosmos: + elif amb.name == defaults.VRDefaultActionbindings.VIVE_COSMOS.value: + if not scene.vr_actions_enable_vive_cosmos: + continue + elif amb.name == defaults.VRDefaultActionbindings.VIVE_FOCUS.value: + if not scene.vr_actions_enable_vive_focus: continue elif amb.name == defaults.VRDefaultActionbindings.HUAWEI.value: if not scene.vr_actions_enable_huawei: @@ -130,10 +133,6 @@ def register(): default=False, update=vr_actions_use_gamepad_update, ) - bpy.types.Scene.vr_actions_enable_cosmos = bpy.props.BoolProperty( - description="Enable bindings for the HTC Vive Cosmos controllers. Note that this may not be supported by all OpenXR runtimes", - default=False, - ) bpy.types.Scene.vr_actions_enable_huawei = bpy.props.BoolProperty( description="Enable bindings for the Huawei controllers. Note that this may not be supported by all OpenXR runtimes", default=False, @@ -142,6 +141,14 @@ def register(): description="Enable bindings for the HP Reverb G2 controllers. Note that this may not be supported by all OpenXR runtimes", default=False, ) + bpy.types.Scene.vr_actions_enable_vive_cosmos = bpy.props.BoolProperty( + description="Enable bindings for the HTC Vive Cosmos controllers. Note that this may not be supported by all OpenXR runtimes", + default=False, + ) + bpy.types.Scene.vr_actions_enable_vive_focus = bpy.props.BoolProperty( + description="Enable bindings for the HTC Vive Focus 3 controllers. Note that this may not be supported by all OpenXR runtimes", + default=False, + ) bpy.app.handlers.xr_session_start_pre.append(vr_create_actions) @@ -149,8 +156,9 @@ def register(): def unregister(): del bpy.types.Scene.vr_actions_enable del bpy.types.Scene.vr_actions_use_gamepad - del bpy.types.Scene.vr_actions_enable_cosmos del bpy.types.Scene.vr_actions_enable_huawei del bpy.types.Scene.vr_actions_enable_reverb_g2 + del bpy.types.Scene.vr_actions_enable_vive_cosmos + del bpy.types.Scene.vr_actions_enable_vive_focus bpy.app.handlers.xr_session_start_pre.remove(vr_create_actions) diff --git a/viewport_vr_preview/configs/default.py b/viewport_vr_preview/configs/default.py index 3e6185f0..f63d661c 100644 --- a/viewport_vr_preview/configs/default.py +++ b/viewport_vr_preview/configs/default.py @@ -6,26 +6,28 @@ actionconfig_data = \ {"items": [("controller_grip", {"type": 'POSE', "user_paths": ['/user/hand/left', '/user/hand/right'], "pose_is_controller_grip": 'True', "pose_is_controller_aim": 'False'}, None, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ], }, ), ("controller_aim", {"type": 'POSE', "user_paths": ['/user/hand/left', '/user/hand/right'], "pose_is_controller_grip": 'False', "pose_is_controller_aim": 'True'}, None, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ], }, @@ -37,13 +39,14 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_paths": ['/input/select/click', '/input/select/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ], }, @@ -54,13 +57,14 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/squeeze/click', '/input/squeeze/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/click', '/input/trackpad/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/click', '/input/trackpad/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/squeeze/force', '/input/squeeze/force'], "threshold": '0.5', "axis_region": 'ANY'}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/squeeze/value', '/input/squeeze/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/squeeze/value', '/input/squeeze/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_paths": ['/input/menu/click', '/input/menu/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/squeeze/click', '/input/squeeze/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/squeeze/click', '/input/squeeze/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/squeeze/click', '/input/squeeze/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/squeeze/click', '/input/squeeze/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ], }, @@ -72,12 +76,13 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], }, @@ -89,12 +94,13 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], }, @@ -106,12 +112,13 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], }, @@ -123,12 +130,13 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], }, @@ -141,12 +149,13 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], }, @@ -159,12 +168,13 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], }, @@ -177,12 +187,13 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], }, @@ -195,12 +206,13 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], }, @@ -213,25 +225,27 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/x/click', '/input/a/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/back/click', '/input/back/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/back/click', '/input/back/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/a/click', '/input/a/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/x/click', '/input/a/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/x/click', '/input/a/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/menu/click', '/input/menu/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/x/click', '/input/a/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/x/click', '/input/a/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/menu/click', '/input/menu/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ], }, ), ("haptic", {"type": 'VIBRATION', "user_paths": ['/user/hand/left', '/user/hand/right']}, None, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/output/haptic', '/output/haptic']}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/output/haptic', '/output/haptic']}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/output/haptic', '/output/haptic']}), ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/output/haptic', '/output/haptic']}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/output/haptic', '/output/haptic']}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/output/haptic', '/output/haptic']}), ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_paths": ['/output/haptic', '/output/haptic']}), ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/output/haptic', '/output/haptic']}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/output/haptic', '/output/haptic']}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/output/haptic', '/output/haptic']}), ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/output/haptic', '/output/haptic']}), ], }, diff --git a/viewport_vr_preview/defaults.py b/viewport_vr_preview/defaults.py index 0430b985..fe253e10 100644 --- a/viewport_vr_preview/defaults.py +++ b/viewport_vr_preview/defaults.py @@ -46,7 +46,6 @@ class VRDefaultActions(Enum): # Default action bindings. class VRDefaultActionbindings(Enum): - COSMOS = "cosmos" GAMEPAD = "gamepad" HUAWEI = "huawei" INDEX = "index" @@ -54,11 +53,12 @@ class VRDefaultActionbindings(Enum): REVERB_G2 = "reverb_g2" SIMPLE = "simple" VIVE = "vive" + VIVE_COSMOS = "vive_cosmos" + VIVE_FOCUS = "vive_focus" WMR = "wmr" class VRDefaultActionprofiles(Enum): - COSMOS = "/interaction_profiles/htc/vive_cosmos_controller" GAMEPAD = "/interaction_profiles/microsoft/xbox_controller" HUAWEI = "/interaction_profiles/huawei/controller" INDEX = "/interaction_profiles/valve/index_controller" @@ -66,6 +66,8 @@ class VRDefaultActionprofiles(Enum): REVERB_G2 = "/interaction_profiles/hp/mixed_reality_controller" SIMPLE = "/interaction_profiles/khr/simple_controller" VIVE = "/interaction_profiles/htc/vive_controller" + VIVE_COSMOS = "/interaction_profiles/htc/vive_cosmos_controller" + VIVE_FOCUS = "/interaction_profiles/htc/vive_focus3_controller" WMR = "/interaction_profiles/microsoft/motion_controller" @@ -198,13 +200,6 @@ def vr_defaults_create_default(session_state): False) if ami: vr_defaults_pose_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - ["/input/grip/pose", - "/input/grip/pose"], - (0, 0, 0), - (0, 0, 0)) - vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, ["/input/grip/pose", @@ -247,6 +242,20 @@ def vr_defaults_create_default(session_state): (0, 0, 0), (0, 0, 0)) vr_defaults_pose_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/grip/pose", + "/input/grip/pose"], + (0, 0, 0), + (0, 0, 0)) + vr_defaults_pose_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/grip/pose", + "/input/grip/pose"], + (0, 0, 0), + (0, 0, 0)) + vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, ["/input/grip/pose", @@ -262,13 +271,6 @@ def vr_defaults_create_default(session_state): True) if ami: vr_defaults_pose_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - ["/input/aim/pose", - "/input/aim/pose"], - (0, 0, 0), - (0, 0, 0)) - vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, ["/input/aim/pose", @@ -311,6 +313,20 @@ def vr_defaults_create_default(session_state): (0, 0, 0), (0, 0, 0)) vr_defaults_pose_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/aim/pose", + "/input/aim/pose"], + (0, 0, 0), + (0, 0, 0)) + vr_defaults_pose_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/aim/pose", + "/input/aim/pose"], + (0, 0, 0), + (0, 0, 0)) + vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, ["/input/aim/pose", @@ -333,14 +349,6 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - ["/input/trigger/value", - "/input/trigger/value"], - 0.3, - 'ANY', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, ["/input/trigger/value", @@ -389,6 +397,22 @@ def vr_defaults_create_default(session_state): 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/trigger/value", + "/input/trigger/value"], + 0.3, + 'ANY', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/trigger/value", + "/input/trigger/value"], + 0.3, + 'ANY', + 'ANY') + vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, ["/input/trigger/value", @@ -412,14 +436,6 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - ["/input/squeeze/click", - "/input/squeeze/click"], - 0.3, - 'ANY', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, ["/input/trackpad/click", @@ -468,6 +484,22 @@ def vr_defaults_create_default(session_state): 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/squeeze/click", + "/input/squeeze/click"], + 0.3, + 'ANY', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/squeeze/click", + "/input/squeeze/click"], + 0.3, + 'ANY', + 'ANY') + vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, ["/input/squeeze/click", @@ -490,13 +522,6 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - ["/input/thumbstick/y"], - 0.3, - 'POSITIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, ["/input/trackpad/y"], @@ -532,6 +557,20 @@ def vr_defaults_create_default(session_state): 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/y"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/y"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, ["/input/thumbstick/y"], @@ -553,13 +592,6 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - ["/input/thumbstick/y"], - 0.3, - 'NEGATIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, ["/input/trackpad/y"], @@ -595,6 +627,20 @@ def vr_defaults_create_default(session_state): 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/y"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/y"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, ["/input/thumbstick/y"], @@ -616,13 +662,6 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - ["/input/thumbstick/x"], - 0.3, - 'NEGATIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, ["/input/trackpad/x"], @@ -658,6 +697,20 @@ def vr_defaults_create_default(session_state): 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/x"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/x"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, ["/input/thumbstick/x"], @@ -679,13 +732,6 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - ["/input/thumbstick/x"], - 0.3, - 'POSITIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, ["/input/trackpad/x"], @@ -721,6 +767,20 @@ def vr_defaults_create_default(session_state): 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/x"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/x"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, ["/input/thumbstick/x"], @@ -742,13 +802,6 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - ["/input/thumbstick/y"], - 0.3, - 'POSITIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, ["/input/trackpad/y"], @@ -784,6 +837,20 @@ def vr_defaults_create_default(session_state): 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/y"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/y"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, ["/input/thumbstick/y"], @@ -805,13 +872,6 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - ["/input/thumbstick/y"], - 0.3, - 'NEGATIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, ["/input/trackpad/y"], @@ -847,6 +907,20 @@ def vr_defaults_create_default(session_state): 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/y"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/y"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, ["/input/thumbstick/y"], @@ -868,13 +942,6 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - ["/input/thumbstick/x"], - 0.3, - 'NEGATIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, ["/input/trackpad/x"], @@ -910,6 +977,20 @@ def vr_defaults_create_default(session_state): 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/x"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/x"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, ["/input/thumbstick/x"], @@ -931,13 +1012,6 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - ["/input/thumbstick/x"], - 0.3, - 'POSITIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, ["/input/trackpad/x"], @@ -973,6 +1047,20 @@ def vr_defaults_create_default(session_state): 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/x"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/x"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, ["/input/thumbstick/x"], @@ -995,14 +1083,6 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - ["/input/x/click", - "/input/a/click"], - 0.3, - 'ANY', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, ["/input/back/click", @@ -1043,6 +1123,22 @@ def vr_defaults_create_default(session_state): 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/x/click", + "/input/a/click"], + 0.3, + 'ANY', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/x/click", + "/input/a/click"], + 0.3, + 'ANY', + 'ANY') + vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, ["/input/menu/click", @@ -1057,11 +1153,6 @@ def vr_defaults_create_default(session_state): "/user/hand/right"]) if ami: vr_defaults_haptic_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - ["/output/haptic", - "/output/haptic"]) - vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, ["/output/haptic", @@ -1092,6 +1183,16 @@ def vr_defaults_create_default(session_state): ["/output/haptic", "/output/haptic"]) vr_defaults_haptic_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/output/haptic", + "/output/haptic"]) + vr_defaults_haptic_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/output/haptic", + "/output/haptic"]) + vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, ["/output/haptic", diff --git a/viewport_vr_preview/gui.py b/viewport_vr_preview/gui.py index 629e9c0e..163cbd48 100644 --- a/viewport_vr_preview/gui.py +++ b/viewport_vr_preview/gui.py @@ -176,7 +176,8 @@ class VIEW3D_PT_vr_actionmaps(Panel): col = layout.column(align=True, heading="Extensions") col.prop(scene, "vr_actions_enable_reverb_g2", text="HP Reverb G2") - col.prop(scene, "vr_actions_enable_cosmos", text="HTC Vive Cosmos") + col.prop(scene, "vr_actions_enable_vive_cosmos", text="HTC Vive Cosmos") + col.prop(scene, "vr_actions_enable_vive_focus", text="HTC Vive Focus") col.prop(scene, "vr_actions_enable_huawei", text="Huawei") |