DEV: Custom Animations - Llennpie/Saturn GitHub Wiki
This guide will explain how to create (or replace) custom animations in Saturn.
Table of Contents
- Creating a METAL Composer Animation
- Replacing Existing Animations with DynOS
- Fixing the Animation for DynOS
- Completion and Final Notes
Requirements
- Blender (2.82 or higher)
- Fast64 Blender plugin
- Or instead, the MCOMP+ Fast64 fork if creating custom animations
Creating a METAL Composer Animation
Saturn supports custom animations created with the MCOMP+ Fast64 fork. These files, exported as JSONs, contain both animation data and metadata (name and author).
After downloading the plugin, open the mario.blend
and begin animating his armature in Blender.
Once complete, export the animation to a JSON file from the Animation Exporter.
Place the exported JSON file in the dynos/anims/
folder and you're finished! Relaunch Saturn and your animation should appear under the CUSTOM... category.
Replacing Existing Animations with DynOS
If you're instead looking to replace existing in-game animations (such as the triple jump animation) with new custom ones, you can do so with Fast64, DynOS, and a little bit of manual text editing:
Exporting the Animation from Fast64
To export animations for usage in Saturn, you will need to configure Fast64 to export to C. You can do so by navigating to SM64 -> SM64 File Settings -> Export type and set to C.
If you are using the MCOMP+ Fast64 fork, navigate to Fast64 -> SM64 Animation Exporter and set Export to C.
You do not need to specify a ROM, Decomp folder, or any other file path.
In SM64 Animation Exporter, enable Custom Export Path and set the Directory to a safe place on your computer. The Name must be set to mario
.
Once finished, select your armature and press Export Animation.
Navigate to where the animation was saved. A folder called mario/
should have been created where you saved the animation. Copy the mario/
folder into your model pack's directory (the folders should align).
Fixing the Animation for DynOS
Now that the animation is in the correct folder, we can start tweaking it to work with DynOS.
First, delete the anim_header.h
in mario/
as it is not required. In the anims/
folder, delete both data.inc.c
and table.inc.c
. You should be left with one animation C file - anim_<some_animation_name>.inc.c
.
You must now rename the animation file to anim_XX.inc.c
, where XX
is the hexadecimal code of the replaced animation. For this example, I'll be using 00
, or as it is called in-game, MARIO_ANIM_SLOW_LEDGE_GRAB
. You can view the list of codes associated to each animation in mario_animation_ids.h.
Once completed, open the file in a text editor of your choice (I'll be using Visual Studio Code, but something like Notepad will work too).
You must now rename all instances of mario_anim_BlahBlahBlah
to anim_XX
. The most important part here is that every XX in the file must be the same as the XX you chose for your filename.
static const struct Animation anim_XX[] = {
... some numbers ...
ANIMINDEX_NUMPARTS(anim_XX_indices),
anim_XX_values,
anim_XX_indices,
0,
};
static const u16 anim_XX_indices[] = {
... some numbers ...
};
static const s16 anim_XX_values[] = {
... some numbers ...
};
For instance, if you wanted to replace the triple jump animation (which code is C1
), the file must be named anim_C1.inc.c
and must contain the structures anim_C1
, anim_C1_indices
and anim_C1_values
.
Completion and Final Notes
Once that's renamed, delete the model's mario_geo.bin
and launch Saturn. If set up correctly, playing the animation you replaced should have the intended result. Currently, the animation mixtape is not visually configured to work with replaced animations, but it should still work fine.