Class AnimationClipSettingsEngine
Reads and writes the settings block of an UnityEngine.AnimationClip — frame rate, loop behavior,
cycle offset, start/stop trim, wrap mode and (read-only) length and legacy status — plus its animation
events, mirroring the same read/write split ModelClipCreator
draws between validating an Input and mutating an asset.
Inheritance
AnimationClipSettingsEngine
Assembly: Serenity.AnimationHub.Editor.dll
Syntax
public static class AnimationClipSettingsEngine
Methods
Read(AnimationClip)
Declaration
public static ClipSettingsView Read(AnimationClip clip)
Parameters
| Type |
Name |
Description |
| AnimationClip |
clip |
|
Returns
ReadEvents(AnimationClip)
Declaration
public static AnimationEvent[] ReadEvents(AnimationClip clip)
Parameters
| Type |
Name |
Description |
| AnimationClip |
clip |
|
Returns
| Type |
Description |
| AnimationEvent[] |
|
Write(AnimationClip, ClipSettingsView, string)
Writes view's fields back onto clip. The settings block is a
whole-struct replace under UnityEditor.AnimationUtility.SetAnimationClipSettings(UnityEngine.AnimationClip,UnityEditor.AnimationClipSettings), so this reads the
clip's CURRENT settings first and mutates only the fields ClipSettingsView carries
(LoopTime, LoopPose,
CycleOffset, StartTime,
StopTime) — writing a fresh default struct instead would clobber
every field the view does not carry (mirror, additive-reference-pose, the loop-blend sub-toggles, ...)
back to their zero value. This is the exact trap ModelClipCreator.DuplicateClipCore already
avoids by reapplying a full settings block it read from the source clip rather than trusting a
default one.
Declaration
public static bool Write(AnimationClip clip, ClipSettingsView view, string undoLabel = "Edit Clip Settings")
Parameters
Returns
WriteEvents(AnimationClip, AnimationEvent[], string)
Declaration
public static bool WriteEvents(AnimationClip clip, AnimationEvent[] events, string undoLabel = "Edit Clip Settings")
Parameters
| Type |
Name |
Description |
| AnimationClip |
clip |
|
| AnimationEvent[] |
events |
|
| string |
undoLabel |
|
Returns