logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class ModelClipCreator

    Three independent clip-authoring operations, sharing one ModelClipCreator.Input/Serenity.Global.Infrastructure.Editor.SerenityCreationValidationResult/ ModelClipCreator.Result triple the same way ModelAnimatorCreator shares its own set: GenerateClip(Input) builds a small procedural clip from one of the ModelClipCreator.ClipPreset shapes (a from-scratch alternative for a model with no usable animation data at all), DuplicateEmbeddedClip(Input) copies an FBX-embedded clip out to an editable standalone .anim asset, and CreatePrefabVariant(Input) is the unblocking affordance for a read-only imported model — it creates a prefab variant the rest of this window's authoring tools (ModelAnimatorCreator and friends) can then write to. Every mutating operation runs inside a Serenity.Global.Infrastructure.Editor.SerenityAssetCreationTransaction, rolling back to a clean project on any failure — the same idiom CreateControllerForModel(Input) uses.

    Inheritance
    object
    ModelClipCreator
    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.Authoring
    Assembly: Serenity.AnimationHub.Editor.dll
    Syntax
    public static class ModelClipCreator

    Methods

    CreatePrefabVariant(Input)

    Creates a prefab variant of input's ImportedModelPath — the unblocking affordance for a read-only imported model: instantiating the model and saving that instance as a new prefab asset makes Unity persist it as a UnityEditor.PrefabAssetType.Variant (the instance stays connected to its source), which every other authoring tool in this window can then write to. Works the same way for a plain (non-imported) prefab source, which is how ModelClipCreatorTests covers this without an .fbx fixture.

    Declaration
    public static ModelClipCreator.Result CreatePrefabVariant(ModelClipCreator.Input input)
    Parameters
    Type Name Description
    ModelClipCreator.Input input
    Returns
    Type Description
    ModelClipCreator.Result

    DuplicateClip(AnimationClip, Input)

    Runs the exact copy mechanics DuplicateEmbeddedClip(Input) runs, given the already-resolved source clip directly instead of resolving it from an FBX by name — useful for duplicating a "Nearby" standalone clip too, not only an embedded one. This project also ships no imported-model (.fbx) fixture to build a black-box DuplicateEmbeddedClip(Input) test from, so ModelClipCreatorTests drives this overload with a standalone .anim clip instead — the copy path (instantiate, rename, persist, reapply clip settings) is identical either way; only how the source clip is found differs.

    Declaration
    public static ModelClipCreator.Result DuplicateClip(AnimationClip sourceClip, ModelClipCreator.Input input)
    Parameters
    Type Name Description
    AnimationClip sourceClip
    ModelClipCreator.Input input
    Returns
    Type Description
    ModelClipCreator.Result

    DuplicateEmbeddedClip(Input)

    Copies an FBX-embedded clip (resolved from input's SourceModelPath/SourceClipName) out to an editable standalone .anim asset — the source model stays untouched.

    Declaration
    public static ModelClipCreator.Result DuplicateEmbeddedClip(ModelClipCreator.Input input)
    Parameters
    Type Name Description
    ModelClipCreator.Input input
    Returns
    Type Description
    ModelClipCreator.Result

    GenerateClip(Input)

    Builds a small procedural UnityEngine.AnimationClip from input's ModelClipCreator.ClipPreset — a from-scratch alternative when a model has no usable source animation at all. Runs inside a transaction; any failure rolls the new clip (and any folder it created) back out.

    Declaration
    public static ModelClipCreator.Result GenerateClip(ModelClipCreator.Input input)
    Parameters
    Type Name Description
    ModelClipCreator.Input input
    Returns
    Type Description
    ModelClipCreator.Result

    ValidateCreatePrefabVariant(Input)

    Validates a CreatePrefabVariant(Input) request without creating anything.

    Declaration
    public static SerenityCreationValidationResult ValidateCreatePrefabVariant(ModelClipCreator.Input input)
    Parameters
    Type Name Description
    ModelClipCreator.Input input
    Returns
    Type Description
    SerenityCreationValidationResult

    ValidateDuplicateClip(Input)

    Validates a DuplicateEmbeddedClip(Input) request without creating anything.

    Declaration
    public static SerenityCreationValidationResult ValidateDuplicateClip(ModelClipCreator.Input input)
    Parameters
    Type Name Description
    ModelClipCreator.Input input
    Returns
    Type Description
    SerenityCreationValidationResult

    ValidateGenerateClip(Input)

    Validates a GenerateClip(Input) request without creating anything.

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