Ziva Real Time Player - Maya¶
The Ziva RT Player for Maya (ZRTP for Maya) is a plugin for Maya that can deploy a ZivaRT character.
Unzip the “ZivaRT.zip” archive, and navigate to “ZivaRT\ZRTPlayer-Maya”.
Copy the “zrtMayaPlayer.mll” file to the plugins directory for your version of Maya. On Windows for Maya version 2019, this is located at “C:\Users\User\Documents\maya\2019\plug-ins”.
For alternate installation instructions, or for more information, see the Maya Plugin Installation Instructions.
Now, open your version of Maya (in this example, 2019). Navigate to “Windows -> Settings/Preferences -> Plug-in Manager”. Navigate or search for “zrtMayaPlayer” and check the “loaded” checkbox. Now the plug-in is installed!
Quick Setup of a ZivaRT Character¶
Now that the plugin has been installed, let’s start using the maya plugin! For the purposes of this tutorial, a simple cylinder model will be used for demonstration.
First load the mesh and the skeleton joint hierarchy for the character. For example, you may load them from an FBX; or load them separately. The mesh does not need to contain the skinning weights, and it should not be bound to the skeleton using Maya’s skinning. The mesh and the skeleton must be identical to the ones used during the training.
Second, import the ZivaRT solver from the zrt file, and apply it to the mesh and the skeleton joint hierarchy using the zrtPlayer command (see details below).
Select the mesh to verify that the solver has been loaded successfully.
Your character is now a ZivaRT character in Maya! Play it through any skeleton animation to see the character deform. Notice the outward bulging of the cylinder arounds the bending joint.
This command creates a zrtPlayer Maya deformer node to deform the specified Maya mesh in real-time, based on a previously trained ZivaRT solver. Inputs to the deformer are a Maya joint hierarchy (specified by the root node), optionally augmented with extra pose parameters when the ZivaRT solver has been trained with them. Do not use extra pose parameters if they were not included when training the ZivaRT solver.
The mesh does not need to contain skinning weights. It should not be bound to the joint hierarchy using Maya skin clusters. The ZivaRT solver internally already stores the skinning weights.
The zrtPlayer node is created from a zrtSolverLoader node. This can either be an existing node, or the zrtSolverLoader node can be created by loading the solver from a file (the -i flag).
zrtPlayer [flags] [<zrtSolverLoader node>] [<jointSkeletonRoot> <mesh>] -h -help <n/a> Print this message. -l -load <string> Create the zrtPlayer by loading the solver from the given .zrt file. This will also create a zrtSolverLoader node. The .zrt file can be created using the ZivaRT Training application (ZRTT). -p -poseParams <string> The name of the optional plug that contains the extra pose parameters. Extra pose parameters can be used, for example, to specify muscle activations or facial expression weights. The plug should be a multi array of doubles. It can be on any suitable node, such as, for example, a transform node. -z -about <n/a> Print product info.
zrtPlayer -i "path/to/zrt/solver/file" -p <poseParamsPlug> <jointSkeletonRoot> <mesh>
This creates a zrtPlayer node whose ZivaRT solver is loaded from the given .zrt file. Also created is the corresponding zrtSolverLoader node. The zrtPlayer node is a Maya deformer that deforms the selected mesh using the loaded ZivaRT solver. The entries from the plug “poseParamsPlug” are connected to the created zrtPlayer node, as input extra pose parameters to the ZivaRT solver.
zrtPlayer -i "path/to/zrt/solver/file"
This is same as above, except that, because no mesh was provided, the created zrtPlayer isn’t applied to anything. It is a standard Maya deformer and you can later apply it to a mesh, as usual with Maya deformers.
zrtPlayer <zrtSolverLoader node> <jointSkeletonRoot> <mesh>
This is same as the first example above, except that the solver is obtained from an existing zrtSolverLoader node, as opposed to loading it from a disk zrt file. No extra pose parameters are connected to the created zrtPlayer node.
zrtPlayer -p <poseParamsPlug> <zrtSolverLoader node> <jointSkeletonRoot> <mesh>
This is same as above, except that the extra pose parameters are now specified, via the plug “poseParamsPlug”. This plug must be a multi array of doubles. The entries of the plug “poseParamsPlug” are connected to the created zrtPlayer node, as input extra pose parameters to the ZivaRT solver.
You can create the poseParamsPlug for extra pose parameters as follows (in MEL) :
createNode "transform" -name "myTransform"; // Create node to hold the extra parameters plug. addAttr -multi -k true -at double -shortName par -longName parameters; // Create the extra parameters plug. // Assign some values to the extra parameters plug: setAttr myTransform.parameters 1.0; setAttr myTransform.parameters 0.8; setAttr myTransform.parameters -0.3; // etc. // Do some keyframing: setKeyframe -attribute "parameters" -time 1sec -value 0.7 myTransform; setKeyframe -attribute "parameters" -time 3sec -value 2.5 myTransform; // etc.
In all cases, the mesh and the skeleton joint hierarchy (as well as the number of extra parameters, if used), must match the ones used during training. Furthermore, the indices of the joints, vertices, and extra parameters should match the indices used when training the ZivaRT solver, otherwise results are undefined.