XR Tracking Objects
The Show XR Tracking Objects
option creates new objects inside Blender's outliner, that will follow their corresponding XR devices (like the headset or controllers). They also provide the state of controller button presses. These objects will be created inside a collection named Freebird XR
.
The position/rotation of these objects and the state of button presses will be updated every frame (while VR is running).
This enables you to attach custom objects/bones to the VR headset or controllers using Constraints. You can also bind shapekeys to the button states to animate meshes.
The intent of this feature is to give users more flexibility, by giving them direct access to headset/controller info. This lets users build custom workflows that they need for themselves or their project.
Reference
The following four objects will be created inside a collection named Freebird XR
:
FB-Base
- Tracks the base position of the VR view. This updates only when you navigate around the scene.FB-Headset
- Tracks the headset. This will track every movement of the headset, including looking up/down.FB-Controller-Right
- Tracks the right controller.FB-Controller-Left
- Tracks the left controller.
Difference between FB-Base and FB-Headset
Imagine FB-Base
as your chair, and FB-Headset
as your head. FB-Headset
will capture every movement of your head, while FB-Base
will only change if you move your chair around the room.
Controller Buttons
Button press states are stored as 'Custom Properties' in each controller object. You can see them by selecting FB-Controller-Right
or FB-Controller-Left
, and then opening Properties
> Object
> Custom Properties
.
button_a
(bool
)button_b
(bool
)trigger
(float
)squeeze
(float
)joystick_x
(float
)joystick_y
(float
)
See the section on Using Button States for more info.
Attach to a XR Tracking Object
- Select the object that you wish to attach. E.g. a Camera.
- In the object's
Properties
panel, selectConstraints
. - Click
Add Object Constraint
, and selectCopy Location
andCopy Rotation
. - Set
Target
to the XR Tracking Object that you wish to track, e.g.FB-Base
orFB-Headset
.
Tip: You can attach bones in a similar way, using Bone Constraints
.
Using Button States
You can use the button press values to drive shapekeys, or use them in your scripts:
- To drive a shapekey, please right-click a property, e.g. 'trigger', and click
Copy as New Driver
. Then right-click on your shapekey value, and selectPaste Driver
. - To use in a script, use the custom property directly. E.g.
bpy.data.objects["FB-Controller-Right"]["trigger"]
Ideas for using this feature
- Place a camera that follows you around the scene (as you navigate inside VR). This is useful if you're streaming your work. Attach your camera to
FB-Base
. - Place reference images that follow you around. Attach your reference images to
FB-Base
. - Record live animation by attaching objects/bones/shapekeys to the controllers. E.g. for puppetery. Suggested:
FB-Controller-Right/Left
andFB-Headset
. - Create your VR features inside Blender.