Vertex Cloud

It’s not much, but you’ve got to start somewhere.

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!

Jan. 6, 2008 @ 02:47
Henry Freeman or Ivan the Space Biker?

Henry Freeman or Ivan the Space Biker?

I spotted this picture hanging in the pub a while back (sorry for the crappy photo).

Yes, I’m a collosal nerd, but doesn’t he look an awful lot like “Ivan the Space Biker”, the first incarnation of Gordon Freeman?

But hang on, he is a Freeman!?

Is this yet another twist in the Half-Life universe? Are Gordon and Henry related? Is Ivan in fact not Gordon but his father who travelled through time via Xen to become shipwrecked?

Or did Insta and I just drink way to much again as usual.

Yeah, I’m going with the latter…

I’ve taken some time to do a small update to my 3D Studio Max SMD export plug-in and have nailed (I think) one bug and added a couple of user-requested features.

To start off the additions include support for exporting HL1 format unweighted SMD files. I underestimated how many people out there were using Max 9 and still modelling for Goldsrc games so per request I added the option to export files in the old format.

The second addition is a crude but useable “batch mode” which lets you configure and call the plug-in from Maxscript. One user had all their animations in one continuous sequence and was looking for a way to batch export them by specifying specific ranges. It’s fairly simple to use and I’ve included a basic example Maxscript in the ZIP file.

As for the bug, you may recall in previous blog posts that I was having considerable problems with Export Selected. After a lot of debugging and tracing I *think* I’ve nailed the problem. Certainly under the tests I’ve done you can now select part of a chain of bones and it will export and not lose position or destroy the animation. As always these things have a habit of blowing up in my face so I’ve retained the link to the old version of the exporter just in case people need to roll-back.

I’ve also marked this version as for 3D Studio Max 2008 too as users reported that it worked fine in both Max 9 and 2008 without problems.

I’m still getting e-mail/MSNs regarding problems with old Max 8 rigs that don’t work quite right with this exporter. In 99% of all cases it’s been simply been down to shoddy rig construction. I’ve said before and I’ll say it again, when you mirror part of your rig, reset the transforms before you use it! It really messes up the 3D transformation matrices and while the code tries to fix it, it’s not that clever. Oh and please, stop trying to use splines as bone nodes…