diff options
author | Peter Kim <pk15950@gmail.com> | 2022-04-04 11:04:04 +0300 |
---|---|---|
committer | Peter Kim <pk15950@gmail.com> | 2022-04-04 11:04:04 +0300 |
commit | 6528492f250ed1c9b030b480f55886667a55fdc4 (patch) | |
tree | 3468ea30155c401b5890ff55bcfd4be950c6f353 /viewport_vr_preview/action_map.py | |
parent | 0d3a8981f7e6bb3d9bd2e6483607421c663463c4 (diff) |
VR: Add dedicated handling for VR trackerstemp-xr-tracker
Also refactor the "blender_default_tracker" action map to have separate
pose actions for each tracker role (instead of a single pose action with
subaction paths for each role) and add controller pose actions.
Diffstat (limited to 'viewport_vr_preview/action_map.py')
-rw-r--r-- | viewport_vr_preview/action_map.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/viewport_vr_preview/action_map.py b/viewport_vr_preview/action_map.py index ce87873c..cbd16fc2 100644 --- a/viewport_vr_preview/action_map.py +++ b/viewport_vr_preview/action_map.py @@ -111,6 +111,7 @@ def vr_create_actions(context: bpy.context): controller_grip_name = "" controller_aim_name = "" + tracker_names = [] for ami in am.actionmap_items: if len(ami.bindings) < 1: @@ -125,6 +126,8 @@ def vr_create_actions(context: bpy.context): controller_grip_name = ami.name if ami.pose_is_controller_aim: controller_aim_name = ami.name + if ami.pose_is_tracker: + tracker_names.append(ami.name) for amb in ami.bindings: # Check for bindings that require OpenXR extensions. @@ -145,10 +148,13 @@ def vr_create_actions(context: bpy.context): if not ok: return - # Set controller pose actions. + # Set controller and tracker pose actions. if controller_grip_name and controller_aim_name: session_state.controller_pose_actions_set(context, am.name, controller_grip_name, controller_aim_name) + for tracker_name in tracker_names: + session_state.tracker_pose_action_add(context, am.name, tracker_name) + # Set active action set. vr_actionset_active_update(context) |