{"id":15022521,"url":"https://github.com/4eb0da/war3-model","last_synced_at":"2025-04-04T13:04:01.953Z","repository":{"id":19972000,"uuid":"88410914","full_name":"4eb0da/war3-model","owner":"4eb0da","description":"TypeScript-based mdl/mdx (Warcraft 3 model formats) converter/renderer","archived":false,"fork":false,"pushed_at":"2025-03-20T23:24:18.000Z","size":4382,"stargazers_count":101,"open_issues_count":0,"forks_count":30,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T12:01:38.502Z","etag":null,"topics":["blp","mdl","mdx","typescript","warcraft3","webgl"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/4eb0da.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-16T12:12:19.000Z","updated_at":"2025-03-20T23:21:18.000Z","dependencies_parsed_at":"2024-06-17T19:48:40.534Z","dependency_job_id":"6f11f8cd-296c-4d12-bf32-31e94876a772","html_url":"https://github.com/4eb0da/war3-model","commit_stats":{"total_commits":96,"total_committers":4,"mean_commits":24.0,"dds":0.125,"last_synced_commit":"bbfa0bafc6c8dfaddb67d7ab7329f543080ef3a0"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4eb0da%2Fwar3-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4eb0da%2Fwar3-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4eb0da%2Fwar3-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4eb0da%2Fwar3-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4eb0da","download_url":"https://codeload.github.com/4eb0da/war3-model/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174423,"owners_count":20896078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blp","mdl","mdx","typescript","warcraft3","webgl"],"created_at":"2024-09-24T19:58:04.117Z","updated_at":"2025-04-04T13:04:01.930Z","avatar_url":"https://github.com/4eb0da.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# war3-model\nTypeScript-based mdl/mdx (Warcraft 3 model formats) converter/renderer\n\n## Demo\n* [MDL/MDX converter (also json-like structure-previewer)](https://4eb0da.github.io/war3-model/convert/convert.html)\n* [WebGL model previewer](https://4eb0da.github.io/war3-model/preview/preview.html)\n* [BLP previewer (BLP1 decoder only)](https://4eb0da.github.io/war3-model/decodeblp/decodeblp.html)\n* [Simple model optimizer](https://4eb0da.github.io/war3-model/optframes/optframes.html)\n\n## Usage\n\n* [Usage in Node.js or with bundler (e.g. webpack)](docs/node.md)\n* [Usage in browser as external script](docs/browser-global.md)\n* [Usage in browser as ES Module directly](docs/browser-es.md)\n* [Exported APIs](docs/interface.md)\n* [How to render model in browser](docs/how-to-render.md)\n\n```bash\nnpm i war3-model --save\n```\n\nMDL parsing/generation\n```typescript\nimport { parseMDL, generateMDL } from 'war3-model';\n\nlet model = parseMDL('...');\nlet mdl = generateMDL(model);\nconsole.log(mdl);\n```\n\nBLP =\u003e PNG node.js cli converter\n```typescript\nimport * as fs from 'fs';\nimport { PNG } from 'pngjs';\nimport { decodeBLP, getBLPImageData } from 'war3-model';\n\nlet blp = decode(new Uint8Array(fs.readFileSync(process.argv[2])).buffer);\nlet imageData = getImageData(blp, 0);\nlet png = new PNG({width: blp.width, height: blp.height, inputHasAlpha: true});\n\npng.data = Buffer.from(imageData.data.buffer);\n\nfs.writeFileSync('out.png', PNG.sync.write(png));\n```\n\n## Is it good enough?\n\n100% of both old classic Warcraft 3 and Reforged models can be parsed.\n\nAfter conversion `mdx binary file` -\u003e `in-memory structure` -\u003e `mdx binary file` ~99.7% (8753/8773) of them would be byte-to-byte identical (some of them contains unused data).\n\n## Reforged format is supported\n\nNew versions 900 (not sure), 1000 and 1100 are supported in parsers, generators and viewer.\n\n## MDL/MDX support\n\n* Format versions 800 (classic War3), 900 (not tested), 1000 and 1100 (Reforged)\n* All standart features like Sequences, Bones, Cameras, etc\n* Multiple texture chunks (mdx only)\n* Multiple sequences/nodes with the same name (not quite sure is it feature or not, but War3 actually contains such models)\n* SoundTrack not supported\n\n## Renderer support\n\n* Standart geometry/animation\n* Custom team color setting\n* ReplaceableId 1/2\n* Global sequences\n* Alpha blending and multiple layers\n* TextureAnimation\n* Billboarded/BillboardedLockXYZ, w/o DontInherit/CameraAnchored\n* RibbonEmitter (w/o Gravity and TextureSlot/Color animation)\n* ParticleEmitter2 (with Tail/Head/Both/Squirt(?))\n* Reforged PBR lightning (orm textures, specular, normal mapping, env textures, etc)\n* No Light nodes support (Light, Unshaded, etc)\n* No render priority support (PriorityPlane and others)\n* BLP / DDS are supported\n\n## BLP support\n\n* BLP1 only (not BLP0 and BLP2 support)\n* Decoder only, no encoder\n* Direct \u0026 jpeg data\n* Variable alpha (8/4/1/0 bit, but tested only 8/0)\n* API for getting all mipmap level's data\n\n## DDS support\n\n* dxt1, dxt3, dxt5, ati2 (also known as bc5)\n\n## Thanks\n\n* Magos (MDX specification, War3 Model Editor app/source)\n* GhostWolf (aka flowtsohg) (MDX specification, BLP decoder code)\n* Алексей (MdlVis app/source)\n* Dr Super Good (BLP specification)\n\n## Licence\n\nMIT Licence\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4eb0da%2Fwar3-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4eb0da%2Fwar3-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4eb0da%2Fwar3-model/lists"}