I’ve been suffering from insomnia so I decided to finish up some changes to the SMD importer bringing it up to release version 1.0.

Changes in this version from the alpha are fixes to try and handle SMD parsing better, a “pre-parse” option to speed up reading SMDs by skipping data you don’t want and most significantly, support for importing animations.

Nov. 26, 2008 @ 04:18

To say I’m stressed would be an understatement of epic proportions. I seem to have so much going on right now I’m wishing the world had a giant “pause” button I could press now and then just to give myself a chance to catch up with everything I have to do. I’m starting to become a career insomniac and the pay sucks.

Anyway, I’ve managed to scrounge a few hours to look at bugs in the 3DS Max SMD Importer alpha version and I think I’ve nailed the most common one’s that people reported. I’ve also started on support for animation and so far it’s working, I just need to tidy up some code and wrap up some of the user options.

Unfortunately due to my workload I probably won’t be able to get the next update out this week as I hoped but there will be one soon.

Ta-da! So here it is after far to many months of faffing around trying to find time to work on it.

This is an “alpha” release meaning I can’t be 100% sure it’s bug free and it doesn’t contain all the features I’d hope to add to a final version. Most noticeably it doesn’t re-create smoothing groups (it uses vertex normals instead) and currently doesn’t support animation imports. That said, it’s got a couple of nice extra features I added.

I’ve also made a small update to the SMD exporter plug-in to enable it to export vertex normals correctly. This is important if your just importing/exporting from Max without editing.

As usual I welcome feedback and bug reports but remember I can’t fix a bug without a good description and the file that was causing the problem. I have to be able to replicate the problem to solve it.

Thanks to all for your patience and apologies it took so long. Sadly real life and my innate crapness at mathematics is to blame for the delay.

Edit: Oops, put a wrong file in the archive. Fixed it now.

It seems as winter draws nearer my freetime gets less and less so a lot of my projects have been pushed onto the back-burner for now. Work and family comes first, sleeping second and Ham and Jam third as I just want to see it done.

Luckily this weekend was quiet so I took some time to do some more work on the 3DS Max SMD Importer plug-in and got the vertex weighting code fleshed out so now the meshes is actually linked to the bones. Now that step is done, the importer actually becomes useful and I can think about making an initial release at least as an alpha version for testing.

Up until now the code has mostly been mostly prototyping so I’ve spent the weekend refining it and adding in error handling as I’m sure in the real world there will be the odd screwed up SMD file it’ll have to deal with. I need to put a nice options dialog and a few other bits and pieces as well before it’s really usable.

So here’s a recap of what you can/can’t do with the importer right now.

Imported TF2 Heavy

TF2 Heavy in 3DS Max 9. Model on the right is posed slightly to show the skin modifier working.

It imports the SMD as a single continuous mesh so you don’t need to weld anything back together (like with the MaxScript importer). It doesn’t yet re-build smoothing groups but you can fix this yourself by just adding an Edit Poly modifier on top and using AutoSmooth or do it manually. Materials and UV’s are imported and assigned to a Multi/Sub material type.

Bones are imported and posed in the reference pose but it doesn’t yet handle importing animations. That shouldn’t be hard to do, I just haven’t got around to it yet. Vertex weights are imported and the mesh attached to the skeleton via a Skin modifier.

There still a long way to go and I’ve a lot of useful idea’s for features for the importer but for now, I’ll just be happy to get something out the door people can use 😀

Feel free to ask any questions.

Thanks to users who provided good feedback and sample Max files to debug from I’ve managed to nail a couple of annoying bugs in my 3DS Max SMD exporter plugin.

The first bug was incorrect error warnings about a mesh not having Sub/Muli-Object material when using a non-English version of 3DS Max. Thanks to Cherubim Entia for reporting that bug and testing the fix. The second bug was the exporter crashing when a rig contained a lot of mirrored parent bone/objects reported by “ifO” over at Mapcore who provided me with a good description and a Max file to debug from. The fix for this bug should also fix the crash when exporting an animation backwards.

Thanks again to those of you who have reported bugs and sorry I haven’t been able to jump on the problem as quickly as I liked. Hope the updated plug-in fixes most of the current issues.

Aug. 26, 2008 @ 23:42

Blimey. Has it really been two months since I last posted something?

This summer has gone by really quickly and I’ve been extremely busy hence the lack of activity. I got to take a short holiday and went back to England for two weeks for my little sisters wedding. Apart from that I’ve been working like a maniac as we’ve got a product launch due for September at work which means a lot of overtime and late nights getting everything finished. 🙁

As I’m officially and “old fart” I’m afraid that after a hard day at the office I usually fall asleep as soon as I get home which means even less freetime. That said, what freetime I do have is currently spent on some writing projects and Ham and Jam. We’re going from Alpha to Beta soon and starting an aggressive testing programme so that’s going to keep my busy.

I’ve been getting a lot of e-mail asking about the SMD Exporter and Importer plug-ins so I figured I’d make a post here to answer some of the most common questions that people are asking.

For the exporter, I’ve been getting some good feedback from people on a couple of bugs but unfortunately haven’t had chance to address them all yet. The two most common are problems with material types in Max installed in languages other than English and crashes with mirrored bones. The language issue is solved and will be in the next update. The mirrored bones is a more complex problem and may take some time to fix.

I’ve said before and I’ll say again, don’t mirror bones in Max!. The most common mistake people is making is using the Tools->Mirror command in Max. This is the wrong way to do it and simply reverses the axis which is why your getting export problems. If you’re going to mirror bones, use Animation->Bone Tools turn on Bone Edit Mode and use the Mirror button. That will mirror them but keep the axis in the right orientation. For dummies you’ll have to mirror them manually but that doesn’t take too much work.

As for the SMD Importer, again I haven’t had much time to work on it but it’s certainly a lot further ahead that it’s been in a long time. Currently it’ll import meshes, UV, textures and bones although at the moment I haven’t set-up the skin modifier or looked into animation.

I’ll try and post some more updates soon, but in the meantime please be patient! 🙂

Jun. 23, 2008 @ 14:30

I’ve made an update to the 3DS Max VTF Importer plug-in to add support for Max 2009. While I was at it I took the opportunity to re-write some bits of the code and stick some optimisations in. Not much but every little helps.

If you’re installing this new version please make sure you delete the old plug-in file from your Max plug-ins folder before you install the new one. It’s especially important for 64-bit Max users.

What a bloody week.

It seems the “United Servers Against Jed” had their annual meeting this week and decided to sacrifice one of themselves in protest. A database server decided to crash and burn which meant I spent a lot of overtime this week trying to get the damn thing up and running again. It took until Friday to actually get the server back on-line but I’m still working on the database recovery. Luckily it wasn’t the primary database but it’s still a pain in the arse.

Ironically enough, a few days before we’d put in an order for the new back-up storage solution which hopefully will stop this sort of thing happening again but I guessed USAJ heard about it and felt immediate action was required. So this weeks been nothing but late nights and coffee trying to fix servers so little attention to much else.

On a positive note, I slapped the Max SDK a bit and it’s now dancing to my tune. I sucessfully to the bone import sorted on the SMD importer and am happy to say everything is working as it should be. Current status is that it will import meshes, uv-coords and textures and the reference bose pose so far. Next stage is to glue the mesh to the bones with the weighting and then tackle animation.

May. 29, 2008 @ 23:36

I’ve not had a lot of free time this week but I’ve managed to make a bit more progress with my Max SMD importer. Mesh import seems to work fine and it now imports the materials and UV mapping too which is nice.

I did have one colossal panic when suddenly Max would start crashing when you tried to add a modifier to the mesh or when you actually exited. Lots of error messages about corrupt heap which is never good for your heart pressure. After much debugging it was down to an out of range index which wasn’t my fault. A rather vague description in the SDK docs had me putting the wrong value somewhere. Doh!

So Sunday afternoon I decided it was time to tackle the part I’d been dreading – importing the bones and animation into Max. There’s very little decent information on making bones in the Max SDK and I don’t know many people who’ve found it easy.

My first task was just to template out some code to actually just create a bone in 3DS Max. I think having my teeth pulled is less painful. To illustrate, lets imagine a conversation between MaxScript and I…

Me: Hello. I’d like to make a bone please.
MaxScript: Sure, here you go.
Me: Great! Can I move it over there?
MaxScript: No problem. *moves*
Me: And rotate it a little to the left?
MaxScript: Anything you want! *turns*
Me: Fantastic!

Now, lets re-enact that little scene as it went for most of Sunday afternoon between myself and the MaxSDK:

Me: Hello. I’d like to make a bone please.
MaxSDK: What sort of bone? *shifty eyes*
Me: Well you know. Regular bone in Max that you make skeletons with.
MaxSDK: Like a helper?
Me: Err I guess, if that’s what it is.
MaxSDK: Ok. *creates*
Me: That’s not a bone! It’s just an object!
MaxSDK: That’s what you asked for a helper object bone!
Me: No, I meant a blue normal bone in Max.
MaxSDK: Oh you want a geometric object derived bone.
Me: Err yeah, whatever. Just make one please.
MaxSDK: Well you’ll have to tell me it’s class and super class.
Me: What? How the hell do I know that? Don’t you?
MaxSDK: Oh yes, but I just like to hear it. *sniggers*
Me: Oh FFS. *looks in SDK docs* I can’t find anything about that class!
MaxSDK: Well try harder!
Me: A clue? Nothing’s coming up when I search for “bone” or “bones”.
MaxSDK: Maybe I put it somewhere else…

Later that same afternoon…

Me: Ha! Found it! Make me a bone please.
MaxSDK: Oh very well….
Me: Can you move it over there?
MaxSDK: If you wish.
Me: And turn it a bit?
MaxSDK: Ok.
Me: What the hell? Why did you move it again?
MaxSDK: I didn’t!
Me: Yes you did it’s over there now!
MaxSDK: Oh yeah. Well I decided to reset the translation component of the matrix.
Me: Why you do that?
MaxSDK:
Me: I f***ing hate you MaxSDK…
MaxSDK: What? Oh sorry I wasn’t listening, I was just over there eating some more memory.
Me: Sod this, I’m going to the pub…
MaxSDK: Can you get me some chips on the way back?

The above was then followed by two more hours of wondering why I wasn’t allowed to alter the appearance of the bone. Oh I’m sorry MaxSDK, you said when I made the bone you would make it as an Object. You didn’t tell me that you wanted to make ita SimpleObject2. See I thought a SimpleObject would be somewhat LESS than a normal Object but no, in fact it’s more. Well bugger me. You are a tease!

I think you understand my frustrations thus far.

Been a while since I made any posts about what I’m up to these days so I thought it was about time I did. Not that I made many before but anyway…

In what little free time I’ve had over the past three months I’ve been hitting the Ham and Jam code pretty hard, doing what feels like a huge amount of coding to try and nail all the bugs we found in our last play test. There’s still some small niggles but if the hlcoders mailing list is to be believed, their inherent SDK bugs and hard to fix and not likely to go away.

Anyway, of the new thing to add was the deploy system for weapons with a bi-pod which, after two false starts, actually works now. The process of doing the deployment and swapping animations wasn’t too hard – it’s just all the other crap you have to deal with like the logic to check if you should be allowed to deploy and limiting player movement, preventing weapon selection, etc.

TF2 Heavy imported into 3DS Max 9

Still, apart from the art asset side of things, game play wise Ham and Jam is really starting to come together and resemble a proper game now.

I’ve been working quite a bit with 3DS Max plug-ins over the past week too and finally found a couple of hours to do some more work on the SMD importer I’m writing for Max 9, 2008 and 2009. I made a bit of a breakthrough today in that I made the first successful test run of the mesh re-construction code and apart from a small few snags at first, it actually works!

TF2 Heavy imported into 3DS Max 9

This may not seem like a big deal, but when you consider how an SMD file stores data it’s actually pretty cool. SMD files store each polygon in your model as a separate un-joined triangle. The problem with importing data like that is you get a huge number of duplicate vertices and your polygons aren’t actually connected together. As a result, you can’t smooth them out or set the normals properly as anyone who’s tried to use the MaxScript importer will know. The code I wrote analyses the data coming in from the SMD and uses some logic to reconstruct the mesh as one continuous mesh rather than separate triangles.

Lastly, you’ll probably of noticed over the last month or so I updated all my VTF tools to support the 7.4 texture version which started shipping with the Orange Box games. It took a while to do, mainly due to VTFLib which they rely on being a bit out of date. Nem usually handles the releases and while the code was there, he’d got really busy and didn’t have a chance to get it out as quickly as usual. Still, not biggy, it’s done now so hopefully everything should handle EP2/TF2 textures just fine now.

That’s all for now. Back to work…