Class ZivaRTPlayer
A ZivaRT runtime component that can be attached to a GameObject. When configured properly this will allow for Ziva to be used to deform skin a mesh.
Inherited Members
Namespace: Global Namespace
Syntax
[RequireComponent(typeof(Animator))]
[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshRenderer))]
[ExecuteInEditMode]
public class ZivaRTPlayer : MonoBehaviour, IAnimationWindowPreview
Fields
DrawDebugVertices
Draw the vertices of the imported ZivaRT asset's rest shape in the Scene view. Can be useful to diagnose vertex mapping issues.
Declaration
[Tooltip("Draw the vertices of the imported ZivaRT asset's rest shape in the Scene view.")]
public bool DrawDebugVertices
Field Value
Type | Description |
---|---|
Boolean |
SuppressGeometryWarningMessages
Don't print out warnings about issues discovered with the mesh, eg: degenerate face UVs.
Declaration
[Tooltip("Silence warnings caused by issues found in the Source Mesh' geometry, e.g. degenerate UVs.")]
public bool SuppressGeometryWarningMessages
Field Value
Type | Description |
---|---|
Boolean |
Properties
AnimationRoot
The animation root for which the animation should be applied from
Declaration
public Transform AnimationRoot { get; set; }
Property Value
Type | Description |
---|---|
Transform |
AutoBounds
Automatically generated bounds used for visibility culling.
Declaration
public Bounds AutoBounds { get; }
Property Value
Type | Description |
---|---|
Bounds |
CalculateMotionVectors
Should motion vectors for deformed positions be calculated?
Declaration
public bool CalculateMotionVectors { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
CustomBounds
The custom bounds used for visibility culling.
Declaration
public Bounds CustomBounds { get; set; }
Property Value
Type | Description |
---|---|
Bounds |
EnableCorrectives
Whether to apply pre-skinning correctives from the ZivaRT solver (generally used for debugging).
Declaration
public bool EnableCorrectives { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
EnableSkinning
Whether to apply skinning to the mesh using the ZivaRT solver (used for debugging).
Declaration
public bool EnableSkinning { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
ExecutionSchedule
Should deformation calculations be started manually, in the LateUpdate phase or normal Update phase?
Declaration
public ZivaRTPlayer.ExecutionScheduleType ExecutionSchedule { get; set; }
Property Value
Type | Description |
---|---|
ZivaRTPlayer.ExecutionScheduleType |
GameObjectRoot
The GameObject root for which the animation should be applied from
Declaration
public Transform GameObjectRoot { get; set; }
Property Value
Type | Description |
---|---|
Transform |
Implementation
Select which internal implementation is used to perform the deformation. Different implementations have different properties (CPU vs GPU).
Declaration
public ZivaRTPlayer.ImplementationType Implementation { get; set; }
Property Value
Type | Description |
---|---|
ZivaRTPlayer.ImplementationType |
MeshRescale
Scale factor that should be applied to the Ziva RT vertices to match the mesh scaling applied on the imported mesh file
Declaration
public float MeshRescale { get; set; }
Property Value
Type | Description |
---|---|
Single |
MultithreadedJointUpdates
Should joint transform updates execute on multiple threads? This delays solver execution to LateUpdate
Declaration
public bool MultithreadedJointUpdates { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
RecalculateTangentFrames
Should the solver recompute target mesh normals and tangents each frame?
Declaration
public RecomputeTangentFrames RecalculateTangentFrames { get; set; }
Property Value
Type | Description |
---|---|
RecomputeTangentFrames |
Rig
The ZivaRT rig asset used to deform the target character mesh.
Declaration
public ZivaRTRig Rig { get; set; }
Property Value
Type | Description |
---|---|
ZivaRTRig |
SourceMesh
Source Mesh that will be deformed by the Ziva Rig. A copy will be created for the deformation which means this source mesh will not be modified directly.
Declaration
public Mesh SourceMesh { get; set; }
Property Value
Type | Description |
---|---|
Mesh |
UseCustomBounds
If this is true then custom bounds are used for mesh visibility culling. If this is false then bounds are computed automatically.
Declaration
public bool UseCustomBounds { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
UseMeshTransformForRegistration
Apply the local transform of the Skinned Mesh during vertex correspondence registration step.
Declaration
public bool UseMeshTransformForRegistration { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
GetMotionVectors(Vector3[])
Motion vectors. Not available if Compute Shader or Mono implementation is selected.
Declaration
public void GetMotionVectors(Vector3[] motionVectors)
Parameters
Type | Name | Description |
---|---|---|
Vector3[] | motionVectors |
GetNormals(Vector3[])
Final vertex normals after ZivaRT correctives and skinning have been applied. Not available if Compute Shader implementation is selected.
Declaration
public void GetNormals(Vector3[] normals)
Parameters
Type | Name | Description |
---|---|---|
Vector3[] | normals |
GetPositions(Vector3[])
Final vertex positions after ZivaRT correctives and skinning have been applied. Not available if Compute Shader implementation is selected.
Declaration
public void GetPositions(Vector3[] positions)
Parameters
Type | Name | Description |
---|---|---|
Vector3[] | positions |
GetTangents(Vector4[])
Final vertex tangents after ZivaRT correctives and skinning have been applied. Not available if Compute Shader implementation is selected.
Declaration
public void GetTangents(Vector4[] tangents)
Parameters
Type | Name | Description |
---|---|---|
Vector4[] | tangents |
RunSolver()
Runs the ZivaRT solver in it's current configuration. Note that by default the solver is already run if the object containing the ZivaRT component is visible. This method should only be used in advanced scenarios where there is a requirement to explicitely invoke the solver.
Declaration
public void RunSolver()
Explicit Interface Implementations
IAnimationWindowPreview.BuildPreviewGraph(PlayableGraph, Playable)
Appends custom Playable nodes to the Animation window PlayableGraph and sets it up to receive data from the ZivaRT Player.
Declaration
Playable IAnimationWindowPreview.BuildPreviewGraph(PlayableGraph graph, Playable inputPlayable)
Parameters
Type | Name | Description |
---|---|---|
PlayableGraph | graph | The Animation window PlayableGraph. |
Playable | inputPlayable | Current root of the PlayableGraph. |
Returns
Type | Description |
---|---|
Playable |
Implements
IAnimationWindowPreview.StartPreview()
Notification callback when the Animation window starts previewing an AnimationClip. Makes extra parameters be updated when the Animation window plays or otherwise updates.
Declaration
void IAnimationWindowPreview.StartPreview()
Implements
IAnimationWindowPreview.StopPreview()
Notification callback when the Animation window stops previewing an AnimationClip. Stops extra parameters from being updated when the Animation window plays or otherwise updates.
Declaration
void IAnimationWindowPreview.StopPreview()
Implements
IAnimationWindowPreview.UpdatePreviewGraph(PlayableGraph)
Notification callback when the Animation Window updates its PlayableGraph before sampling an AnimationClip.
Declaration
void IAnimationWindowPreview.UpdatePreviewGraph(PlayableGraph graph)
Parameters
Type | Name | Description |
---|---|---|
PlayableGraph | graph | The Animation window PlayableGraph. |