Well I’ve been saying for ages that I’m going to write a SMD importer plug-in for 3DS Max 9 & 2008 and this week I finally took some serious steps to get it from the paper planning stage into actual code.
The SMD format is pretty awful for storing 3D mesh data as it explodes the whole thing into seperate triangles instead of nice index linked lists as in say OBJ format (or the mythical MRM format StudioMDL supports…). To be honest, I’ve no idea why Valve still uses this format but I guess it’s just a legacy that no-ones seen the need, or has the time, to change.
Anyway, one of the big problems with handling SMD files istaking all those seperate triangles and intelligently joining them back together into one continuous mesh. I’ve spent quite some time trying to figure out how to do it and more importantly, how to do it quickly. I think I’ve got it figured now, more or less, and the proof-of-concept code seems to do it’s job.
You can see the fruit of experiements over the past couple of evenings. It’s not much more than a snazzy looking point cloud but it’s something at least. It’s quick too – at least when not running in debug mode. The picture on the left is from a SMD file containing 18000 lines of text. It read in 3600 individual vertices and filtered them down to just 2600 by removing duplicates – and it did it all in under 0.02 seconds.
The next stage is to write similar sorting and filtering code to handle the normal, UV and face data and then the logic to stitch it all together into a single mesh.
As usualy, no ETA as I’m working on this when I have the odd bit of spare time from other things, but hey – progress!
Responses to “So about that 3DS Max SMD importer…”
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.