Vehicles: mod parts from the vehicle data, with a Parts panel in the viewer #57

Manually merged
github merged 5 commits from gh-pr/57/head into gh-pr/57/base 2026-11-26 20:06:23 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-23 16:30 UTC · original
holdmysocks:claude/vehicle-mod-parts → master · +284 −6 · 3 files · 5 commits · merged 2026-11-23 17:04 UTC

Vehicle mod parts (bonnets, bumpers, spoilers, splitters, diffusers, exhausts), mounted from the vehicle data.

  • The data. A vehicle's pack resource has one record per part or kit (0caef606: name, slot, elements) and one per part model (77f2b89e: the bone the model is authored around, and the stock bones it replaces). A kit is named after its left and right models without the side word.
  • vehicles.json. Each model gets mods; format 3. 323 of 373 models have parts, 7,915 records with elements.
  • Viewer. A vehicle's parts appear in the Parts panel, one choice per slot, none on by default. A chosen part is placed at its bone's bind pose and follows that bone; the stock pieces it replaces are left out.

Checked

  • In the viewer: comet7 (off-road bumpers, splitter, diffuser, exhausts, spoilers) and blista2 (bonnet, spoiler, exhaust, a damage wing; the replacement bonnet opens with the bonnet slider).
  • 135 core tests pass.

Not done

The command-line export does not write a vehicle with chosen parts. Slots outside a list of 24 names show as hashes. Choosing parts keeps one LOD level.

Stacked on #56

This branch sits on #56, which sits on #55 and #54, and targets #56's branch so the diff shows only this work. Merge them in order.

**@⁠holdmysocks** on GitHub · 2026-11-23 16:30 UTC · [original](https://github.com/holdmysocks/SixNG/pull/57) `holdmysocks:claude/vehicle-mod-parts` → `master` · +284 −6 · 3 files · 5 commits · merged 2026-11-23 17:04 UTC Vehicle mod parts (bonnets, bumpers, spoilers, splitters, diffusers, exhausts), mounted from the vehicle data. - **The data.** A vehicle's pack resource has one record per part or kit (`0caef606`: name, slot, elements) and one per part model (`77f2b89e`: the bone the model is authored around, and the stock bones it replaces). A kit is named after its left and right models without the side word. - **vehicles.json.** Each model gets `mods`; `format` 3. 323 of 373 models have parts, 7,915 records with elements. - **Viewer.** A vehicle's parts appear in the Parts panel, one choice per slot, none on by default. A chosen part is placed at its bone's bind pose and follows that bone; the stock pieces it replaces are left out. ## Checked - In the viewer: comet7 (off-road bumpers, splitter, diffuser, exhausts, spoilers) and blista2 (bonnet, spoiler, exhaust, a damage wing; the replacement bonnet opens with the bonnet slider). - 135 core tests pass. ## Not done The command-line export does not write a vehicle with chosen parts. Slots outside a list of 24 names show as hashes. Choosing parts keeps one LOD level. ## Stacked on #56 This branch sits on #56, which sits on #55 and #54, and targets #56's branch so the diff shows only this work. Merge them in order.
- Skeletons: a bone name with a dash ended the bone array. Vehicle
  skeletons name their breakable joints that way
  (connect-chassis-bumper_f-1), so a motorhome's skeleton stopped at bone
  107, before its wheel bones, and 18 of its meshes had joints with no
  bone. Names may now hold - . # + and spaces.
- Dual wheels: the inner wheel of a pair has its own bone
  (wheel_lr_inr, wheel_lm1_inr) and its own collision disc. wheel_mounts
  lists them, and each mount takes the nearest of two equally large discs
  (outer and inner can be 12 cm apart). model.json gets
  wheel_mounts_version 2. The viewer draws the inner wheel mirrored.
- Viewer: a rim_train_* / rim_metrotrain_* rim gets no tyre and keeps its
  own width (it comes with its axle stub). It was given a car tyre.
- Viewer: an electric scooter has no rim in its configurations and a
  wheelScale of 0.08, like a helicopter, and lost its wheels to the
  helicopter rule. That rule now also needs the wheels to have no
  collision discs. A configuration with a tyre and no rim takes a rim of
  the tyre's kind.
- Viewer: "roof down" for convertibles hides what hangs on the
  convertible_roof bone except the roof cover (--roof-down in
  automation).

Checked in the viewer on eboost, spreader, trailers, traileruld2,
traincar2, trotter, trlr_tnkr and sentinelclassic2.

Not found: a roof-folding animation. Nothing in the animation index is
named after the car, its roof bones or a soft top, so the roof is a
switch. trlr_tnkr has no wheel bones and no wheel discs (55 bones): it
is taken as a body that sits on a separate chassis, which was not
identified.
A convertible's model info names its roof animation as in GTA V:
animConvRoofDictName = joaat("va_<model>") and animConvRoofName =
joaat("roof"). The dictionaries are in levels.rpf as entries without a
recovered name (170 clip dictionaries there, 11 of them va_*); the
existing clip decoder reads them.

- anim: level_dictionaries (names cached in
  <work>/index/levels.clipdicts.json) and vehicle_roof.
- Export: a vehicle with a va_<model>/roof clip gets it in model.glb as a
  glTF animation of the joint nodes, and model.json gets roof_animation
  (source, duration, bone coverage). Time 0 is the roof up, the end the
  roof stowed.
- Viewer: a "roof fold" slider plays the clip (--roof 0..1 in
  automation). The "roof down" switch stays for a car with roof bones and
  no clip.
- Viewer: joint nodes written as translation / rotation / scale are read.
  Only matrices were, and a GLB with an animation writes its joints as
  TRS, so its joints loaded at the origin.

All ten convertibles among the 284 surveyed vehicles have the clip
(carbonizzare, comet7, dominator9, dominatorclassic, lasso, schutzen,
sentinelclassic2, vigero3, windsor2, zion2; 3.8 to 11.1 s, 12 to 74
channels) and every animated bone is on the car's skeleton. Watched in
the viewer on sentinelclassic2, comet7 and windsor2.

Not wired: va_jubilee holds a 1.7 s clip sunroof_r_anim (2 bones). The
exported GLB was checked for the animation but not opened in another
tool.
- Clips: every clip of a vehicle's va_<model> dictionary is written into
  model.glb as a glTF animation, not only roof (va_jubilee holds
  sunroof_r_anim). roof_animation in model.json lists them under
  "animations". The viewer shows a slider per extra clip (--clips in
  automation).
- Bonnet and boot: sliders for the bonnet and boot bones. Which way a
  panel opens comes from where its vertices lie relative to its bone:
  doors turn about the vertical, away from the centre line; bonnet and
  boot about the lateral axis, upwards. The door slider uses the same
  rule in place of a fixed sign per side. The angle is the slider's, not
  a stored limit.
- Brake discs and calipers: wheel_mounts gets brake_radius and
  brake_centre, the largest of the clearly smaller collision discs on the
  wheel's axle line (wheel_mounts_version 3). The viewer draws the
  configuration's brakedisc_* and caliper_* models there; both are
  modelled around a disc of radius 0.5. The disc turns with the wheel
  spin. A configuration without them takes another configuration's.
- Wheels where none is named: a plain rim and tyre by the largest stored
  tyre radius (tractor over 0.7 m, truck over 0.45 m, else car).

Checked in the viewer on jubilee (sunroof), blista2 and sentinelclassic2
(doors, bonnet, boot; the bonnets hinge at opposite ends), comet7 and
cheetah2 (brake discs behind the spokes), spreader (truck wheels).

Not checked: the caliper's placement (hard to see in the shots), hinges
beyond those two cars, and the GLB animations in another tool. Sliding
doors and panels under other bone names do not open.
A vehicle's own pack resource says how its mod parts mount:

- 0caef606, a part or kit: name = joaat of the part model's name, or of a
  kit's name (the names of its left and right models without the side
  word: comet7_exhaust_histr_19 for ..._lr_19 and ..._rr_19); 37a6f9ef =
  its slot (joaat of bonnet, bumper_f, spoiler, exhaust, splitter,
  diffuser, towing ...); elements = its element records.
- 77f2b89e, one model of a part: the low u32 of 079baba7 is joaat of the
  bone the model is authored around (chassis = the car's own space,
  boot, bumper_f, mod_spoiler_attach, mod_attach_exhaust_lr ...);
  2b490ab7 lists the stock bones it replaces.

- vehicles.json: each model gets "mods" (name, slot, elements with bone
  and hides, joaat as hex); "format" 3. 323 of 373 models have parts,
  7,915 records with elements.
- Viewer: a vehicle's parts appear in the Parts panel, one choice per
  slot, none on by default. A chosen part is put at the bind pose of its
  bone and skinned to it (a replacement bonnet opens with the bonnet),
  and the stock triangles on the bones it replaces are left out.
- Viewer: the vehicle table is read once per process and shared with
  model loading; a model shown with parts still finds its vehicle data.

Checked in the viewer on comet7 (off-road bumpers, splitter, diffuser,
exhausts, spoilers) and blista2 (bonnet, spoiler, exhaust, a damage
wing).

Not done: the command-line export does not write a vehicle with chosen
parts; slots outside a list of 24 names show as hashes; choosing parts
keeps one LOD level. The 64-bit value each element carries (8605bf0e) is
not understood.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:06:21 +00:00
github manually merged commit 122bfce425 into gh-pr/57/base 2026-11-26 20:06:23 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.