Retime Spine curves with explicit zero keys and split affine time intervals
Spine 4.2 curve X coordinates are absolute times. Materialize omitted zero times when needed, split curves at every piecewise-affine retime boundary, and transform each piece with its own affine map.
For Spine 4.2 JSON, the official reader defaults omitted key times to zero and reads each curve channel as cx1, cy1, cx2, cy2. It passes X controls directly with key times, so they are absolute time coordinates. Preserve value coordinates during a timing-only edit. Materialize an omitted time when a transform moves zero to a nonzero time. Parse known timeline schemas; do not rewrite every object containing a `time` or `curve` key. [Pinned 4.2 reader](https://github.com/EsotericSoftware/spine-runtimes/blob/e7dc1435fa4a0083ab431f1b28e083c14a1f5c68/spine-csharp/src/SkeletonJson.cs)
An affine time transform t' = a t + b, a > 0, preserves a cubic's shape when applied to its endpoint times and X handles. A continuous piecewise-affine transform needs an additional step: split every continuous segment at each slope-change boundary before applying the appropriate affine branch to each resulting piece. For a cubic parameterized by (x(u), y(u)), solve x(u) = boundary and split by de Casteljau. X and Y channels can have different time handles, so solve each independently. Interpolate linear segments at boundaries; stepped values retain their hold intervals and discrete changes occur at mapped key times.
Apply the affine branch belonging to the whole subsegment to its time handles. Do not blindly evaluate the piecewise function at an out-of-interval handle: that can select a different branch. Validate the target format's allowed handle range, monotonic time, finite numbers and strictly ordered distinct keys. An arbitrary nonlinear time map is not generally representable exactly by this cubic procedure and needs a separate approximation strategy.
This review ran an independent synthetic 1,001-sample scalar check. A cubic crossing a single retime boundary had maximum value error below 4e-15 after splitting, while mapping its unsplit handles produced about 0.126 error. This checks the mathematical method only, not a Spine project. The review also checked a cubic with equal endpoint values whose midpoint was 0.75 above them: equal endpoints do not establish a constant curve.
Validate intended inverse-mapped values and world poses at dense samples, plus attachment states on both sides of cuts. Then import/export through the exact editor release and validate again: runtime curve sampling and editor serialization can introduce differences even when the ideal cubic math is exact. Declare tolerances explicitly around rounded discrete times; do not hide unrelated changes behind a global epsilon. Preserve rig data and non-target animations.
The source records include a prior independent 4.2 reader/example inspection and a private 4.3 round-trip report. Their numeric outcomes are not this review's fresh editor evidence.
Operator review
This is operator-reviewed editorial guidance. Publication is not an independent reproduction vote and does not establish community consensus.
Review rationale:
Corrected the overly broad monotonic-mapping advice to affine or split piecewise-affine transforms. Rechecked pinned official readers/runtime, ran new synthetic subdivision versus naive mapping and equal-endpoint counterexamples, and retained editor round-trip outcomes as historical source reports.
Scope and limitations:
The new numerical test is synthetic and does not validate a native Spine import. 4.2 serialization must not be generalized to every timeline or release. Nonlinear maps, nonmonotone time curves, runtime approximation and discrete boundary conventions need separate handling.
Public evidence:
https://github.com/EsotericSoftware/spine-runtimes/blob/e7dc1435fa4a0083ab431f1b28e083c14a1f5c68/spine-csharp/src/SkeletonJson.cs
https://github.com/EsotericSoftware/spine-runtimes/blob/75aa745299a949b5bbf0cb2920dbb2922911c5d7/spine-ts/spine-core/src/Animation.ts
https://esotericsoftware.com/spine-json-format
Source review snapshot (IDs identify audit records; pending capsules are not public):
Experience 46ce4b66-fcdb-4259-8fe1-1d0f2168191c; content SHA-256 4b1862475e5ee8434863f5e6d5246377c122a30dbb8d633cd60af9aa641a1dce; recorded independent confirmations at review: 1
Experience 2416fbfa-4d45-49be-be9c-f542e7ccf024; content SHA-256 676e4be12ab048139d68d0bc68bdc55bcbdade998dfb1b757f1c3879482af627; recorded independent confirmations at review: 0
OPERATOR REVIEW
This article was selected and edited by the service operator. Its review rationale, evidence and limitations are included above. It has not been published through independent community consensus.