FmmAnimationGenerator

public final class FmmAnimationGenerator

Generates per-item Bedrock animation JSON containing the three Rainbow-style animations (hold_first_person, hold_third_person, head) for one model bone. First and third person are derived from the vanilla Bedrock player rig so the held model matches Java (see HeldItemTransform). Layout: one file per identifier at animations/__.animation.json containing three animation entries: - animation..hold_first_person - animation..hold_third_person - animation..head Each entry: loop=true, single bone "bone" with position/rotation/scale arrays. Default head transform: position (0, 20, 0), scale 0.655. If a Java display.head transform is provided, the formula in Rainbow's AnimationMapper.java:48 is: headPosition = (Java.translation / 0.0625) * (-0.655, 0.655, 0.655) + (0, 20, 0) but the /0.0625 step is Rainbow undoing Java's parser, which multiplies pixel-unit JSON values by 0.0625 to get block units (see AnimationMapper.java:15 comment). RSPM reads the bone JSON directly, so translations are STILL in pixel units — the divide step must NOT be applied here. The corrected formula is: headPosition = Java.translation * (-0.655, 0.655, 0.655) + (0, 20, 0) headRotation = (-Java.rotX, -Java.rotY, +Java.rotZ) headScale = Java.scale * 0.655

Types

Link copied to clipboard
public final class AnimationIds extends Record
Result identifiers (fully qualified, including the "animation." prefix).
Link copied to clipboard
public final class JavaDisplay
One Java display.<slot> transform.

Functions

Link copied to clipboard
public static FmmAnimationGenerator.AnimationIds generate(String animBaseId, String fileBaseName, FmmAnimationGenerator.JavaDisplay javaHeadDisplay, FmmAnimationGenerator.JavaDisplay javaFirstPersonDisplay, FmmAnimationGenerator.JavaDisplay javaThirdPersonDisplay, Array<double> bonePivot, File bedrockPackDir)
Writes one animation file containing all three Rainbow-style animations.