Switch the visualization mode of a VR device¶
Shows how to set the three different visualization modes of a VR device: hand + controller, hand only and controller only.
vr/switchControllerVisuals.py¶
1# © 2024 Autodesk, Inc. All rights reserved.
2
3# Get the left controller
4leftController = vrDeviceService.getVRDevice("left-controller")
5# Get the right controller
6rightController = vrDeviceService.getVRDevice("right-controller")
7# Get the first connected tracker
8tracker = vrDeviceService.getVRDevice("tracker-1")
9
10# Set left controller visualization to controller with hand
11leftController.setVisualizationMode(Visualization_ControllerAndHand)
12# Set right controller visualization to controller
13rightController.setVisualizationMode(Visualization_Hand)
14# Set the trackers visualization to controller, which in this case will
15# display a tracker visualization
16tracker.setVisualizationMode(Visualization_Controller)