VR: Add axis region, bimanual flags
This commit is contained in:
parent
35b083b1c8
commit
91a8d3087e
|
@ -1,20 +1,20 @@
|
|||
actionconfig_version = (3, 0, 1)
|
||||
actionconfig_version = (3, 0, 3)
|
||||
actionconfig_data = \
|
||||
[("blender_oculus",
|
||||
{"profile": '/interaction_profiles/oculus/touch_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.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', "op": 'wm.xr_navigation_teleport', "op_flag": 'MODAL'},
|
||||
{"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)),
|
||||
],
|
||||
},
|
||||
),
|
||||
("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', "op": 'wm.xr_select_raycast', "op_flag": 'MODAL'}, 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', "op": 'wm.xr_grab', "op_flag": 'MODAL'}, None),
|
||||
("undo", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/y/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "op": 'ed.undo', "op_flag": 'PRESS'}, None),
|
||||
("redo", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/b/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "op": 'ed.redo', "op_flag": 'PRESS'}, None),
|
||||
("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_grab', "op_flag": 'MODAL', "bimanual": 'False'}, 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),
|
||||
],
|
||||
},
|
||||
|
@ -24,16 +24,16 @@ actionconfig_data = \
|
|||
{"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),
|
||||
("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', "op": 'wm.xr_navigation_teleport', "op_flag": 'MODAL'},
|
||||
{"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)),
|
||||
],
|
||||
},
|
||||
),
|
||||
("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', "op": 'wm.xr_select_raycast', "op_flag": 'MODAL'}, 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', "op": 'wm.xr_grab', "op_flag": 'MODAL'}, None),
|
||||
("undo", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/menu/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "op": 'ed.undo', "op_flag": 'PRESS'}, None),
|
||||
("redo", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/menu/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "op": 'ed.redo', "op_flag": 'PRESS'}, None),
|
||||
("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_grab', "op_flag": 'MODAL', "bimanual": 'False'}, 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),
|
||||
("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),
|
||||
],
|
||||
},
|
||||
|
@ -43,16 +43,16 @@ actionconfig_data = \
|
|||
{"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.0, 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', "op": 'wm.xr_navigation_teleport', "op_flag": 'MODAL'},
|
||||
{"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)),
|
||||
],
|
||||
},
|
||||
),
|
||||
("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', "op": 'wm.xr_select_raycast', "op_flag": 'MODAL'}, 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', "op": 'wm.xr_grab', "op_flag": 'MODAL'}, None),
|
||||
("undo", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/menu/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "op": 'ed.undo', "op_flag": 'PRESS'}, None),
|
||||
("redo", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/menu/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "op": 'ed.redo', "op_flag": 'PRESS'}, None),
|
||||
("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_grab', "op_flag": 'MODAL', "bimanual": 'False'}, 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),
|
||||
("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),
|
||||
],
|
||||
},
|
||||
|
@ -62,16 +62,16 @@ actionconfig_data = \
|
|||
{"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.0, 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', "op": 'wm.xr_navigation_teleport', "op_flag": 'MODAL'},
|
||||
{"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)),
|
||||
],
|
||||
},
|
||||
),
|
||||
("raycast_select", {"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', "op": 'wm.xr_select_raycast', "op_flag": 'MODAL'}, 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', "op": 'wm.xr_grab', "op_flag": 'MODAL'}, None),
|
||||
("undo", {"type": 'BUTTON', "user_path0": '/user/hand/left', "component_path0": '/input/b/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "op": 'ed.undo', "op_flag": 'PRESS'}, None),
|
||||
("redo", {"type": 'BUTTON', "user_path0": '/user/hand/right', "component_path0": '/input/b/click', "user_path1": '', "component_path1": '', "threshold": '0.30000001192092896', "op": 'ed.redo', "op_flag": 'PRESS'}, None),
|
||||
("raycast_select", {"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_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_grab', "op_flag": 'MODAL', "bimanual": 'False'}, 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),
|
||||
],
|
||||
},
|
||||
|
|
|
@ -63,8 +63,11 @@ def vr_defaults_actionmap_item_add(am,
|
|||
user_path1,
|
||||
component_path1,
|
||||
threshold,
|
||||
axis0_flag,
|
||||
axis1_flag,
|
||||
op,
|
||||
op_flag):
|
||||
op_flag,
|
||||
bimanual):
|
||||
|
||||
ami = am.actionmap_items.new(name, True)
|
||||
if ami:
|
||||
|
@ -74,8 +77,11 @@ def vr_defaults_actionmap_item_add(am,
|
|||
ami.user_path1 = user_path1
|
||||
ami.component_path1 = component_path1
|
||||
ami.threshold = threshold
|
||||
ami.axis0_flag = axis0_flag
|
||||
ami.axis1_flag = axis1_flag
|
||||
ami.op = op
|
||||
ami.op_flag = op_flag
|
||||
ami.bimanual = bimanual
|
||||
|
||||
return ami
|
||||
|
||||
|
@ -149,8 +155,11 @@ def vr_defaults_create_oculus(ac):
|
|||
"/user/hand/right",
|
||||
"/input/trigger/value",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"wm.xr_navigation_teleport",
|
||||
'MODAL')
|
||||
'MODAL',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.RAYCAST_SELECT.value,
|
||||
"/user/hand/left",
|
||||
|
@ -158,8 +167,11 @@ def vr_defaults_create_oculus(ac):
|
|||
"/user/hand/right",
|
||||
"/input/a/click",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"wm.xr_select_raycast",
|
||||
'MODAL')
|
||||
'MODAL',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.GRAB.value,
|
||||
"/user/hand/left",
|
||||
|
@ -167,8 +179,11 @@ def vr_defaults_create_oculus(ac):
|
|||
"/user/hand/right",
|
||||
"/input/squeeze/value",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"wm.xr_grab",
|
||||
'MODAL')
|
||||
'MODAL',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.UNDO.value,
|
||||
"/user/hand/left",
|
||||
|
@ -176,8 +191,11 @@ def vr_defaults_create_oculus(ac):
|
|||
"",
|
||||
"",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"ed.undo",
|
||||
'PRESS')
|
||||
'PRESS',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.REDO.value,
|
||||
"/user/hand/right",
|
||||
|
@ -185,8 +203,11 @@ def vr_defaults_create_oculus(ac):
|
|||
"",
|
||||
"",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"ed.redo",
|
||||
'PRESS')
|
||||
'PRESS',
|
||||
False)
|
||||
vr_defaults_haptic_actionmap_item_add(am,
|
||||
VRDefaultActions.HAPTIC.value,
|
||||
"/user/hand/left",
|
||||
|
@ -221,8 +242,11 @@ def vr_defaults_create_wmr(ac):
|
|||
"/user/hand/right",
|
||||
"/input/trigger/value",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"wm.xr_navigation_teleport",
|
||||
'MODAL')
|
||||
'MODAL',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.RAYCAST_SELECT.value,
|
||||
"/user/hand/left",
|
||||
|
@ -230,8 +254,11 @@ def vr_defaults_create_wmr(ac):
|
|||
"/user/hand/right",
|
||||
"/input/trackpad/click",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"wm.xr_select_raycast",
|
||||
'MODAL')
|
||||
'MODAL',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.GRAB.value,
|
||||
"/user/hand/left",
|
||||
|
@ -239,8 +266,11 @@ def vr_defaults_create_wmr(ac):
|
|||
"/user/hand/right",
|
||||
"/input/squeeze/click",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"wm.xr_grab",
|
||||
'MODAL')
|
||||
'MODAL',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.UNDO.value,
|
||||
"/user/hand/left",
|
||||
|
@ -248,8 +278,11 @@ def vr_defaults_create_wmr(ac):
|
|||
"",
|
||||
"",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"ed.undo",
|
||||
'PRESS')
|
||||
'PRESS',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.REDO.value,
|
||||
"/user/hand/right",
|
||||
|
@ -257,8 +290,11 @@ def vr_defaults_create_wmr(ac):
|
|||
"",
|
||||
"",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"ed.redo",
|
||||
'PRESS')
|
||||
'PRESS',
|
||||
False)
|
||||
vr_defaults_haptic_actionmap_item_add(am,
|
||||
VRDefaultActions.HAPTIC.value,
|
||||
"/user/hand/left",
|
||||
|
@ -293,8 +329,11 @@ def vr_defaults_create_vive(ac):
|
|||
"/user/hand/right",
|
||||
"/input/trigger/value",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"wm.xr_navigation_teleport",
|
||||
'MODAL')
|
||||
'MODAL',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.RAYCAST_SELECT.value,
|
||||
"/user/hand/left",
|
||||
|
@ -302,8 +341,11 @@ def vr_defaults_create_vive(ac):
|
|||
"/user/hand/right",
|
||||
"/input/trackpad/click",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"wm.xr_select_raycast",
|
||||
'MODAL')
|
||||
'MODAL',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.GRAB.value,
|
||||
"/user/hand/left",
|
||||
|
@ -311,8 +353,11 @@ def vr_defaults_create_vive(ac):
|
|||
"/user/hand/right",
|
||||
"/input/squeeze/click",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"wm.xr_grab",
|
||||
'MODAL')
|
||||
'MODAL',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.UNDO.value,
|
||||
"/user/hand/left",
|
||||
|
@ -320,8 +365,11 @@ def vr_defaults_create_vive(ac):
|
|||
"",
|
||||
"",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"ed.undo",
|
||||
'PRESS')
|
||||
'PRESS',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.REDO.value,
|
||||
"/user/hand/right",
|
||||
|
@ -329,8 +377,11 @@ def vr_defaults_create_vive(ac):
|
|||
"",
|
||||
"",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"ed.redo",
|
||||
'PRESS')
|
||||
'PRESS',
|
||||
False)
|
||||
vr_defaults_haptic_actionmap_item_add(am,
|
||||
VRDefaultActions.HAPTIC.value,
|
||||
"/user/hand/left",
|
||||
|
@ -365,8 +416,11 @@ def vr_defaults_create_index(ac):
|
|||
"/user/hand/right",
|
||||
"/input/trigger/value",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"wm.xr_navigation_teleport",
|
||||
'MODAL')
|
||||
'MODAL',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.RAYCAST_SELECT.value,
|
||||
"/user/hand/left",
|
||||
|
@ -374,8 +428,11 @@ def vr_defaults_create_index(ac):
|
|||
"/user/hand/right",
|
||||
"/input/a/click",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"wm.xr_select_raycast",
|
||||
'MODAL')
|
||||
'MODAL',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.GRAB.value,
|
||||
"/user/hand/left",
|
||||
|
@ -383,8 +440,11 @@ def vr_defaults_create_index(ac):
|
|||
"/user/hand/right",
|
||||
"/input/squeeze/value",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"wm.xr_grab",
|
||||
'MODAL')
|
||||
'MODAL',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.UNDO.value,
|
||||
"/user/hand/left",
|
||||
|
@ -392,8 +452,11 @@ def vr_defaults_create_index(ac):
|
|||
"",
|
||||
"",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"ed.undo",
|
||||
'PRESS')
|
||||
'PRESS',
|
||||
False)
|
||||
vr_defaults_actionmap_item_add(am,
|
||||
VRDefaultActions.REDO.value,
|
||||
"/user/hand/right",
|
||||
|
@ -401,8 +464,11 @@ def vr_defaults_create_index(ac):
|
|||
"",
|
||||
"",
|
||||
0.3,
|
||||
'ANY',
|
||||
'ANY',
|
||||
"ed.redo",
|
||||
'PRESS')
|
||||
'PRESS',
|
||||
False)
|
||||
vr_defaults_haptic_actionmap_item_add(am,
|
||||
VRDefaultActions.HAPTIC.value,
|
||||
"/user/hand/left",
|
||||
|
|
|
@ -75,8 +75,14 @@ def ami_args_as_data(ami):
|
|||
|
||||
if ami.type == 'BUTTON' or ami.type == 'AXIS':
|
||||
s.append(f"\"threshold\": '{ami.threshold}'")
|
||||
if ami.type == 'BUTTON':
|
||||
s.append(f"\"axis_flag\": '{ami.axis0_flag}'")
|
||||
else: # ami.type == 'AXIS':
|
||||
s.append(f"\"axis0_flag\": '{ami.axis0_flag}'")
|
||||
s.append(f"\"axis1_flag\": '{ami.axis1_flag}'")
|
||||
s.append(f"\"op\": '{ami.op}'")
|
||||
s.append(f"\"op_flag\": '{ami.op_flag}'")
|
||||
s.append(f"\"bimanual\": '{ami.bimanual}'")
|
||||
elif ami.type == 'POSE':
|
||||
s.append(f"\"pose_is_controller\": '{ami.pose_is_controller}'")
|
||||
s.append(f"\"pose_location\": '{ami.pose_location.x, ami.pose_location.y, ami.pose_location.z}'")
|
||||
|
@ -99,10 +105,16 @@ def ami_data_from_args(ami, args):
|
|||
|
||||
if ami.type == 'BUTTON' or ami.type == 'AXIS':
|
||||
ami.threshold = float(args["threshold"])
|
||||
if ami.type == 'BUTTON':
|
||||
ami.axis0_flag = args["axis_flag"]
|
||||
else: # ami.type == 'AXIS':
|
||||
ami.axis0_flag = args["axis0_flag"]
|
||||
ami.axis1_flag = args["axis1_flag"]
|
||||
ami.op = args["op"]
|
||||
ami.op_flag = args["op_flag"]
|
||||
ami.bimanual = True if (args["bimanual"] == 'True') else False
|
||||
elif ami.type == 'POSE':
|
||||
ami.pose_is_controller = bool(args["pose_is_controller"])
|
||||
ami.pose_is_controller = True if (args["pose_is_controller"] == 'True') else False
|
||||
l = args["pose_location"].strip(')(').split(', ')
|
||||
ami.pose_location.x = float(l[0])
|
||||
ami.pose_location.y = float(l[1])
|
||||
|
|
|
@ -648,7 +648,8 @@ def vr_create_actions(context: bpy.context):
|
|||
|
||||
for ami in am.actionmap_items:
|
||||
ok = session_state.create_action(context, am.name, ami.name, ami.type,
|
||||
ami.user_path0, ami.user_path1, ami.threshold, ami.op, ami.op_flag)
|
||||
ami.user_path0, ami.user_path1, ami.threshold, ami.axis0_flag, ami.axis1_flag,
|
||||
ami.op, ami.op_flag, ami.bimanual)
|
||||
if not ok:
|
||||
return
|
||||
|
||||
|
@ -875,8 +876,14 @@ class VIEW3D_PT_vr_actions(Panel):
|
|||
|
||||
if ami.type == 'BUTTON' or ami.type == 'AXIS':
|
||||
col1.prop(ami, "threshold", text="Threshold")
|
||||
if ami.type == 'BUTTON':
|
||||
col1.prop(ami, "axis0_flag", text="Axis Flag")
|
||||
else: # ami.type == 'AXIS'
|
||||
col1.prop(ami, "axis0_flag", text="Axis 0 Flag")
|
||||
col1.prop(ami, "axis1_flag", text="Axis 1 Flag")
|
||||
col1.prop(ami, "op", text="Operator")
|
||||
col1.prop(ami, "op_flag", text="Operator Flag")
|
||||
col1.prop(ami, "bimanual", text="Bimanual")
|
||||
# Properties.
|
||||
vr_draw_ami(ami, col1, 1)
|
||||
elif ami.type == 'POSE':
|
||||
|
|
Loading…
Reference in New Issue