Home/Help/State machine/States on the timeline

STATE MACHINE

States on the timeline

A state is a named stretch of the timeline: Off, Turning on, On. States are what the state machine connects, so a click can send the animation from one to another. They live in the States lane above the time ruler; they never overlap, and the keyframes stay where they are: a state is a window on the timeline, not a copy of it.

Do it in the editor: guided tour6 steps · about 3 minutes · opens a practice scene

Step by step

  1. Open the States lane

    Click States in the timeline's header. The lane opens above the time ruler; it stays once the file has a state (the same button hides it).

  2. Draw a state

    Drag across the lane from the start to 1 second. A state takes the stretch you drew, with its name ready for typing: type Off and press Enter. A double-click or F2 renames it later.

  3. Select the keys it should cover

    Drag a box around the keyframes from 1 second on: the knob's slide and the pill's color. The next state will run from the first of them to the last.

  4. Make a state from them

    Click + State at the lane's left, or press Alt M. The state runs from the first selected key to the last; type On and press Enter. A new state takes only free time, so it starts where Off ends.

  5. Play one state

    Right-click On and pick Play this state: only its stretch plays (the Loop button decides whether it repeats). The same menu renames a state, gives it another color, zooms the timeline to it (Focus) and removes it; removing a state never deletes its keyframes.

  6. Switch to State machine

    Click State machine in the middle of the top bar. This workspace connects the states into a flow: what the file plays first, and what a click or the end of a state does. Animate brings back the timeline.

Good to know. Drag a state to move it (it stops at its neighbours; hold Alt to carry the keys inside it along), or drag the grips inside a selected state's ends to resize it; Alt + the end grip pushes everything after it. A state of no length is a pose: one frame held. States are saved with the project.

Keys

Alt M+ State from the selected keys
F2Rename the selected state
DelRemove the selected state