Animate a property
Place keys on the property owner and predict the sampled value between keys.
Put animate directly inside the element that owns the property. Key a shape’s translate-x to move its whole picture, a rectangle’s width to resize its contour, or a child shape’s along to move it on its host’s contour. For each track, declare an authored scene frame-rate and at least two strictly increasing keys. Keep a valid base value on the owner when the property requires one. Track authoring and key ownership
Match a moving marker to a stroke reveal
In the runnable road scene, the marker starts with along="0". Its track advances the locator from 0 on frame 0 to 1 on frame 24. The stripe uses the same keys for the end on its trim. The road travels 60 units right, then 40 units down, with its origin translated to (16, 16).
| Sample | Locator and trim end | Marker origin in the scene |
|---|---|---|
| Frame 0 | 0 | (16, 16) |
| Frame 12 | 0.5 | (66, 16), facing right |
| Frame 18 | 0.75 | (76, 31), facing down |
| Frame 24 | 1 | (76, 56), facing down |
The ease on the first key applies to the segment leaving it. linear gives the halfway value at frame 12. Try ease="hold" on both tracks’ first keys. At frame 12 the marker stays at the start and the stripe remains empty. Frame 24 still reaches the end because both tracks use fill="freeze". Change both tracks to fill="remove" and frame 24 instead returns to the authored base values of zero. Track evaluation and repeat boundaries
A frame address follows the authored rate. At 24 fps, frame="12" and time="0.5s" denote the same instant, so they would be duplicate addresses in the same track. At 30 fps, frame 12 moves to 0.4 seconds and the seconds address stays at 0.5. For a track inside another composition, resolve the owning clock first.
Examples
Download the complete .nothing source · Source on GitHub
Rendered with ncf-preview at 128 × 96.




<shape translate-x="16" translate-y="16">
<polyline points="0,0 60,0 60,40"/>
<stroke stroke-width="12">
<paint><solid color="#2C313CFF"/></paint>
</stroke>
<stroke stroke-width="6">
<trim start="0" end="0">
<animate attributeName="end" fill="freeze">
<key frame="0" value="0" ease="linear"/>
<key frame="24" value="1"/>
</animate>
</trim>
<paint><solid color="#F4F4F5FF"/></paint>
</stroke>
<shape along="0" orient="auto">
<polygon points="-2,-6 8,0 -2,6"/>
<fill><paint><solid color="#FFC23DFF"/></paint></fill>
<animate attributeName="along" fill="freeze">
<key frame="0" value="0" ease="linear"/>
<key frame="24" value="1"/>
</animate>
</shape>
</shape>