Skip to content

AnimatorController DSL (AnimDsl) ​

A tool that imports and exports AnimatorControllers as JSON (DSL). It is a name-based declarative format designed for LLMs such as Claude to "read" and "write".

Window: さたにあしょっぴんぐ/エディタカスタマイザー/AnimatorController DSL (proto) (Satania Shopping / Editor Customizer / AnimatorController DSL (proto)) in the main menu

Schemas ​

SchemaTarget
sce.animcontroller/v0.1Entire controller
sce.animlayer/v0.1Single layer (with declarations of the parameters it references)
json
{
  "schema": "sce.animlayer/v0.1",
  "layer": "MyToggle",
  "parameters": [{ "name": "MyParam", "type": "Bool" }],
  "stateMachine": {
    "defaultState": "OFF",
    "states": [
      { "name": "OFF", "transitions": [{ "to": "ON", "conditions": [{ "param": "MyParam", "mode": "If" }] }] },
      { "name": "ON",  "transitions": [{ "to": "OFF", "conditions": [{ "param": "MyParam", "mode": "IfNot" }] }] }
    ]
  }
}

Export ​

  • In the window, you can convert the entire controller, or a single selected layer, to JSON
  • You can also export from the Animator window via right-click on a layer → Export Layer As DSL
  • The "JSON をファイルへ保存…" (Save JSON to File...) button saves it directly as a .json file (the default name is derived from the controller / layer name)
  • Transitions that originate from a sub-state machine (transitions on the sub-SM) and Behaviours attached directly to a StateMachine (behaviours) are exported too. When another sub-state machine has a state with the same name, transition targets use the path form such as Desktop/Enter (sub-SM names from the layer root joined with /; a / inside a name is written as \/)

Validate ​

Validates every part of the pasted JSON before applying it — duplicate parameter declarations and undeclared references / resolution of state names and transition destinations / WriteDefaults consistency / existence of Behaviour types and Motions, and so on. Errors are reported in a one-line format, so you can paste them straight back to the LLM and let it self-correct.

State names only have to be unique within the same state machine (the same name in another sub-state machine is fine). A name-only transition target that matches more than one place produces a warning; write it in the path form instead.

Apply ​

  • 新規作成 (Create New) — Generates a new .controller from the DSL content
  • 既存への追加 (Add to Existing) — Adds a layer to an existing controller
    • Parameter conflicts are resolved interactively: a parameter with the same name and type is reused / on a type mismatch, you choose from "既存を使う ⚠ / 別名で追加" (Use Existing ⚠ / Add with Different Name)
    • Layers with the same name are renamed automatically
    • sce.animlayer is only for this "Add" mode

Import requires Newtonsoft.Json

Loading, validating, and applying pasted JSON requires com.unity.nuget.newtonsoft-json (SCE_NEWTONSOFT_JSON). Export and its self-check work without it.

MIT License