flowtsohg / mdx-m3-viewer

A WebGL viewer for MDX and M3 files used by the games Warcraft 3 and Starcraft 2 respectively.
MIT License
131 stars 47 forks source link

Minor mistake: TextureID capitalization in animationmap #47

Closed EzraZebra closed 4 years ago

EzraZebra commented 4 years ago

https://github.com/flowtsohg/mdx-m3-viewer/blob/aa150bf9a2c0f3fedbcc614b065a7105ad1bfbba/src/parsers/mdlx/animationmap.ts#L6

This should be TextureID (capital D). Not sure if this matters at all (case insensitive?).

flowtsohg commented 4 years ago

I don't know if the game is case sensitive or not, but my code is, so this is indeed a bug.

EzraZebra commented 4 years ago

One more thing: for Geoset::writeMdl - reforged models don't have any vertexGroups, so it should only be written if vertexGroups.length > 0 I think. Otherwise you end up with

VertexGroup {
}
flowtsohg commented 4 years ago

That is not an error for my code or the game, but I agree it's not the nicest. I think the condition is dependant on skin.length in the case of version > 800, rather than vertexGroups.length. As far as I remember, the HD models actually all had (in the beta times at least, didn't check current models) fake vertex groups, and they still have fake matrix groups, because wasting memory is a theme in Reforged.

flowtsohg commented 4 years ago

Also mostly as an additional note for myself, I write any N TVertices blocks, but I actually have no idea if that's how it should look like in MDL. I think I found an old map that someone gave me with models that contain multiple texture coordinate chunks, so I'll try to test it later.

flowtsohg commented 4 years ago

N TVertices blocks are correct, and apparently another vector in which some Reforged HD models waste memory by having texture coordinates that are never used...

EzraZebra commented 4 years ago

You mean multiple TVertices blocks? So basically an analogue for the MDX UVSA/UVSB tags? Interesting, will have to update my code too.