Skip to content

fix: xmodel glTF dumps dropping COLOR_0 vertex attributes#760

Merged
Laupetin merged 2 commits into
Laupetin:mainfrom
michaeloliverx:xmodel-glTF-dump-bug
May 1, 2026
Merged

fix: xmodel glTF dumps dropping COLOR_0 vertex attributes#760
Laupetin merged 2 commits into
Laupetin:mainfrom
michaeloliverx:xmodel-glTF-dump-bug

Conversation

@michaeloliverx
Copy link
Copy Markdown
Contributor

@michaeloliverx michaeloliverx commented Apr 27, 2026

I ran into this while working in my Xenon fork, but the root cause turned out to be upstream.

Preserve COLOR_0 in xmodel glTF dumps. The writer was dropping vertex colors from dumped GLBs, causing readers to fall back to default white and breaking flag/cloth deformation masks.

The video shows the original map on the left and an OAT-linked version on the right using the .glb loader for xmodel,bro_tarp_crate_anim from mp_osg_cargo.

iw3_oat_xmodel_bug.mp4

EDIT: You can also observe the issue on stockmaps with flags e.g. mp_showdown

Copy link
Copy Markdown
Owner

@Laupetin Laupetin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find, thanks :D I adjusted the code a bit to only dump the color data when there is non-default data, meaning not every vertex has a color value of 1,1,1,1.
Just so that it's maybe easier to work with models that do not require handling a separate color layer on vertices.

@Laupetin Laupetin force-pushed the xmodel-glTF-dump-bug branch from 19469bb to 1d6a9d6 Compare May 1, 2026 19:50
@Laupetin Laupetin merged commit 51b741e into Laupetin:main May 1, 2026
7 checks passed
@michaeloliverx michaeloliverx deleted the xmodel-glTF-dump-bug branch May 1, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants