Skip to main content

Module transform

Module transform 

Source
Expand description

Pipeline-mechanical clip transforms, ported from the incubating bake’s Python: frame-window slicing, hold-extension, duplicate-endpoint removal, and gait-anchor rotation. Scope rule (DESIGN.md §1): animsmith may rewrite a clip only in ways whose correctness its own checks can verify.

Structs§

ConstantTrackPruneRecord
One constant-track candidate considered by prune_constant_tracks.
ConstantTrackRetainedRecord
A candidate that prune_constant_tracks conservatively retained.
DuplicateLoopEndpointOutcome
The lossless change made by drop_duplicate_loop_endpoint.
GaitAlignOutcome
Outcome of align_gait_anchor.
PruneConstantTracksOutcome
Outcome of prune_constant_tracks.

Enums§

ConstantTrackRetentionReason
Reason a constant-track candidate was not removed.
DuplicateLoopEndpointError
Failure while analyzing a duplicate loop endpoint.

Constants§

CONSTANT_TRACK_PRUNE_QUAT_TOLERANCE_RAD
Maximum sign-invariant local rotation change accepted when pruning a constant track. This aliases the constant-track check’s tolerance.
CONSTANT_TRACK_PRUNE_VEC3_TOLERANCE
Maximum component-wise local translation/scale change accepted when pruning a constant track. This aliases the constant-track check’s classification tolerance.
DUPLICATE_ENDPOINT_QUATERNION_TOLERANCE_RAD
Sign-invariant shortest-path angular tolerance for duplicate rotations.
DUPLICATE_ENDPOINT_VEC3_TOLERANCE
Component-wise tolerance for duplicate translation and scale endpoints.

Functions§

align_gait_anchor
Rotate a cyclic clip in time so its measured stride anchor (the trough of the L−R foot-height fundamental) lands at clip time 0.
analyze_duplicate_loop_endpoint
Analyze whether a clip has a safe, duplicated loop endpoint.
drop_duplicate_loop_endpoint
Atomically remove all consecutive duplicate closing keys from every track.
hold_extend
Append one key per track duplicating its final value hold_s seconds after its last key (a linear hold — charge/block poses). The clip duration extends to the longest held end.
prune_constant_tracks
Remove constant multi-key tracks only when doing so preserves every local TRS and model-space position/rotation on the original clip’s default sample grid.
slice
Keep only the keys inside [start, end] seconds (with a half-frame epsilon at fps absorbing float drift from earlier retimings) and retime them so the window starts at 0. Cubic tangent triplets move with their keys. The clip duration becomes end - start.