Thanks to feedback from a number of users I’ve now managed to squash some more bugs and make another update.

Two big bugs from 0.2b have been fixed:

  • Fixed sum-materials of Sub/Multi-Object material types not being exported correctly.
  • Added trap for invalid face material ID’s.
  • Fixed bones that have been mirrroed (no right hand rule) being exported incorrectly.

To explain the fixes – there was an error (my own fault) with how Mult/Sub-Object materials were being exported. Due to an oversight in my part I was trying to grab a sub-material with an invalid ID number which was making Max fall over. I also discovered that it’s possible to assign a material ID to a face which doesn’t correspond to an ID in your material. I’ve added a trap for this.

Read the rest of this entry »

Feb. 23, 2007 @ 01:58

Quick update on the 3D Studio Max 9 exporter…

I’d planned to release another update this week but Xander pointed out a wierd bug which needed some investigation. After some rather complicated detective work it turns out that bone and helper objects that have been flipped with the mirror modifier get exported backwards if they dont have their transforms reset. The most obvious way to spot these is when importing an SMD because the bones appear inside-out.

Just a tip – it’s generally BAD to mirror something and not reset it’s transforms before export. It causes strange things to happen and not just in the SMD exporter. It’s also the reason why sometimes your meshes end up with their normals flipped. 3DXI auotmatically deals with mirrored mesh geometry but it doesn’t handle bones hence the bug Xander experienced.

That said, I don’t like fixing bugs like this because it makes my head hurt writing the following code:

// figure out of the parent node is mirrored.
Point3 a = pNode->GetNodeParent()->GetObjectTM(0).ExtractMatrix3().GetRow(0).Normalize();
Point3 b = pNode->GetNodeParent()->GetObjectTM(0).ExtractMatrix3().GetRow(1).Normalize();
Point3 c = pNode->GetNodeParent()->GetObjectTM(0).ExtractMatrix3().GetRow(2).Normalize();
Point3 d = CrossProd( a, b ).Normalize();
pExportNode->parentMirrored = DotProd( d, c ) < 0  ? true : false;

I also discovered a bug with Mult/Sub-Object materials where it’s crashing trying to retrieve invalide sub-materials and borks when has a material ID assigned but there is no matching ID in the actual material itself. This has been fixed.

Still some small fixes/enhancements to test and hopefully a updated download by the weekend.

Feb. 22, 2007 @ 11:34

I was mooching around Stockholm yesterday (after risking my life to take photos standing in the middle of a frozen lake) and happened to walk past a model shop so out of curiosity I thought I’d take a look. Wow, plastic kits have got bigger since I was a kid. Seriously, one of these things came in a box about 6 feet tall!

Anyway, one thing caught my eye – they actually had a plastic kit of an IX-B U-Boat exactly the type I just made a 3D model of. Was wierd seeing the model I’d spent a month making from drawings and photos in 3D and to spot all the details I’d missed. I kind of wish I’d had it to use as reference. Was more impressed by the fact this model came with a motor and was actually designed to float – I can’t think who’d spend all that time making and painting this kit then stick it in the bath…

I wish I’d had the 400 SEK ($30) this thing cost. Would look good stood on top of my monitor. :o)

Feb. 22, 2007 @ 11:24

You ever hear that quote about rats in New York?

“In New York city, you’re never more than six feet from a rat at any given time”

I dunno why but this popped into my head last night while sat at T-Centralen drinking coffee – How far are you from a can of Coke at any given time?

Think about it, just about every small shop or kiosksells it and what about homes and offices? I mean it’s got to be one of the most global brands out there and its pretty abundant.

So what you reckon? 75 feet?

Feb. 16, 2007 @ 17:12

Well that’ll teach me to release something on the 13th…

I’ve managed to nail a bunch of reported and un-reported bugs and update the 3DSMax 9 SMD exporter. So we’re now at version 0.2b! Bug fixes are as follows:

  • Fixed bug where floating point numbers were output in user’s regional locale format. (Thanks a bunch Microsoft for adding that “feature”…)
  • Fixed hidden bones and meshes being exported. Now, in normal “Export” mode only what is visible is exported. In “Export Selected” mode, what is selected is exported even if it is hidden.
  • Fixed bug where a bone who’s parent is not to be exported had its position and rotation misplaced.
  • Revised mesh output so that if a vertex’s weights include a bone that isn’t to be exported, all weights are collapsed and assigned to the meshes default bone. This stops invalid vertex weights.
  • Stopped exporter over-writing file with nothing if Cancel button pressed.

So, we’re still in beta so keep reporting those bugs. You should re-download the plug-in and replace the file in your Max plug-ins folder.

Feb. 13, 2007 @ 18:32

I’ve been playing with Max 9 as some of the new features like Animation Layers really appeal to me – very useful for doing player model anims in Source.

However, seems none of the existing Max SMD utilities work with Max 9. Cannonfodder’s plug-ins don’t work at all and seeing as he’s vanished off the face of the planet, it’s unlikely he’ll update them. Also, speaking to the guys over at Wavelength, they’ve lost the source code to their version. :o(

So, stuck with no other choice, I’ve written my own SMD exporter from scratch and it seems to work pretty well so far. I’m releasing it as a Beta though as I’m sure my workflow is different to yours so you may turn up something I’ve missed.

Quick list of what it can do…

  • Written for Max 9, 32-bit from scratch using the 3DXI interface.
  • Exports either all visible objects or selection only (via Export Selected).
  • Supports Standard and Multi/Sub-Object Materials.
  • Works with Editable Mesh or Editable Poly geometry.
  • Works with Skin or Physique modifiers.
  • Supports using helper nodes such as Dummies or Points as bones with the Skin modifier. These are useful for things like weapons or machines where you may need translation movement on a linked bone as well as rotation.
  • Exports reference and sequence SMD’s.
  • Optional exporting of a sub-range of the animation.
  • Optional exporting of the animation reversed.

I’m releasing it as a Beta version because my workflow is different to everyone elses so I can’t test for every situation. If you come across any problems, let me know.