Table of Contents

Class VirtualClip

Namespace
nadena.dev.ndmf.animator

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

VirtualMotion

AdditiveReferencePoseTime

public float AdditiveReferencePoseTime { get; set; }

Property Value

float

FrameRate

public float FrameRate { get; set; }

Property Value

float

IsDirty

True if this clip has been modified since it was cloned or created.

public bool IsDirty { get; }

Property Value

bool

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

bool

Legacy

Controls the legacy setting on the animation clip.

public bool Legacy { get; set; }

Property Value

bool

LocalBounds

public Bounds LocalBounds { get; set; }

Property Value

Bounds

Name

public override string Name { get; set; }

Property Value

string

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

bool

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

VirtualClip

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 CloneContext
clip AnimationClip

Returns

VirtualClip

Commit(object, Motion)

protected override void Commit(object context_, Motion obj)

Parameters

context_ object
obj Motion

Create(string)

public static VirtualClip Create(string name)

Parameters

name string

Returns

VirtualClip

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

pathEditor Func<string, string>

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

VirtualClip

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

path string
type Type
prop string

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

path string
type Type
prop string

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 EditorCurveBinding
curve AnimationCurve?

SetFloatCurve(string, Type, string, AnimationCurve?)

public void SetFloatCurve(string path, Type type, string prop, AnimationCurve? curve)

Parameters

path string
type Type
prop string
curve AnimationCurve?

SetObjectCurve(EditorCurveBinding, ObjectReferenceKeyframe[]?)

public void SetObjectCurve(EditorCurveBinding binding, ObjectReferenceKeyframe[]? curve)

Parameters

binding EditorCurveBinding
curve ObjectReferenceKeyframe[]

SetObjectCurve(string, Type, string, ObjectReferenceKeyframe[]?)

public void SetObjectCurve(string path, Type type, string prop, ObjectReferenceKeyframe[]? curve)

Parameters

path string
type Type
prop string
curve ObjectReferenceKeyframe[]