logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class AnimationClipCopyEngine

    "Make Editable Copy": duplicates an UnityEngine.AnimationClip that cannot be edited in place (an FBX-embedded clip, or any clip AnimationClipEditability otherwise blocks) out to a standalone .anim asset, then — optionally — repoints every state and blend tree in an UnityEditor.Animations.AnimatorController that used the source clip to the new copy via ReplaceMotion(AnimatorController, Motion, Motion). Shares the Input/SerenityCreationValidationResult/Result triple and Serenity.Global.Infrastructure.Editor.SerenityAssetCreationTransaction rollback idiom ModelClipCreator and Serenity.GameSave.Infrastructure.Editor.Builder.GameSaveCreator already establish; this supersedes ModelClipCreator.DuplicateEmbeddedClip/DuplicateClip for the clip-editor flow specifically because it also closes the rewire gap those two leave open — after a plain duplicate, every state that used to play the original still does, and the new copy sits unused until someone rewires it by hand.

    Inheritance
    object
    AnimationClipCopyEngine
    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 AnimationClipCopyEngine

    Methods

    Create(Input)

    Copies input's SourceClip to a standalone .anim asset, reapplying the settings block UnityEngine.Object.Instantiate(UnityEngine.Object) does not reliably carry across, then — when requested and a controller was given — rewires every state and blend tree that used the source clip to the new copy before committing. A failed rewire fails the whole operation: the transaction below only knows how to delete assets IT created, so on a rewire failure this throws, the outer catch rolls the freshly created copy back out, and the (partially applied) controller edit is left for ReplaceMotion(AnimatorController, Motion, Motion)'s own UnityEditor.Undo.RegisterCompleteObjectUndo(UnityEngine.Object,System.String) entry to revert — two separate safety nets, one per asset kind, because the transaction has no way to restore a pre-existing asset's prior field values.

    Declaration
    public static AnimationClipCopyEngine.Result Create(AnimationClipCopyEngine.Input input)
    Parameters
    Type Name Description
    AnimationClipCopyEngine.Input input
    Returns
    Type Description
    AnimationClipCopyEngine.Result

    Validate(Input)

    Validates a request without creating anything. Re-checked at the top of Create(Input).

    Declaration
    public static SerenityCreationValidationResult Validate(AnimationClipCopyEngine.Input input)
    Parameters
    Type Name Description
    AnimationClipCopyEngine.Input input
    Returns
    Type Description
    SerenityCreationValidationResult
    In this article
    © 2026 Serenity. All Rights Reserved