Class ModelClipCreator
Inheritance
ModelClipCreator
Assembly: Serenity.AnimationHub.Editor.dll
Syntax
public static class ModelClipCreator
Methods
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
Returns
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
Returns
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
Returns
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
Returns
Declaration
public static SerenityCreationValidationResult ValidateCreatePrefabVariant(ModelClipCreator.Input input)
Parameters
Returns
| Type |
Description |
| SerenityCreationValidationResult |
|
Declaration
public static SerenityCreationValidationResult ValidateDuplicateClip(ModelClipCreator.Input input)
Parameters
Returns
| Type |
Description |
| SerenityCreationValidationResult |
|
Declaration
public static SerenityCreationValidationResult ValidateGenerateClip(ModelClipCreator.Input input)
Parameters
Returns
| Type |
Description |
| SerenityCreationValidationResult |
|