Viewer: draw stickers placed on a vehicle (custom liveries) #176
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!176
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/176/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@holdmysocks on GitHub · 2026-11-24 16:14 UTC · original
holdmysocks:claude/livery-draw→master· +1165 −40 · 11 files · 11 commits · merged 2026-11-24 17:02 UTCWhat
Second step of the custom livery editor (SIX-122): the viewer draws stickers that are placed on a vehicle, from a list of placements per vehicle. The editor panel that makes such a list by hand is the next PR; here the list comes from a JSON file.
Drawing (
shader.wgsl,render3d.rs)u = U*a + V*b + ou,v = U*c + V*d + ov), in the first or the second UV set.Placements (new
livery.rs)<work>/liveries/<vehicle>.jsonwhen the vehicle opens.--livery FILEopens another file for scripted runs;--livery-info FILEwrites the loaded vehicle's zones (per model: zone, side, area, UV box and metres per UV unit in both UV sets).Cache: vehicle exports from before PR 162 have no
_COLOR1in their GLB.vehcolour::EXPORT_VERSIONgoes from 20 to 21, so the viewer exports a vehicle (and its fitted parts) again the first time it is opened.Checked
benson_hiwith its box (truckbeds_box_01_hi), five stickers from a hand-written file: a 4:1 picture on the left box wall (zones 169 to 174), a colour mask on the same wall, the picture again on the right wall (177 to 182), and the mask on both cab doors (zones 24 and 32, one of them turned 15 degrees). All five come out upright, on the right panels, at the sizes asked for; the mask takes its three colours. Scripted screenshots from both sides:sixng-gui --model "~^benson_hi$" --no-picker --yaw 2.3 --pitch 0.25 --zoom 0.9 --size 1300x800 --exit --livery <file> --screenshot <out.png>(and--yaw -2.3).--livery-infoon the same truck: the box's side walls come out as zones 169 to 174 (left) and 177 to 182 (right) at 7.66 to 7.81 m per UV unit in the second UV set, which agrees with the 7.72 m known from SIX-109; the doors as 24 (left) and 32 (right).cargo test -p sixng-gui livery): a sticker is upright and metric on a wall whether or not its UVs are mirrored, a first placement fits its zone, a ray finds zone and UV, a livery file round-trips. All pass.cargo build --release -p sixng-cli -p sixng-guipasses without warnings.Not decoded / not done
livery.rscarries#![allow(dead_code)]for the picking, fitting and saving parts the editor uses; the next PR removes it.metal4-poc) does not draw stickers and was not built here.