public sealed class AnimationGraphDocumentAn animation graph, open for editing.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The third graph doc 11 names. The model and the compiler are Vixen.Editor.AnimationGraph's — which knows nothing about a project, a document or a panel, so its tests compile a graph with no editor in the way — and this is the YAML end of it and the undo stack over it.
⚠ Compiled when it is asked for, not on every edit. Adding a state produces a graph with a state nothing transitions to; adding a transition produces one whose destination is briefly the wrong state. Compiling on every change would fill the panel with complaints about a state somebody is halfway through leaving — the same rule CompositorDocument states.
⚠ Clips are not resolved and the compiler is told so. Loading an AnimationClip needs the skeleton it is baked against, which the editor has no way to choose from a graph alone; the compiler reports each unresolved clip and checks the topology anyway, which is the half of a graph an author can actually get wrong.
Fields and properties (6)
public const string ExtensionWhat an animation graph is written as.
public string AssetPathWhere the file is, absolute.
public AnimationGraphAsset GraphThe graph.
public string? LoadErrorWhy the file would not read, or .
public IReadOnlyList<AnimationGraphDiagnostic> DiagnosticsWhat the last Compile had to say.
public AnimationGraphArtefact? ArtefactWhat the last Compile produced, or .
Events (1)
public Action<AnimationGraphDocument>? ChangedRaised after anything changes the graph.
Methods (15)
public AnimationGraphDocument(EditorProject project, AssetId asset, string path)Opens a graph.
public AnimationLayerData? Layer(int index)The layer at an index, or .
public void AddLayer(string name)Adds a layer, undoably.
public bool RemoveLayer(AnimationLayerData layer)Removes a layer, undoably.
public AnimationStateData AddState(AnimationLayerData layer, string name, float x, float y)Adds a state to a layer, undoably.
public bool RemoveState(AnimationLayerData layer, AnimationStateData state)Removes a state and every transition into it, undoably.
public void MoveState(AnimationStateData state, float x, float y)Moves a state's box, undoably.
public AnimationTransitionData AddTransition(AnimationStateData from, string to)Adds a transition between two states, undoably.
public bool RemoveTransition(AnimationStateData from, AnimationTransitionData transition)Removes a transition, undoably.
public void AddParameter(string name, AnimationParameterType type)Adds a parameter, undoably.
public bool RemoveParameter(AnimationParameterData parameter)Removes a parameter, undoably.
public void Edit(string name, Action change)Records an arbitrary edit to the graph, undoably, by remembering the text.
public AnimationGraphArtefact? Compile()Compiles the graph and keeps what it said.
public string ToYaml()The graph as it would be written, without writing it.
protected override void SaveCore()Writes the document back to wherever it came from.
Used by (4)
- AnimationGraphEditorFactoryVixen.Editor.AssetEditors
- AnimationGraphViewVixen.Editor.AssetEditors
- AuthoringTestsVixen.Editor.AssetEditors.Tests
- StateMapViewVixen.Editor.AssetEditors