From 6528492f250ed1c9b030b480f55886667a55fdc4 Mon Sep 17 00:00:00 2001 From: Peter Kim Date: Mon, 4 Apr 2022 17:04:04 +0900 Subject: VR: Add dedicated handling for VR trackers 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. --- viewport_vr_preview/action_map.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'viewport_vr_preview/action_map.py') 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) -- cgit v1.2.3