Print the serial number of a device¶
Shows how to print the serial number of a controller, when it activates the pointer interaction.
vr/printSerialNumber.py¶
1# © 2024 Autodesk, Inc. All rights reserved.
2
3# Print the serial number of a device
4def printSerialNumber(action, device):
5 print((device.getSerialNumber()))
6
7# Get an interaction of which an action signal can be used
8pointer = vrDeviceService.getInteraction("Pointer")
9# Get an action
10prepare = pointer.getControllerAction("prepare")
11# Connect the method to print the serial number to the signal of the action
12prepare.signal().triggered.connect(printSerialNumber)