Class VirtualClip
An abstraction over Unity AnimationClips. This class is designed to allow for low-overhead mutation of animation clips, and in particular provides helpers for common operations (e.g. rewriting all paths in a clip).
public sealed class VirtualClip : VirtualMotion
- Inheritance
-
VirtualClip
- Inherited Members
Properties
AdditiveReferencePoseClip
public VirtualMotion? AdditiveReferencePoseClip { get; set; }
Property Value
AdditiveReferencePoseTime
public float AdditiveReferencePoseTime { get; set; }
Property Value
FrameRate
public float FrameRate { get; set; }
Property Value
IsDirty
True if this clip has been modified since it was cloned or created.
public bool IsDirty { get; }
Property Value
IsMarkerClip
True if this is a marker clip; in this case, the clip is immutable and any attempt to mutate it will be ignored. The clip will not be cloned on commit.
public bool IsMarkerClip { get; }
Property Value
Legacy
Controls the legacy
setting on the animation clip.
public bool Legacy { get; set; }
Property Value
LocalBounds
public Bounds LocalBounds { get; set; }
Property Value
- Bounds
Name
public override string Name { get; set; }
Property Value
Settings
public AnimationClipSettings Settings { get; set; }
Property Value
- AnimationClipSettings
UseHighQualityCurves
Controls the (unexposed) High Quality Curve setting on the animation clip.
public bool UseHighQualityCurves { get; set; }
Property Value
WrapMode
public WrapMode WrapMode { get; set; }
Property Value
- WrapMode
Methods
Clone()
Clones a VirtualClip. The new VirtualClip is backed by an independent copy of the original clip.
public VirtualClip Clone()
Returns
Clone(CloneContext, AnimationClip)
Clones an animation clip into a VirtualClip. The provided BuildContext is used to determine which platform to use to query for marker clips; if a marker clip is found, it will be treated as immutable.
public static VirtualClip Clone(CloneContext cloneContext, AnimationClip clip)
Parameters
cloneContext
CloneContextclip
AnimationClip
Returns
Commit(object, Motion)
protected override void Commit(object context_, Motion obj)
Parameters
context_
objectobj
Motion
Create(string)
public static VirtualClip Create(string name)
Parameters
name
string
Returns
EditPaths(Func<string, string?>)
Edit the paths of all bindings in this clip using the provided function. If this results in a path collision, it is indeterminate which binding will be preserved. If null is returned, the binding will be deleted.
public void EditPaths(Func<string, string?> pathEditor)
Parameters
FromMarker(AnimationClip)
Creates a VirtualClip representing a "marker" clip. This is a clip which must be preserved, as-is, in the final avatar. For example, VRChat's proxy animations fall under this category. Any attempt to mutate a marker clip will be ignored.
public static VirtualClip FromMarker(AnimationClip clip)
Parameters
clip
AnimationClip
Returns
GetFloatCurve(EditorCurveBinding)
public AnimationCurve? GetFloatCurve(EditorCurveBinding binding)
Parameters
binding
EditorCurveBinding
Returns
- AnimationCurve?
GetFloatCurve(string, Type, string)
public AnimationCurve? GetFloatCurve(string path, Type type, string prop)
Parameters
Returns
- AnimationCurve?
GetFloatCurveBindings()
public IEnumerable<EditorCurveBinding> GetFloatCurveBindings()
Returns
- IEnumerable<EditorCurveBinding>
GetObjectCurve(EditorCurveBinding)
public ObjectReferenceKeyframe[]? GetObjectCurve(EditorCurveBinding binding)
Parameters
binding
EditorCurveBinding
Returns
- ObjectReferenceKeyframe[]
GetObjectCurve(string, Type, string)
public ObjectReferenceKeyframe[]? GetObjectCurve(string path, Type type, string prop)
Parameters
Returns
- ObjectReferenceKeyframe[]
GetObjectCurveBindings()
public IEnumerable<EditorCurveBinding> GetObjectCurveBindings()
Returns
- IEnumerable<EditorCurveBinding>
Prepare(object)
protected override Motion Prepare(object context)
Parameters
context
object
Returns
- Motion
SetFloatCurve(EditorCurveBinding, AnimationCurve?)
public void SetFloatCurve(EditorCurveBinding binding, AnimationCurve? curve)
Parameters
binding
EditorCurveBindingcurve
AnimationCurve?
SetFloatCurve(string, Type, string, AnimationCurve?)
public void SetFloatCurve(string path, Type type, string prop, AnimationCurve? curve)
Parameters
SetObjectCurve(EditorCurveBinding, ObjectReferenceKeyframe[]?)
public void SetObjectCurve(EditorCurveBinding binding, ObjectReferenceKeyframe[]? curve)
Parameters
binding
EditorCurveBindingcurve
ObjectReferenceKeyframe[]
SetObjectCurve(string, Type, string, ObjectReferenceKeyframe[]?)
public void SetObjectCurve(string path, Type type, string prop, ObjectReferenceKeyframe[]? curve)