logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    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
    object
    AnimationClipSettingsEngine
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Editor.AnimationHub.Engine
    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
    Type Description
    ClipSettingsView

    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
    Type Name Description
    AnimationClip clip
    ClipSettingsView view
    string undoLabel
    Returns
    Type Description
    bool

    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
    Type Description
    bool
    In this article
    © 2026 Serenity. All Rights Reserved