zturtleman / mm3d

Maverick Model 3D is a 3D model editor and animator for games.
https://clover.moe/mm3d
GNU General Public License v2.0
115 stars 23 forks source link

Invalid MD2 and MD3 models can be exported [>2GB filesize] #83

Open zturtleman opened 4 years ago

zturtleman commented 4 years ago

Offsets in .MM3D are unsigned 32-bit integers (max 4 GB) and offsets in MD2 and MD3 are signed 32-bit integers (max 2 GB). Currently there is no check to prevent saving/exporting a model that exceeds the offset limit.

MD3 export previously only allowed (including Misfit Model 3D 1.3.8) a limited number of triangles, meshes, tags, and frames so the offset limit could not be reached.

m-7761 commented 4 years ago

I don't understand this, but I'm sure MM3D would crap out before it could a load a 2GB model. Can't export what you can't load.

zturtleman commented 4 years ago

A sphere with smoothness 5 (20,450 vertexes) with 15,000 skeletal animation frames (no keyframes) is a 2.2 MB .mm3d file. Converting to frame animations (Menu -> Animation Sets -> Convert To Frame) and exporting to MD3 should exceed the 2 GB limit. Unfortunately I can't convert to frame animation because I don't have enough memory (4GB RAM + 4GB swap) and Maverick is ended by the operating system. It's a low priority so I dropped fixing it as a blocker for #58.

sphere-15000-frames.mm3d.zip

m-7761 commented 4 years ago

Well that's because the frame data must be stored in the most stupid way possible then.