Commit Graph

23 Commits

Author SHA1 Message Date
fcac19c235 tools/anim_clips: write --out JSON report atomically (ANIM-CLIPS-ATOMIC-JSON) 2026-11-26 20:02:00 +07:00
f9cd3118f7 anim_clips: harden sequence/clip decoding and gap-page fallback 2026-11-23 22:25:39 +01:00
b79c6f1f09 anim_clips: decode the .motionmatcher layout (ASSET-258) (#3377)
Squash-merged after review of PR #3377 - anim_clips: decode the .motionmatcher layout (ASSET-258)
2026-11-23 08:12:36 -06:00
aff9338187 anim_clips: count clip windows; the clip timing rule over all 785,174 entries (was 4,471 in 300 sampled dictionaries) (#4881)
Squash-merged after review of PR #4881 - anim_clips: count clip windows; the clip timing rule over all 785,174 entries (was 4,471 in 300 sampled dictionaries)
2026-11-23 08:11:05 -06:00
8d88450ee2 Merge pull request #3960 from Wasler
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:09:56 -05:00
94e682cff4 Merge pull request #3341 from NiiRoZz
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:07:19 -05:00
b23779d6a9 tests: pass errors=replace to subprocess pipes capturing python -I tools 2026-11-23 00:42:37 +02:00
f22aa1472f Merge pull request #3341 from NiiRoZz 2026-11-22 17:01:32 -05:00
9628bf207e anim_clips: count the +0x20 array of multi-axis motion nodes
From @ismailchaka1's check on #3341: types 4-8 have a {ptr, count} array at
+0x20 (null on type 4 and on 431 of 482 type-5 nodes; on every type-6/8 node,
items {u32, 0, u32, 0}). Counted as motion_node_pairs:<type>:<count|null> and
documented; the values are not decoded. Rechecked on anim.rpf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:58:31 +01:00
d9c5ca2698 anim_clips: identity needs one item per list; read times and node apart
Review of #3341: sample_k_is_child_k compared only each list's first child,
so [[0, 1], [1]] counted as identity; it now requires one item per list.
A malformed parameter node no longer resets a readable +0x70 time table to
None. Rechecked on anim.rpf: the totals in docs/animation.md are unchanged
(6,970 identity, all 17,247 time tables readable).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:02:26 +01:00
80cace8b06 Merge pull request #3026 from Leo Leahy 2026-11-22 15:14:09 -05:00
d39dcc3bd6 ASSET-259: decode .motion node types and the sample-to-child lists
Parameter node types 3, 4, 5, 6 and 8 carry 1-5 axes ({u32 name hash, u16,
u16} at +0x10); types 4/5/6/8 keep their sample count at +0x90/+0x90/+0x50/
+0xA0, type 1 at +0x20. The .motion's +0x90 lists (one per node sample,
items {u32 child, f32, f32}) map each sample to a child: checked on all
8,932 one-node motions in anim.rpf. Counts only; synthetic tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:10:20 +01:00
de875521cf anim_clips: recognise a .motion clip with an inline name 2026-11-22 16:08:16 -03:00
95840b70ce Locate animation page counts across bounded contiguous streams 2026-11-22 19:23:12 +01:00
56f0ea032d fix(tools): read all pages of a selected animation dictionary
Targeted decoding capped the input stream list before the page grouper could resolve the count declared by the dictionary.
2026-11-22 19:05:02 +01:00
2df55517d5 Merge pull request #1530 from bbareth 2026-11-22 07:08:04 -05:00
640c500606 anim_clips.py: reject invalid time budgets before scanning 2026-11-22 12:59:33 +01:00
0499e046d1 anim_clips: refuse report paths that overwrite the source archive 2026-11-22 16:57:54 +05:30
17f39ac44f anim_clips: read .motion child times and one-axis parameter nodes
.motion +0x70 holds one 0x28-byte item per child: the child's duration, its
duration in the blend and a (child time, blend time) curve. On anim.rpf the
first float is bit-for-bit the named .clip's duration for all 111,948 children
that name a .clip there; 158,991 of 159,584 curves are the identity and 402 are
monotonic time warps.

The parameter node is at +0x138 (+0x58 = 1) or at +0x18 of the block +0x120
points at (+0x58 = 2). Type 3 (10,171 of 17,247) is one sampled axis: a name
hash, (sample index, value) items sorted by value, min and max. 10 of the 88
axis name hashes resolve to joaat32 names such as yawangle and speed.

Also documents that the unlisted-last-page recovery needs the page map in a
listed stream (whattheflop's review on #1174): no anim.rpf root and no
story000 clip dictionary has its page map in such a tail. A synthetic test
keeps that layout unresolved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:08:55 +00:00
2cd416311f Merge pull request #1189 from Tayar 2026-11-22 03:14:25 -05:00
f117977225 anim_clips: reject negative frame counts 2026-11-22 05:05:35 -03:00
590225ad0d anim_clips: join the 36 unresolved dictionaries and resolve .motion children
The 36 roots whose second system page is not the next listed stream have it
right after the first stream: a zlib stream inflating to 16-48 bytes, which
anim_index.py does not list (it keeps streams of 64 bytes or more), or a
16-byte raw page. group() now tries that page and joins it only when the
pages parse as a clip dictionary. All 36 join; 191,042 animations decode.

.motion clips list their children as {u64 0; u32 clip hash; u32 dictionary
hash} at +0x60, and the root's hash-only +0x70 references are dictionary
hashes. scan() joins both across the archive: 111,948 of the 114,925
children whose dictionary is in anim.rpf name a .clip of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:45:31 +00:00
09d3841df8 anim_clips: decode the clip dictionaries in anim.rpf to keyframes
tools/anim_clips.py groups the stream walk of anim_index.py into RAGE
resources via the page map at the +0x08 pointer, finds the clip
dictionaries (system-only, 1 or 2 pages) and decodes dictionary -> clips
-> packs -> animations -> sequences -> channels. Channel types 0-5, 7, 8
and the GTA VI type 10 (second-order delta coding) are decoded. Output is
counts and per-dictionary rows only; --decode prints one dictionary's
values to stdout for local use.

docs/animation.md gets a "Keyframe decoding" section with the layouts and
the measured full-archive counts, and the statements it makes stale are
updated: 0x98e1750c is joaat32("bonerotation"), the 2/3 packed streams
are second system pages of 0DRP resources, and keyframes are decoded for
the clip dictionaries. tests/test_anim_clips.py builds synthetic
resources, including a type-10 encoder for a round trip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:17:56 +00:00