VR: Rename some actions for better clarity

This commit is contained in:
Peter Kim 2021-06-26 19:29:43 +09:00
parent a42beaef0b
commit 9c20bc08b3
2 changed files with 44 additions and 31 deletions

View File

@ -12,7 +12,7 @@ actionconfig_data = \
],
},
),
("grab",
("nav_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_navigation_grab', "op_flag": 'MODAL', "bimanual": 'True'},
{"op_properties":
[("lock_rotation", True),
@ -84,8 +84,8 @@ actionconfig_data = \
],
},
),
("select", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/trigger/value', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_select_raycast', "op_flag": 'MODAL', "bimanual": 'False'}, None),
("transform", {"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_transform_grab', "op_flag": 'MODAL', "bimanual": 'True'}, None),
("raycast_select", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/trigger/value', "user_path1": '', "component_path1": '', "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/x/click', "user_path1": '/user/hand/right', "component_path1": '/input/a/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/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),
("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),
@ -104,7 +104,7 @@ actionconfig_data = \
],
},
),
("grab",
("nav_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_navigation_grab', "op_flag": 'MODAL', "bimanual": 'True'},
{"op_properties":
[("lock_rotation", True),
@ -171,13 +171,13 @@ actionconfig_data = \
{"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/thumbstick/x', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'POSITIVE', "op": 'wm.xr_navigation_fly', "op_flag": 'MODAL', "bimanual": 'False'},
{"op_properties":
[("mode", 'TURNRIGHT'),
("speed_min", 0.014),
("speed_max", 0.042),
("speed_min", 0.01),
("speed_max", 0.03),
],
},
),
("select", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/trigger/value', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_select_raycast', "op_flag": 'MODAL', "bimanual": 'False'}, None),
("transform", {"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),
("raycast_select", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/trigger/value', "user_path1": '', "component_path1": '', "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/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/trackpad/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/trackpad/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "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),
@ -196,7 +196,7 @@ actionconfig_data = \
],
},
),
("grab",
("nav_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_navigation_grab', "op_flag": 'MODAL', "bimanual": 'True'},
{"op_properties":
[("lock_rotation", True),
@ -227,7 +227,7 @@ actionconfig_data = \
("fly_right",
{"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/trackpad/x', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'POSITIVE', "op": 'wm.xr_navigation_fly', "op_flag": 'MODAL', "bimanual": 'False'},
{"op_properties":
[("mode", 'TURNRIGHT'),
[("mode", 'RIGHT'),
],
},
),
@ -267,8 +267,8 @@ actionconfig_data = \
],
},
),
("select", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/trigger/value', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_select_raycast', "op_flag": 'MODAL', "bimanual": 'False'}, None),
("transform", {"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),
("raycast_select", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/trigger/value', "user_path1": '', "component_path1": '', "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/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/trackpad/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/trackpad/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "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),
@ -287,7 +287,7 @@ actionconfig_data = \
],
},
),
("grab",
("nav_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_navigation_grab', "op_flag": 'MODAL', "bimanual": 'True'},
{"op_properties":
[("lock_rotation", True),
@ -359,8 +359,8 @@ actionconfig_data = \
],
},
),
("select", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/trigger/value', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_select_raycast', "op_flag": 'MODAL', "bimanual": 'False'}, None),
("transform", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/a/click', "user_path1": '/user/hand/right', "component_path1": '/input/a/click', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_transform_grab', "op_flag": 'MODAL', "bimanual": 'True'}, None),
("raycast_select", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/trigger/value', "user_path1": '', "component_path1": '', "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/a/click', "user_path1": '/user/hand/right', "component_path1": '/input/a/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/b/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),
("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),
@ -370,7 +370,8 @@ actionconfig_data = \
("blender_gamepad",
{"profile": '/interaction_profiles/microsoft/xbox_controller'},
{"items":
[("fly_forward",
[("fly", {"type": 'BUTTON', "user_path0": '/user/gamepad', "component_path0": '/input/a/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'ANY', "op": 'wm.xr_navigation_fly', "op_flag": 'MODAL', "bimanual": 'False'}, None),
("fly_forward",
{"type": 'BUTTON', "user_path0": '/user/gamepad', "component_path0": '/input/thumbstick_left/y', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "axis_flag": 'POSITIVE', "op": 'wm.xr_navigation_fly', "op_flag": 'MODAL', "bimanual": 'False'},
{"op_properties":
[("mode", 'FORWARD'),

View File

@ -43,7 +43,7 @@ class VRDefaultActionmaps(Enum):
class VRDefaultActions(Enum):
CONTROLLER_POSE = "controller_pose"
TELEPORT = "teleport"
GRAB = "grab"
NAV_GRAB = "nav_grab"
FLY = "fly"
FLY_FORWARD = "fly_forward"
FLY_BACK = "fly_back"
@ -53,8 +53,8 @@ class VRDefaultActions(Enum):
FLY_DOWN = "fly_down"
FLY_TURNLEFT = "fly_turnleft"
FLY_TURNRIGHT = "fly_turnright"
SELECT = "select"
TRANSFORM = "transform"
RAYCAST_SELECT = "raycast_select"
GRAB = "grab"
UNDO = "undo"
REDO = "redo"
HAPTIC = "haptic"
@ -177,7 +177,7 @@ def vr_defaults_create_oculus(ac):
'MODAL',
False)
vr_defaults_actionmap_item_add(am,
VRDefaultActions.GRAB.value,
VRDefaultActions.NAV_GRAB.value,
"/user/hand/left",
"/input/squeeze/value",
"/user/hand/right",
@ -297,7 +297,7 @@ def vr_defaults_create_oculus(ac):
'MODAL',
False)
vr_defaults_actionmap_item_add(am,
VRDefaultActions.SELECT.value,
VRDefaultActions.RAYCAST_SELECT.value,
"/user/hand/right",
"/input/trigger/value",
"",
@ -309,7 +309,7 @@ def vr_defaults_create_oculus(ac):
'MODAL',
False)
vr_defaults_actionmap_item_add(am,
VRDefaultActions.TRANSFORM.value,
VRDefaultActions.GRAB.value,
"/user/hand/left",
"/input/x/click",
"/user/hand/right",
@ -384,7 +384,7 @@ def vr_defaults_create_wmr(ac):
'MODAL',
False)
vr_defaults_actionmap_item_add(am,
VRDefaultActions.GRAB.value,
VRDefaultActions.NAV_GRAB.value,
"/user/hand/left",
"/input/squeeze/click",
"/user/hand/right",
@ -504,7 +504,7 @@ def vr_defaults_create_wmr(ac):
'MODAL',
False)
vr_defaults_actionmap_item_add(am,
VRDefaultActions.SELECT.value,
VRDefaultActions.RAYCAST_SELECT.value,
"/user/hand/right",
"/input/trigger/value",
"",
@ -516,7 +516,7 @@ def vr_defaults_create_wmr(ac):
'MODAL',
False)
vr_defaults_actionmap_item_add(am,
VRDefaultActions.TRANSFORM.value,
VRDefaultActions.GRAB.value,
"/user/hand/left",
"/input/menu/click",
"/user/hand/right",
@ -591,7 +591,7 @@ def vr_defaults_create_vive(ac):
'MODAL',
False)
vr_defaults_actionmap_item_add(am,
VRDefaultActions.GRAB.value,
VRDefaultActions.NAV_GRAB.value,
"/user/hand/left",
"/input/squeeze/click",
"/user/hand/right",
@ -699,7 +699,7 @@ def vr_defaults_create_vive(ac):
'MODAL',
False)
vr_defaults_actionmap_item_add(am,
VRDefaultActions.SELECT.value,
VRDefaultActions.RAYCAST_SELECT.value,
"/user/hand/right",
"/input/trigger/value",
"",
@ -711,7 +711,7 @@ def vr_defaults_create_vive(ac):
'MODAL',
False)
vr_defaults_actionmap_item_add(am,
VRDefaultActions.TRANSFORM.value,
VRDefaultActions.GRAB.value,
"/user/hand/left",
"/input/menu/click",
"/user/hand/right",
@ -786,7 +786,7 @@ def vr_defaults_create_index(ac):
'MODAL',
False)
vr_defaults_actionmap_item_add(am,
VRDefaultActions.GRAB.value,
VRDefaultActions.NAV_GRAB.value,
"/user/hand/left",
"/input/squeeze/value",
"/user/hand/right",
@ -906,7 +906,7 @@ def vr_defaults_create_index(ac):
'MODAL',
False)
vr_defaults_actionmap_item_add(am,
VRDefaultActions.SELECT.value,
VRDefaultActions.RAYCAST_SELECT.value,
"/user/hand/right",
"/input/trigger/value",
"",
@ -918,7 +918,7 @@ def vr_defaults_create_index(ac):
'MODAL',
False)
vr_defaults_actionmap_item_add(am,
VRDefaultActions.TRANSFORM.value,
VRDefaultActions.GRAB.value,
"/user/hand/left",
"/input/a/click",
"/user/hand/right",
@ -971,6 +971,18 @@ def vr_defaults_create_gamepad(ac):
if not am:
return
vr_defaults_actionmap_item_add(am,
VRDefaultActions.FLY.value,
"/user/gamepad",
"/input/a/click",
"",
"",
0.3,
'ANY',
'ANY',
"wm.xr_navigation_fly",
'MODAL',
False)
vr_defaults_actionmap_item_add(am,
VRDefaultActions.FLY_FORWARD.value,
"/user/gamepad",