The interpolation tool is a lightweight utility designed to take a sequence of TrainCarts animation frames and mathematically generate smooth in‑between frames, creating fluid transitions between each defined position or rotation. It analyzes the differences between consecutive frames and applies a paired quadratic curve, one for accelerating into the motion and one for slowing out of it, to produce natural‑looking movement rather than abrupt jumps. By processing values such as position (x, y, z) and orientation (pitch, yaw, roll), it outputs a refined set of interpolated frames that preserve the overall motion while greatly increasing smoothness.
1) Create a raw animation using TrainCarts.
(Important: Always use the TOTAL rotation angle—e.g., 360 → 370 instead of 360 → -10.)
2) (!) Export the train using: "/train export", then open the generated hastebin link and edit the hastebin file. (!)

IMPORTANT:
In the latest dev build of TrainCarts (#1684+), it's possible to export and import the animation directly with "/train animation export" and "/train animation import <link>" respectively. There's also an --insert flag to add to the animation instead of replacing it. This way, you don't need to look for the animation in your train YAML and can edit it directly in the hastebin editor. You can skip steps 3, 4, 8, 9 and 11.

3) Copy the YAML contents into an editor like Notepad++ so you can edit it safely.
4) Locate the animation frames inside the YAML and copy them.
5) Paste the frames into the tool’s “Input” box. Example input:

        - t=1.0

        - t=1.0 yaw=30.0 roll=10.0

        - t=1.0 yaw=-20.0 roll=10.0

 

6) Set “Frames per segment” and “Offset” to the desired value, then click "Generate". The tool will create interpolated frames based on your data.
7) Copy the output from the tool.
8) Paste the output back into your YAML editor (watch out for indentation: Notepad++ can switch between space‑tabs and tab‑tabs, which is why editing the YAML directly in hastebin is not recommended).
9) Copy the entire updated YAML from your editor.
10) Paste it back into hastebin, press save (ctrl+s), and copy the new link.
11) Import the updated train using: /savedtrain <name> import <link>
12) Respawn the train to load your updated animation.
This is the lite version of the tool. We are currently developing a professional version, which allows for more control over the frames and their interpolation. There are also plans to add scene- and visibility support for frames, and a direct yaml import for the Lite version to reduce the amount of steps needed. Please be sure to enable notifications if you want to use the "upload" feature. If you need help, don't hesitate to join our Discord server!

Input

Output

Settings