VR: Add reset navigation, toggle matview defaults

This commit is contained in:
Peter Kim 2021-08-31 18:00:22 +09:00
parent dcdbf833da
commit 1bbddad899
2 changed files with 251 additions and 102 deletions

View File

@ -1,4 +1,4 @@
actionconfig_version = (3, 0, 17)
actionconfig_version = (3, 0, 18)
actionconfig_data = \
[("blender_default",
{"items":
@ -64,16 +64,6 @@ actionconfig_data = \
],
},
),
("fly", {"type": 'FLOAT', "user_path0": '/user/hand/left', "user_path1": '/user/hand/right', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, None,
{"bindings":
[("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/click', "component_path1": '/input/thumbstick/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/thumbstick/click', "component_path1": '/input/thumbstick/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/thumbstick/click', "component_path1": '/input/thumbstick/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/thumbstick/click', "component_path1": '/input/thumbstick/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/thumbstick/click', "component_path1": '/input/thumbstick/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
],
},
),
("fly_forward",
{"type": 'FLOAT', "user_path0": '/user/hand/left', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'},
{"op_properties":
@ -222,6 +212,42 @@ actionconfig_data = \
],
},
),
("nav_reset",
{"type": 'FLOAT', "user_path0": '/user/hand/right', "user_path1": '', "op": 'wm.xr_navigation_reset', "op_mode": 'PRESS', "bimanual": 'False', "haptic_name": 'haptic', "haptic_match_user_paths": 'True', "haptic_duration": '0.30000001192092896', "haptic_frequency": '3000.0', "haptic_amplitude": '0.5', "haptic_mode": 'PRESS'},
{"op_properties":
[("location", False),
("rotation", False),
("scale", True),
],
},
{"bindings":
[("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/thumbstick/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/thumbstick/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/thumbstick/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/trackpad/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/thumbstick/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
],
},
),
("toggle_matview",
{"type": 'FLOAT', "user_path0": '/user/hand/left', "user_path1": '', "op": 'view3d.toggle_shading', "op_mode": 'PRESS', "bimanual": 'False', "haptic_name": 'haptic', "haptic_match_user_paths": 'True', "haptic_duration": '0.30000001192092896', "haptic_frequency": '3000.0', "haptic_amplitude": '0.5', "haptic_mode": 'PRESS'},
{"op_properties":
[("type", 'MATERIAL'),
],
},
{"bindings":
[("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/thumbstick/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/thumbstick/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/thumbstick/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/trackpad/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/thumbstick/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
],
},
),
("raycast_select", {"type": 'FLOAT', "user_path0": '/user/hand/right', "user_path1": '', "op": 'wm.xr_select_raycast', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, None,
{"bindings":
[("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/trigger/value', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
@ -251,11 +277,9 @@ actionconfig_data = \
("undo", {"type": 'FLOAT', "user_path0": '/user/hand/left', "user_path1": '', "op": 'ed.undo', "op_mode": 'PRESS', "bimanual": 'False', "haptic_name": 'haptic', "haptic_match_user_paths": 'True', "haptic_duration": '0.30000001192092896', "haptic_frequency": '3000.0', "haptic_amplitude": '0.5', "haptic_mode": 'PRESS'}, None,
{"bindings":
[("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/y/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/b/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/y/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/y/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/trackpad/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/trackpad/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
],
},
@ -263,11 +287,9 @@ actionconfig_data = \
("redo", {"type": 'FLOAT', "user_path0": '/user/hand/right', "user_path1": '', "op": 'ed.redo', "op_mode": 'PRESS', "bimanual": 'False', "haptic_name": 'haptic', "haptic_match_user_paths": 'True', "haptic_duration": '0.30000001192092896', "haptic_frequency": '3000.0', "haptic_amplitude": '0.5', "haptic_mode": 'PRESS'}, None,
{"bindings":
[("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/b/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/b/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/b/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/b/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/trackpad/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/trackpad/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
],
},
@ -409,6 +431,30 @@ actionconfig_data = \
],
},
),
("nav_reset",
{"type": 'FLOAT', "user_path0": '/user/gamepad', "user_path1": '', "op": 'wm.xr_navigation_reset', "op_mode": 'PRESS', "bimanual": 'False', "haptic_name": 'haptic_right', "haptic_match_user_paths": 'True', "haptic_duration": '0.30000001192092896', "haptic_frequency": '3000.0', "haptic_amplitude": '0.5', "haptic_mode": 'PRESS'},
{"op_properties":
[("location", False),
("rotation", False),
("scale", True),
],
},
{"bindings":
[("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/shoulder_right/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
],
},
),
("toggle_matview",
{"type": 'FLOAT', "user_path0": '/user/gamepad', "user_path1": '', "op": 'view3d.toggle_shading', "op_mode": 'PRESS', "bimanual": 'False', "haptic_name": 'haptic_left', "haptic_match_user_paths": 'True', "haptic_duration": '0.30000001192092896', "haptic_frequency": '3000.0', "haptic_amplitude": '0.5', "haptic_mode": 'PRESS'},
{"op_properties":
[("type", 'MATERIAL'),
],
},
{"bindings":
[("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/shoulder_left/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
],
},
),
("raycast_select",
{"type": 'FLOAT', "user_path0": '/user/gamepad', "user_path1": '', "op": 'wm.xr_select_raycast', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'},
{"op_properties":

View File

@ -51,6 +51,8 @@ class VRDefaultActions(Enum):
FLY_DOWN = "fly_down"
FLY_TURNLEFT = "fly_turnleft"
FLY_TURNRIGHT = "fly_turnright"
NAV_RESET = "nav_reset"
TOGGLE_MATVIEW = "toggle_matview"
RAYCAST_SELECT = "raycast_select"
GRAB = "grab"
UNDO = "undo"
@ -491,61 +493,6 @@ def vr_defaults_create_default(ac):
0.3,
'ANY',
'ANY')
ami = vr_defaults_action_add(am,
VRDefaultActions.FLY.value,
"/user/hand/left",
"/user/hand/right",
"wm.xr_navigation_fly",
'MODAL',
False,
"",
False,
0.0,
0.0,
0.0,
'PRESS')
if ami:
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.COSMOS.value,
VRDefaultActionprofiles.COSMOS.value,
"/input/thumbstick/click",
"/input/thumbstick/click",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.INDEX.value,
VRDefaultActionprofiles.INDEX.value,
"/input/thumbstick/click",
"/input/thumbstick/click",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.OCULUS.value,
VRDefaultActionprofiles.OCULUS.value,
"/input/thumbstick/click",
"/input/thumbstick/click",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.REVERB_G2.value,
VRDefaultActionprofiles.REVERB_G2.value,
"/input/thumbstick/click",
"/input/thumbstick/click",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.WMR.value,
VRDefaultActionprofiles.WMR.value,
"/input/thumbstick/click",
"/input/thumbstick/click",
0.3,
'ANY',
'ANY')
ami = vr_defaults_action_add(am,
VRDefaultActions.FLY_FORWARD.value,
@ -1115,6 +1062,148 @@ def vr_defaults_create_default(ac):
'POSITIVE',
'ANY')
ami = vr_defaults_action_add(am,
VRDefaultActions.NAV_RESET.value,
"/user/hand/right",
"",
"wm.xr_navigation_reset",
'PRESS',
False,
"haptic",
True,
0.3,
3000.0,
0.5,
'PRESS')
if ami:
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.COSMOS.value,
VRDefaultActionprofiles.COSMOS.value,
"/input/thumbstick/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.HUAWEI.value,
VRDefaultActionprofiles.HUAWEI.value,
"/input/trackpad/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.INDEX.value,
VRDefaultActionprofiles.INDEX.value,
"/input/thumbstick/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.OCULUS.value,
VRDefaultActionprofiles.OCULUS.value,
"/input/thumbstick/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.REVERB_G2.value,
VRDefaultActionprofiles.REVERB_G2.value,
"/input/thumbstick/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.VIVE.value,
VRDefaultActionprofiles.VIVE.value,
"/input/trackpad/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.WMR.value,
VRDefaultActionprofiles.WMR.value,
"/input/thumbstick/click",
"",
0.3,
'ANY',
'ANY')
ami = vr_defaults_action_add(am,
VRDefaultActions.TOGGLE_MATVIEW.value,
"/user/hand/left",
"",
"view3d.toggle_shading",
'PRESS',
False,
"haptic",
True,
0.3,
3000.0,
0.5,
'PRESS')
if ami:
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.COSMOS.value,
VRDefaultActionprofiles.COSMOS.value,
"/input/thumbstick/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.HUAWEI.value,
VRDefaultActionprofiles.HUAWEI.value,
"/input/trackpad/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.INDEX.value,
VRDefaultActionprofiles.INDEX.value,
"/input/thumbstick/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.OCULUS.value,
VRDefaultActionprofiles.OCULUS.value,
"/input/thumbstick/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.REVERB_G2.value,
VRDefaultActionprofiles.REVERB_G2.value,
"/input/thumbstick/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.VIVE.value,
VRDefaultActionprofiles.VIVE.value,
"/input/trackpad/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.WMR.value,
VRDefaultActionprofiles.WMR.value,
"/input/thumbstick/click",
"",
0.3,
'ANY',
'ANY')
ami = vr_defaults_action_add(am,
VRDefaultActions.RAYCAST_SELECT.value,
"/user/hand/right",
@ -1295,14 +1384,6 @@ def vr_defaults_create_default(ac):
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.HUAWEI.value,
VRDefaultActionprofiles.HUAWEI.value,
"/input/trackpad/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.INDEX.value,
VRDefaultActionprofiles.INDEX.value,
@ -1327,14 +1408,6 @@ def vr_defaults_create_default(ac):
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.VIVE.value,
VRDefaultActionprofiles.VIVE.value,
"/input/trackpad/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.WMR.value,
VRDefaultActionprofiles.WMR.value,
@ -1366,14 +1439,6 @@ def vr_defaults_create_default(ac):
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.HUAWEI.value,
VRDefaultActionprofiles.HUAWEI.value,
"/input/trackpad/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.INDEX.value,
VRDefaultActionprofiles.INDEX.value,
@ -1398,14 +1463,6 @@ def vr_defaults_create_default(ac):
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.VIVE.value,
VRDefaultActionprofiles.VIVE.value,
"/input/trackpad/click",
"",
0.3,
'ANY',
'ANY')
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.WMR.value,
VRDefaultActionprofiles.WMR.value,
@ -1696,6 +1753,52 @@ def vr_defaults_create_default_gamepad(ac):
'POSITIVE',
'ANY')
ami = vr_defaults_action_add(am,
VRDefaultActions.NAV_RESET.value,
"/user/gamepad",
"",
"wm.xr_navigation_reset",
'PRESS',
False,
"haptic_right",
True,
0.3,
3000.0,
0.5,
'PRESS')
if ami:
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.GAMEPAD.value,
VRDefaultActionprofiles.GAMEPAD.value,
"/input/shoulder_right/click",
"",
0.3,
'ANY',
'ANY')
ami = vr_defaults_action_add(am,
VRDefaultActions.TOGGLE_MATVIEW.value,
"/user/gamepad",
"",
"view3d.toggle_shading",
'PRESS',
False,
"haptic_left",
True,
0.3,
3000.0,
0.5,
'PRESS')
if ami:
vr_defaults_actionbinding_add(ami,
VRDefaultActionbindings.GAMEPAD.value,
VRDefaultActionprofiles.GAMEPAD.value,
"/input/shoulder_left/click",
"",
0.3,
'ANY',
'ANY')
ami = vr_defaults_action_add(am,
VRDefaultActions.RAYCAST_SELECT.value,
"/user/gamepad",