Skip to content

Add goldsrc_mdl - #11

Open
5hif7y wants to merge 1 commit into
mirai-engine:mainfrom
5hif7y:add-goldsrc_mdl
Open

5hif7y wants to merge 1 commit into
mirai-engine:mainfrom
5hif7y:add-goldsrc_mdl

Conversation

@5hif7y

@5hif7y 5hif7y commented Nov 3, 2026

Copy link
Copy Markdown
Member

Studio models of GoldSrc as an import format of the editor: meshes with the textures the model keeps (or its T.mdl), and for a model with bones and sequences, its skeleton and a clip per sequence, those of sequence group files included. A port to Odin of the mdl2gltf.py of the Counter-Strike demo for Mirai, which tomaszbk/mirai#82 carried. Imports the 169 models of a Counter-Strike 1.6 install.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tomaszbk

tomaszbk commented Nov 8, 2026

Copy link
Copy Markdown
Member

The structure is fine: one plugin, no dependencies. Before merging, please harden the reader against malformed files, since it runs inside the editor:

  • mdl.odin:442-443: vert_info/norm_info are only checked against the end of the file. A negative one panics (Bounds check failed: -100 is out of range 0..<3000).
  • Cap sequences, textures, skin_refs, meshes and especially s.frames, which goes straight into an allocation per bone, against what the file can actually hold.
  • Reject negative texture sizes; only 0 is rejected now.
  • Add a test that a malformed model fails with a message, and update the comment on imported_sequence, since sequence groups are read now.

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