Documentation: Motion Capture (Puppeteering)

Motion Capture (Puppeteering)

The Motion Capture features in MARUI allow you to transfer your controller and headset motions directly on some Maya objects or rigs, and record your motions as Maya keyframes on those objects.
Please see the following video for a quick introduction on how to use Motion Capture in MARUI:
https://www.youtube.com/watch?v=YiuSJ65pHKI
To access this user interface, hold down the “Alt” button on your left controller so that the “User Interface Layout” menu appears on your right controller.

Hold the “User Interface Layout” button to bring up the menu, and select “MoCap (Puppeteering)” to switch to the UI layout.
You now have access to new widgets on your controllers which are explained in detail below.

.

.

.

­

QuickAttach
MoCap Attach Left Icon MoCap Attach Right Icon
With the Quick-Attach widgets on your left and right controller, you can easily attach the currently selected Maya object to the controller.
To attach an object to a controller, select the Maya object and press the button on the controller to which you want to attach it.
To break the attachment, press the button again.

.

.

.

Recording
MoCap Record Icon
With the MoCap Recording you can start / stop recording keyframes for the currently attached objects.
Press the button to start the recording from the current Maya frame and press it again to end recording.
Please see the MoCap Dialog on how to adjust recording speed and frame rate.

.

.

.

The MoCap Dialog
MoCap Icon MoCap Shelf Icon
In the Animation Menu, you can open the MoCap Dialog as a floating window. Here you have more options to customize the motion capture process.
MoCap Dialog
In the top part, you can attach Maya objects to your VR devices such as your headset or left and right controller. Note that “Maya-to-VR” means that the Maya object will follow the motion of your VR device. You can also select “VR-to-Maya” to make your VR devices follow the motion of Maya objects (reverse attachment).
Pause tracking:
You can temporarily suspend the MoCap setup without deleting the attachments. Press the button once to pause tracking, press it again to resume the MoCap operation.
Record:
In the same way as the Recording button on the controller, you can press the Record button in the dialog to start MoCap recording. Recording will be started from the current Maya frame. Press the button again to stop recording.
Recording speed:
In the lower part of the MoCap dialog you can choose the speed and framerate at which you wish to record the motion.
The recording speed is relative to real-time, meaning that “1.0” means recording motion at real time, and “0.5” means recording at half-speed, meaning that a motion that you perform in 10 seconds will turn into 5 seconds of Maya animation.
MARUI respects your Maya scene settings, meaning that if you set Maya to 24fps film units and set the recording speed to “1.0”, then MARUI will create 24 frames of animation per second of real time.
Frame skip:
Below the recording speed, you can specify to skip frames when recording. The default is “0”, meaning that a keyframe will be created on every Maya frame.
You can set it to “1” or higher to skip frames which will then not receive any keyframes, allowing Maya to interpolate the motion. This can be useful if you’re trying to achieve smoother motion and avoid the shakiness that VR controllers can sometimes exhibit.
Saving / Loading MoCap setups:
At the bottom of the dialog you can save the current MoCap setup to disk. It will be saved in your Maya preferences directory (usually: C:\Users\\Documents\maya\\prefs ) as a MEL scripted named MARUI_MoCapSetup.mel. You can edit this script with a text editor. The “Load” button will load the setup saved in this script file.

.

.

.

Scripting
If you want to automate your motion capture set-up, you can use the MARUI scripting command “MARUI_MoCap“. The command details are explained below.

In the basic (creation) mode, the MARUI_MoCap command creates a new attachment.

MARUI_MoCap -direction "maya2vr" // <- attach Maya object to VR (can be "vr2maya" for reverse attachment)
-device leftController // <- which VR device to attach the object to ("hmd", "leftController", "rightController", "tracker0")
-dofTranslation 1 // <- whether to affect the objects translation (position)
-dofRotation 1 // <- whether to affect the objects rotation (orientation)
-dofScale 0 // <- whether to affect the objects scale (size)
-relativeOffset 1 // <- whether to retain the current offset between the object and the VR device (1) or use the device's absolute position (0)
-active 1 // <- whether this attachment is enabled (1) or disabled (0)
myObject; // <- name (path) of the Maya object to attach.

In query mode, you can get information on existing attachments, and in edit mode you can change attachment details. All attachments are defined by the name of the attached Maya object.
In addition to the parameters listed above, you can query the following information:

float $t[] = `MARUI_MoCap -q -offsetTranslation`; // Get the translation part of the offset in Maya units as 3 float values.
float $r[] = `MARUI_MoCap -q -offsetRotation`; // Get the rotation part of the offset in radians as 3 float values.
float $s[] = `MARUI_MoCap -q -offsetScale`; // Get the scaling part of the offset as 3 float values.

There are also a couple of special command usages:

MARUI_MoCap -record 1; // Start recording.
MARUI_MoCap -record 0; // Stop recording.
MARUI_MoCap -recordingSpeed 2.0; // Set the recording speed (1.0 being real-time, respecting the Maya time unit).
MARUI_MoCap -recordinFrameSkip 2; // Set how many frames will be skipped between setting keyframes (0 means record every frame).
MARUI_MoCap -list; // Returns a list of all currently existing commands.
MARUI_MoCap -delete myObject; // Delete the attachment with this Maya object.
MARUI_MoCap -deleteAll; // Delete all constraints.