VR: Add mouse event simulation

Updated add-on portion of https://developer.blender.org/D13153.

Users can configure the mouse event simulation via a VR action's
"Simulate Mouse" properties, where a simulated type and value can be
set for VR button press, hold (modal operators only), and release,
depending on the operator execution mode.

In addition, the "projection eye" (left or right) used to project 3D
controller positions to 2D mouse positions during mouse simulation can
be set via the View settings.
This commit is contained in:
Peter Kim 2022-12-12 21:26:19 +09:00
parent 0666f0303f
commit 3724a06c6a
4 changed files with 289 additions and 30 deletions

View File

@ -52,6 +52,17 @@ def ami_args_as_data(ami):
s.append(f"\"op\": '{ami.op}'")
s.append(f"\"op_mode\": '{ami.op_mode}'")
s.append(f"\"bimanual\": '{ami.bimanual}'")
s.append(f"\"simulate_mouse\": '{ami.simulate_mouse}'")
if ami.simulate_mouse:
if ami.op_mode == 'PRESS' or ami.op_mode == 'MODAL':
s.append(f"\"simulate_press_type\": '{ami.simulate.press_type}'")
s.append(f"\"simulate_press_value\": '{ami.simulate.press_value}'")
if ami.op_mode == 'MODAL':
s.append(f"\"simulate_hold_type\": '{ami.simulate.hold_type}'")
s.append(f"\"simulate_hold_value\": '{ami.simulate.hold_value}'")
if ami.op_mode == 'RELEASE' or ami.op_mode == 'MODAL':
s.append(f"\"simulate_release_type\": '{ami.simulate.release_type}'")
s.append(f"\"simulate_release_value\": '{ami.simulate.release_value}'")
s.append(f"\"haptic_name\": '{ami.haptic_name}'")
s.append(f"\"haptic_match_user_paths\": '{ami.haptic_match_user_paths}'")
s.append(f"\"haptic_duration\": '{ami.haptic_duration}'")
@ -76,6 +87,17 @@ def ami_data_from_args(ami, args):
ami.op = args["op"]
ami.op_mode = args["op_mode"]
ami.bimanual = True if (args["bimanual"] == 'True') else False
ami.simulate_mouse = True if (args["simulate_mouse"] == 'True') else False
if ami.simulate_mouse:
if ami.op_mode == 'PRESS' or ami.op_mode == 'MODAL':
ami.simulate.press_type = args["simulate_press_type"]
ami.simulate.press_value = args["simulate_press_value"]
if ami.op_mode == 'MODAL':
ami.simulate.hold_type = args["simulate_hold_type"]
ami.simulate.hold_value = args["simulate_hold_value"]
if ami.op_mode == 'RELEASE' or ami.op_mode == 'MODAL':
ami.simulate.release_type = args["simulate_release_type"]
ami.simulate.release_value = args["simulate_release_value"]
ami.haptic_name = args["haptic_name"]
ami.haptic_match_user_paths = True if (args["haptic_match_user_paths"] == 'True') else False
ami.haptic_duration = float(args["haptic_duration"])

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later
actionconfig_version = (3, 2, 8)
actionconfig_version = (3, 5, 2)
actionconfig_data = \
[("blender_default",
{"items":
@ -32,7 +32,7 @@ actionconfig_data = \
],
},
),
("teleport", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "op": 'wm.xr_navigation_teleport', "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'},
("teleport", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "op": 'wm.xr_navigation_teleport', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("interpolation", 0.9),
("color", (0.0, 1.0, 1.0, 1.0)),
@ -51,7 +51,7 @@ actionconfig_data = \
],
},
),
("nav_grab", {"type": 'FLOAT', "user_paths": ['/user/hand/left', '/user/hand/right'], "op": 'wm.xr_navigation_grab', "op_mode": 'MODAL', "bimanual": 'True', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'},
("nav_grab", {"type": 'FLOAT', "user_paths": ['/user/hand/left', '/user/hand/right'], "op": 'wm.xr_navigation_grab', "op_mode": 'MODAL', "bimanual": 'True', "simulate_mouse": '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":
[("lock_rotation", True),
],
@ -69,7 +69,7 @@ actionconfig_data = \
],
},
),
("fly_forward", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "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'},
("fly_forward", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'VIEWER_FORWARD'),
("lock_location_z", True),
@ -87,7 +87,7 @@ actionconfig_data = \
],
},
),
("fly_back", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "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'},
("fly_back", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'VIEWER_BACK'),
("lock_location_z", True),
@ -105,7 +105,7 @@ actionconfig_data = \
],
},
),
("fly_left", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "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'},
("fly_left", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'VIEWER_LEFT'),
("lock_location_z", True),
@ -123,7 +123,7 @@ actionconfig_data = \
],
},
),
("fly_right", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "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'},
("fly_right", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'VIEWER_RIGHT'),
("lock_location_z", True),
@ -141,7 +141,7 @@ actionconfig_data = \
],
},
),
("fly_up", {"type": 'FLOAT', "user_paths": ['/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'},
("fly_up", {"type": 'FLOAT', "user_paths": ['/user/hand/right'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'UP'),
("speed_min", 0.014),
@ -160,7 +160,7 @@ actionconfig_data = \
],
},
),
("fly_down", {"type": 'FLOAT', "user_paths": ['/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'},
("fly_down", {"type": 'FLOAT', "user_paths": ['/user/hand/right'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'DOWN'),
("speed_min", 0.014),
@ -179,7 +179,7 @@ actionconfig_data = \
],
},
),
("fly_turnleft", {"type": 'FLOAT', "user_paths": ['/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'},
("fly_turnleft", {"type": 'FLOAT', "user_paths": ['/user/hand/right'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'TURNLEFT'),
("speed_min", 0.01),
@ -198,7 +198,7 @@ actionconfig_data = \
],
},
),
("fly_turnright", {"type": 'FLOAT', "user_paths": ['/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'},
("fly_turnright", {"type": 'FLOAT', "user_paths": ['/user/hand/right'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'TURNRIGHT'),
("speed_min", 0.01),
@ -217,7 +217,7 @@ actionconfig_data = \
],
},
),
("nav_reset", {"type": 'FLOAT', "user_paths": ['/user/hand/left', '/user/hand/right'], "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'},
("nav_reset", {"type": 'FLOAT', "user_paths": ['/user/hand/left', '/user/hand/right'], "op": 'wm.xr_navigation_reset', "op_mode": 'PRESS', "bimanual": 'False', "simulate_mouse": '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),
@ -236,7 +236,7 @@ actionconfig_data = \
],
},
),
("select", {"type": 'FLOAT', "user_paths": ['/user/hand/right'], "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,
("select", {"type": 'FLOAT', "user_paths": ['/user/hand/right'], "op": 'wm.xr_select_raycast', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
@ -250,7 +250,7 @@ actionconfig_data = \
],
},
),
("transform", {"type": 'FLOAT', "user_paths": ['/user/hand/left', '/user/hand/right'], "op": 'wm.xr_transform_grab', "op_mode": 'MODAL', "bimanual": 'True', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, None,
("transform", {"type": 'FLOAT', "user_paths": ['/user/hand/left', '/user/hand/right'], "op": 'wm.xr_transform_grab', "op_mode": 'MODAL', "bimanual": 'True', "simulate_mouse": '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":
[("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'}),
@ -263,7 +263,7 @@ actionconfig_data = \
],
},
),
("undo", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "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,
("undo", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "op": 'ed.undo', "op_mode": 'PRESS', "bimanual": 'False', "simulate_mouse": '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":
[("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/volume_down/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/b/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
@ -275,7 +275,7 @@ actionconfig_data = \
],
},
),
("redo", {"type": 'FLOAT', "user_paths": ['/user/hand/right'], "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,
("redo", {"type": 'FLOAT', "user_paths": ['/user/hand/right'], "op": 'ed.redo', "op_mode": 'PRESS', "bimanual": 'False', "simulate_mouse": '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":
[("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/volume_up/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/b/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
@ -306,7 +306,7 @@ actionconfig_data = \
),
("blender_default_gamepad",
{"items":
[("teleport", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_teleport', "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'},
[("teleport", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_teleport', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("interpolation", 0.9),
("from_viewer", True),
@ -318,13 +318,13 @@ actionconfig_data = \
],
},
),
("fly", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "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,
("fly", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/input/a/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
],
},
),
("fly_forward", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "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'},
("fly_forward", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'VIEWER_FORWARD'),
("lock_location_z", True),
@ -335,7 +335,7 @@ actionconfig_data = \
],
},
),
("fly_back", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "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'},
("fly_back", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'VIEWER_BACK'),
("lock_location_z", True),
@ -346,7 +346,7 @@ actionconfig_data = \
],
},
),
("fly_left", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "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'},
("fly_left", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'VIEWER_LEFT'),
("lock_location_z", True),
@ -357,7 +357,7 @@ actionconfig_data = \
],
},
),
("fly_right", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "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'},
("fly_right", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'VIEWER_RIGHT'),
("lock_location_z", True),
@ -368,7 +368,7 @@ actionconfig_data = \
],
},
),
("fly_up", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "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'},
("fly_up", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'UP'),
("speed_min", 0.014),
@ -380,7 +380,7 @@ actionconfig_data = \
],
},
),
("fly_down", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "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'},
("fly_down", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'DOWN'),
("speed_min", 0.014),
@ -392,7 +392,7 @@ actionconfig_data = \
],
},
),
("fly_turnleft", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "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'},
("fly_turnleft", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'TURNLEFT'),
("speed_min", 0.01),
@ -404,7 +404,7 @@ actionconfig_data = \
],
},
),
("fly_turnright", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "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'},
("fly_turnright", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("mode", 'TURNRIGHT'),
("speed_min", 0.01),
@ -416,7 +416,7 @@ actionconfig_data = \
],
},
),
("nav_reset", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "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'},
("nav_reset", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_reset', "op_mode": 'PRESS', "bimanual": 'False', "simulate_mouse": '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),
@ -428,7 +428,7 @@ actionconfig_data = \
],
},
),
("select", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "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'},
("select", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_select_raycast', "op_mode": 'MODAL', "bimanual": 'False', "simulate_mouse": '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":
[("from_viewer", True),
],
@ -438,13 +438,13 @@ actionconfig_data = \
],
},
),
("undo", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'ed.undo', "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'}, None,
("undo", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'ed.undo', "op_mode": 'PRESS', "bimanual": 'False', "simulate_mouse": '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'}, None,
{"bindings":
[("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/input/x/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
],
},
),
("redo", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'ed.redo', "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'}, None,
("redo", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'ed.redo', "op_mode": 'PRESS', "bimanual": 'False', "simulate_mouse": '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'}, None,
{"bindings":
[("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/input/b/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}),
],

View File

@ -99,6 +99,13 @@ def vr_defaults_action_add(am,
op,
op_mode,
bimanual,
simulate_mouse,
simulate_press_type,
simulate_press_value,
simulate_hold_type,
simulate_hold_value,
simulate_release_type,
simulate_release_value,
haptic_name,
haptic_match_user_paths,
haptic_duration,
@ -115,6 +122,17 @@ def vr_defaults_action_add(am,
ami.op = op
ami.op_mode = op_mode
ami.bimanual = bimanual
ami.simulate_mouse = simulate_mouse
if simulate_mouse:
if ami.op_mode == 'PRESS' or ami.op_mode == 'MODAL':
ami.simulate.press_type = simulate_press_type
ami.simulate.press_value = simulate_press_value
if ami.op_mode == 'MODAL':
ami.simulate.hold_type = simulate_hold_type
ami.simulate.hold_value = simulate_hold_value
if ami.op_mode == 'RELEASE' or ami.op_mode == 'MODAL':
ami.simulate.release_type = simulate_release_type
ami.simulate.release_value = simulate_release_value
ami.haptic_name = haptic_name
ami.haptic_match_user_paths = haptic_match_user_paths
ami.haptic_duration = haptic_duration
@ -360,6 +378,13 @@ def vr_defaults_create_default(session_settings):
"wm.xr_navigation_teleport",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -438,6 +463,13 @@ def vr_defaults_create_default(session_settings):
"wm.xr_navigation_grab",
'MODAL',
True,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -524,6 +556,13 @@ def vr_defaults_create_default(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -594,6 +633,13 @@ def vr_defaults_create_default(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -664,6 +710,13 @@ def vr_defaults_create_default(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -734,6 +787,13 @@ def vr_defaults_create_default(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -804,6 +864,13 @@ def vr_defaults_create_default(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -874,6 +941,13 @@ def vr_defaults_create_default(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -944,6 +1018,13 @@ def vr_defaults_create_default(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1014,6 +1095,13 @@ def vr_defaults_create_default(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1085,6 +1173,13 @@ def vr_defaults_create_default(session_settings):
"wm.xr_navigation_reset",
'PRESS',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"haptic",
True,
0.3,
@ -1163,6 +1258,13 @@ def vr_defaults_create_default(session_settings):
"wm.xr_select_raycast",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1241,6 +1343,13 @@ def vr_defaults_create_default(session_settings):
"wm.xr_transform_grab",
'MODAL',
True,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1319,6 +1428,13 @@ def vr_defaults_create_default(session_settings):
"ed.undo",
'PRESS',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"haptic",
True,
0.3,
@ -1382,6 +1498,13 @@ def vr_defaults_create_default(session_settings):
"ed.redo",
'PRESS',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"haptic",
True,
0.3,
@ -1501,6 +1624,13 @@ def vr_defaults_create_default_gamepad(session_settings):
"wm.xr_navigation_teleport",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1522,6 +1652,13 @@ def vr_defaults_create_default_gamepad(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1543,6 +1680,13 @@ def vr_defaults_create_default_gamepad(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1564,6 +1708,13 @@ def vr_defaults_create_default_gamepad(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1585,6 +1736,13 @@ def vr_defaults_create_default_gamepad(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1606,6 +1764,13 @@ def vr_defaults_create_default_gamepad(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1627,6 +1792,13 @@ def vr_defaults_create_default_gamepad(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1648,6 +1820,13 @@ def vr_defaults_create_default_gamepad(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1669,6 +1848,13 @@ def vr_defaults_create_default_gamepad(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1690,6 +1876,13 @@ def vr_defaults_create_default_gamepad(session_settings):
"wm.xr_navigation_fly",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1711,6 +1904,13 @@ def vr_defaults_create_default_gamepad(session_settings):
"wm.xr_navigation_reset",
'PRESS',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"haptic_right",
True,
0.3,
@ -1732,6 +1932,13 @@ def vr_defaults_create_default_gamepad(session_settings):
"wm.xr_select_raycast",
'MODAL',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"",
False,
0.0,
@ -1753,6 +1960,13 @@ def vr_defaults_create_default_gamepad(session_settings):
"ed.undo",
'PRESS',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"haptic_left",
True,
0.3,
@ -1774,6 +1988,13 @@ def vr_defaults_create_default_gamepad(session_settings):
"ed.redo",
'PRESS',
False,
False,
'NONE',
'NOTHING',
'NONE',
'NOTHING',
'NONE',
'NOTHING',
"haptic_right",
True,
0.3,

View File

@ -88,6 +88,9 @@ class VIEW3D_PT_vr_session_view(Panel):
col = layout.column(align=True)
col.prop(session_settings, "controller_draw_style", text="Controller Style")
col = layout.column(align=True)
col.prop(session_settings, "projection_eye", text="Projection Eye")
col = layout.column(align=True)
col.prop(session_settings, "clip_start", text="Clip Start")
col.prop(session_settings, "clip_end", text="End")
@ -403,6 +406,19 @@ class VIEW3D_PT_vr_actions_actions(VRActionsPanel, Panel):
col.prop(ami, "op", text="Operator")
col.prop(ami, "op_mode", text="Operator Mode")
col.prop(ami, "bimanual", text="Bimanual")
col.prop(ami, "simulate_mouse", text="Simulate Mouse")
if ami.simulate_mouse:
col.separator()
if ami.op_mode == 'PRESS' or ami.op_mode == 'MODAL':
col.prop(ami.simulate, "press_type", text="Press Type")
col.prop(ami.simulate, "press_value", text="Press Value")
if ami.op_mode == 'MODAL':
col.prop(ami.simulate, "hold_type", text="Hold Type")
col.prop(ami.simulate, "hold_value", text="Hold Value")
if ami.op_mode == 'RELEASE' or ami.op_mode == 'MODAL':
col.prop(ami.simulate, "release_type", text="Release Type")
col.prop(ami.simulate, "release_value", text="Release Value")
col.separator()
# Properties.
vr_draw_ami(ami, col, 1)
elif ami.type == 'POSE':