[Bf-extensions-cvs] [3012fffb] xr-controller-support: VR: Add grab navigation to default actions
Peter Kim
noreply at git.blender.org
Sat Jun 19 11:19:24 CEST 2021
Commit: 3012fffba6d2d7d467384ecbdc96fa92640c573b
Author: Peter Kim
Date: Sat Jun 19 18:15:42 2021 +0900
Branches: xr-controller-support
https://developer.blender.org/rBA3012fffba6d2d7d467384ecbdc96fa92640c573b
VR: Add grab navigation to default actions
Remaps grab transform action to different inputs.
===================================================================
M viewport_vr_preview/configs/default.py
M viewport_vr_preview/defaults.py
===================================================================
diff --git a/viewport_vr_preview/configs/default.py b/viewport_vr_preview/configs/default.py
index 8840501b..ac4a9e61 100644
--- a/viewport_vr_preview/configs/default.py
+++ b/viewport_vr_preview/configs/default.py
@@ -7,14 +7,23 @@ actionconfig_data = \
("teleport",
{"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/trigger/value', "user_path1": '/user/hand/right', "component_path1": '/input/trigger/value', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_navigation_teleport', "op_flag": 'MODAL', "bimanual": 'False'},
{"op_properties":
- [("color", (0.0, 1.0, 1.0, 1.0)),
+ [("interpolation", 0.9),
+ ("color", (0.0, 1.0, 1.0, 1.0)),
+ ],
+ },
+ ),
+ ("navigate",
+ {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/squeeze/value', "user_path1": '/user/hand/right', "component_path1": '/input/squeeze/value', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_navigation_grab', "op_flag": 'MODAL', "bimanual": 'True'},
+ {"op_properties":
+ [("lock_rotation", True),
+ ("lock_scale", True),
],
},
),
("raycast_select", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/x/click', "user_path1": '/user/hand/right', "component_path1": '/input/a/click', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_select_raycast', "op_flag": 'MODAL', "bimanual": 'False'}, None),
- ("grab", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/squeeze/value', "user_path1": '/user/hand/right', "component_path1": '/input/squeeze/value', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_transform_grab', "op_flag": 'MODAL', "bimanual": 'True'}, None),
- ("undo", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/y/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'ed.undo', "op_flag": 'PRESS', "bimanual": 'False'}, None),
- ("redo", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/b/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'ed.redo', "op_flag": 'PRESS', "bimanual": 'False'}, None),
+ ("grab", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/y/click', "user_path1": '/user/hand/right', "component_path1": '/input/b/click', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_transform_grab', "op_flag": 'MODAL', "bimanual": 'True'}, None),
+ ("undo", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/thumbstick/x', "user_path1": '/user/hand/right', "component_path1": '/input/thumbstick/x', "threshold": '0.30000001192092896', "axis_flag": 'NEGATIVE', "op": 'ed.undo', "op_flag": 'PRESS', "bimanual": 'False'}, None),
+ ("redo", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/thumbstick/x', "user_path1": '/user/hand/right', "component_path1": '/input/thumbstick/x', "threshold": '0.30000001192092896', "axis_flag": 'POSITIVE', "op": 'ed.redo', "op_flag": 'PRESS', "bimanual": 'False'}, None),
("haptic", {"type": 'HAPTIC', "user_path0": '/user/hand/left', "component_path0": '/output/haptic', "user_path1": '/user/hand/right', "component_path1": '/output/haptic', "haptic_duration": '0.30000001192092896', "haptic_frequency": '3000.0', "haptic_amplitude": '0.5'}, None),
],
},
@@ -22,18 +31,27 @@ actionconfig_data = \
("blender_wmr",
{"profile": '/interaction_profiles/microsoft/motion_controller'},
{"items":
- [("controller_pose", {"type": 'POSE', "user_path0": '/user/hand/left', "component_path0": '/input/grip/pose', "user_path1": '/user/hand/right', "component_path1": '/input/grip/pose', "pose_is_controller": 'True', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(-0.7853981852531433, 0.0, 0.0)'}, None),
+ [("controller_pose", {"type": 'POSE', "user_path0": '/user/hand/left', "component_path0": '/input/grip/pose', "user_path1": '/user/hand/right', "component_path1": '/input/grip/pose', "pose_is_controller": 'True', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(-0.8726646304130554, 0.0, 0.0)'}, None),
("teleport",
{"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/trigger/value', "user_path1": '/user/hand/right', "component_path1": '/input/trigger/value', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_navigation_teleport', "op_flag": 'MODAL', "bimanual": 'False'},
{"op_properties":
- [("color", (0.0, 1.0, 1.0, 1.0)),
+ [("interpolation", 0.9),
+ ("color", (0.0, 1.0, 1.0, 1.0)),
+ ],
+ },
+ ),
+ ("navigate",
+ {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/squeeze/click', "user_path1": '/user/hand/right', "component_path1": '/input/squeeze/click', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_navigation_grab', "op_flag": 'MODAL', "bimanual": 'True'},
+ {"op_properties":
+ [("lock_rotation", True),
+ ("lock_scale", True),
],
},
),
("raycast_select", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/trackpad/click', "user_path1": '/user/hand/right', "component_path1": '/input/trackpad/click', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_select_raycast', "op_flag": 'MODAL', "bimanual": 'False'}, None),
- ("grab", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/squeeze/click', "user_path1": '/user/hand/right', "component_path1": '/input/squeeze/click', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_transform_grab', "op_flag": 'MODAL', "bimanual": 'True'}, None),
- ("undo", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/menu/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'ed.undo', "op_flag": 'PRESS', "bimanual": 'False'}, None),
- ("redo", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/menu/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'ed.redo', "op_flag": 'PRESS', "bimanual": 'False'}, None),
+ ("grab", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/menu/click', "user_path1": '/user/hand/right', "component_path1": '/input/menu/click', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_transform_grab', "op_flag": 'MODAL', "bimanual": 'True'}, None),
+ ("undo", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/thumbstick/x', "user_path1": '/user/hand/right', "component_path1": '/input/thumbstick/x', "threshold": '0.30000001192092896', "axis_flag": 'NEGATIVE', "op": 'ed.undo', "op_flag": 'PRESS', "bimanual": 'False'}, None),
+ ("redo", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/thumbstick/x', "user_path1": '/user/hand/right', "component_path1": '/input/thumbstick/x', "threshold": '0.30000001192092896', "axis_flag": 'POSITIVE', "op": 'ed.redo', "op_flag": 'PRESS', "bimanual": 'False'}, None),
("haptic", {"type": 'HAPTIC', "user_path0": '/user/hand/left', "component_path0": '/output/haptic', "user_path1": '/user/hand/right', "component_path1": '/output/haptic', "haptic_duration": '0.30000001192092896', "haptic_frequency": '3000.0', "haptic_amplitude": '0.5'}, None),
],
},
@@ -45,14 +63,21 @@ actionconfig_data = \
("teleport",
{"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/trigger/value', "user_path1": '/user/hand/right', "component_path1": '/input/trigger/value', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_navigation_teleport', "op_flag": 'MODAL', "bimanual": 'False'},
{"op_properties":
- [("color", (0.0, 1.0, 1.0, 1.0)),
+ [("interpolation", 0.9),
+ ("color", (0.0, 1.0, 1.0, 1.0)),
+ ],
+ },
+ ),
+ ("navigate",
+ {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/squeeze/click', "user_path1": '/user/hand/right', "component_path1": '/input/squeeze/click', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_navigation_grab', "op_flag": 'MODAL', "bimanual": 'True'},
+ {"op_properties":
+ [("lock_rotation", True),
+ ("lock_scale", True),
],
},
),
("raycast_select", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/trackpad/click', "user_path1": '/user/hand/right', "component_path1": '/input/trackpad/click', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_select_raycast', "op_flag": 'MODAL', "bimanual": 'False'}, None),
- ("grab", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/squeeze/click', "user_path1": '/user/hand/right', "component_path1": '/input/squeeze/click', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_transform_grab', "op_flag": 'MODAL', "bimanual": 'True'}, None),
- ("undo", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/menu/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'ed.undo', "op_flag": 'PRESS', "bimanual": 'False'}, None),
- ("redo", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/menu/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'ed.redo', "op_flag": 'PRESS', "bimanual": 'False'}, None),
+ ("grab", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/menu/click', "user_path1": '/user/hand/right', "component_path1": '/input/menu/click', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_transform_grab', "op_flag": 'MODAL', "bimanual": 'True'}, None),
("haptic", {"type": 'HAP
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list