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
AnimationClipCopyEngine
Assembly: Serenity.AnimationHub.Editor.dll
Syntax
public static class AnimationClipCopyEngine
Methods
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
Returns
Validates a request without creating anything. Re-checked at the top of Create(Input).
Declaration
public static SerenityCreationValidationResult Validate(AnimationClipCopyEngine.Input input)
Parameters
Returns
| Type |
Description |
| SerenityCreationValidationResult |
|