Tutorial: Using gmax to import and export SMDs

Users who are viewing this thread

Thorgrim

Knight at Arms
Using gmax to import and export SMDs

When creating mods for Mount and Blade, you will often want to modify, or even create whole new sets of armour, mounts for players to use, or even monsters for players to fight.  These meshes are slightly more complex than your standard weapon or scene props, in that they are "rigged" to a

Highelfwarrior has a tutorial on rigging, however this tutorial will cover the step by step details for using gmax.  For more details on performing the actual rigging, see his thread.

In this tutorial, we will import an SMD (that has been exported from BRFEdit) into gmax, then export it back out.  This may seem completely pointless, and it is! However you should of course do any modifications you wish to make to the mesh before exporting it, or if you prefer, create a whole new mesh and bind it to the imported skeleton.

If you do not already have gmax and the required plugins, you can get them from the BRFEdit thread.  You will require:

gmax (you need to register to download it)
SMD Importer (gmax / 3ds Max)
SMD Exporter (gmax)


Place these plugins in Gmax\scripts\startup



Part 1: Getting an animated mesh from BRFEdit, into gmax

Step 1: Open a file in BRF that contains an animated mesh, such as armour in item_meshes1.brf.  Select an item that has the "Skeletal Animation" checkbox ticked, then select export, and export it as an SMD.

Step 2: Open gmax, and select the utilities tab from the right hand menu.
Then click the MAXScript button, and it should then display a section with a dropdown box containing the plugins you have placed in the startup folder.

gmaxTut1.jpg


Select the Half-Life SMD Import option.

You should then see a new panel similar to this:

gmaxTut2.jpg


Click the Import SMD button, then select the SMD you wish to import.


You should now have the SMD in gmax, which you can modify all you like.

Wasn't that easy?





Part 2: Getting an animated mesh from gmax, into BRFEdit

Step 1:  Open up the utilities tab again, and this time select the SMD Exporter option.

gmaxTut3.jpg


Click the Pick Model button, then select your mesh

gmaxTut4.jpg


The button should now have the name of your mesh.

Now click the Export SMD button.  You will not see anything happen: this is to be expected so don't worry  :smile:

Right click in the text box in the bottom left corner of the screen, and then select open listener window.

gmaxTut6.jpg


Now run GMaxSLGRAB.exe (included with the SMD exporter plugin) and click Grab.

gmaxTut7.jpg


Save as a filename, ending in .SMD, such as armor.smd.

Then open up notepad, and drag this file you just saved into it.

Remove the top and bottom sections highlighted below:

gmaxTut8.jpg


gmaxTut9.jpg


Then save it, and open it with BRFEdit.

You should now see your mesh in the mesh resource list, and should be able to select and view it.


If you still have any problems let me know :smile:

 
fisheye said:
Oh wow! Thanks Thorgrim!

Is this thing linked to from a sticky anywhere?

I just added it to the Q&A thread, but that thing is getting a bit messy, and I'm sure its missing a fair few threads.

What we really need is a website with nicely organised tutorials, in html format, with all the info from all these threads in 1 place.  I've talked about it before, but now I've got a little more time I might try get onto something.

I'm not really great at web design stuff though, so once ive got it roughed out I might try find someone to make it all look nice :smile:

If anyone else wants to help, let me know.  I think most of the info is here though, we just need to put it all together.
 
Dont know what I'm doing wrong but I still get the "this file type cannot be imported" error in BRFedit when importing the XML file (with .smd behind the name)

Did everything as clean as possible..
 
Send me the file and I'll take a look...

By the sound of the error it does not have a .SMD extension.

Are you sure its extension is .SMD (not .smd.xml or something?)

And incase you haven't already... make windows explorer show file extension types.  How you could live without that I will never know.
 
It happens with any model that I try, I'll give it another few shots this afternoon

I just saved the file (XML file) as test.smd (as a name)

imported it in brfedit and got the error.

And incase you haven't already... make windows explorer show file extension types.  How you could live without that I will never know.

How do I go about that?
 
Highelfwarrior said:
And incase you haven't already... make windows explorer show file extension types.  How you could live without that I will never know.

How do I go about that?
Open a folder, then choose "Tools->Folder Options" in the top menu. In the new Folder Options dialog window, click the View tab, look for the "Hide extensions for known file types" option in the list, and uncheck it.
 
"The button should now have the name of your mesh.

Now click the Export SMD button.  You will not see anything happen: this is to be expected so don't worry  "

Hi there Thorgrim,

I'm a beginning modder and I tried all these things out but I've run into a few problems. When I push the button in GMAX it doesn't have the name of the mesh on it. I can't even select anything while the button is 'pressed' (selected), I have to select first and then push the button.

The Export SMD button does nothing and when I open up the script listener it only says No Bones Selected or something. I'm probably doing something wrong somewhere but I'm not sure where.

When you're making a hat do you select just the hat or the big skeleton model?

Thanks!
Jamie
 
Hey Jamie,

If you are just making a hat, you do not need to do any rigging or anything that is covered in this tutorial, simply export as an obj.  Hats cannot be animated anyway.

However if you want to make an animated body mesh, you will need to "rig" the mesh to the bones (It sounds like you haven't done that yet).  If you want to try do that, there are a number of rigging tutorials here (the 3ds Max ones, should be pretty much the same for gmax), or any generally 3ds max / gmax rigging tutorial should teach you what you need to know too.
 
Man, that was great!
I was in a fight against this @$&%*!@ program. Maybe now things will be easier.
 
Thorgrim said:
Hey Jamie,

If you are just making a hat, you do not need to do any rigging or anything that is covered in this tutorial, simply export as an obj.  Hats cannot be animated anyway.

However if you want to make an animated body mesh, you will need to "rig" the mesh to the bones (It sounds like you haven't done that yet).  If you want to try do that, there are a number of rigging tutorials here (the 3ds Max ones, should be pretty much the same for gmax), or any generally 3ds max / gmax rigging tutorial should teach you what you need to know too.

Hi Thorgrim,

So GMAX should let me export as an OBJ then? I just export the hat as OBJ and then it should be visible in BRF Edit right?

I was also doing clothes (SMD) files - I want to make a 18th century mod and so I'd like to make those lacy waistcoated costumes and Scottish great plaids. I did a Scottish plaid but the file wouldn't save so I saved it as a GMAX pending future developments. Is it still possible to save the GMAX file in the method you described here for conversion to SMD or do I have to do everything over?

In rigging I have to attach the costume to that stand up skeleton? Then if I export it as descibed here it should work right?

Sorry, I must seem like a total idiot, I've been able to work with basic wireframe modification before with 3D Studio Max 1 and 2 and Milkshape but that was it.

Thanks for your help and for all these tools and tutorials!
Jamie
 
James MacAdams said:
Hi Thorgrim,

So GMAX should let me export as an OBJ then? I just export the hat as OBJ and then it should be visible in BRF Edit right?

Yes, as long as you have the plugin for it (I think its in the BRFEdit thread)

James MacAdams said:
I was also doing clothes (SMD) files - I want to make a 18th century mod and so I'd like to make those lacy waistcoated costumes and Scottish great plaids. I did a Scottish plaid but the file wouldn't save so I saved it as a GMAX pending future developments. Is it still possible to save the GMAX file in the method you described here for conversion to SMD or do I have to do everything over?

Saving as gmax format, then exporting to something else later will work fine, yes.

James MacAdams said:
In rigging I have to attach the costume to that stand up skeleton? Then if I export it as descibed here it should work right?

You should use the skin modifier to rig the mesh to the skeleton.  It is not quite the same as attaching, but yes, once you have rigged it to the skeleton you should be able to export it as in the tutorial.
 
Thanks very much Thorgrim! I'll start with Hats so it's not too tough  :oops: Hope you don't mind me pestering you guys from time to time!

Many thanks!
Jamie
 
Okay ,a problem. The .SMD exporter is not behaving properly. Previously, it did exactly what you explained in the tutorial. Now, however, when I choose my model and click export, I get a file browser, and when I save the file, I get an error message.

--Runtime error: Feature not available: "createFile"

Hooray for unreliable computerss!  :roll:

edit: problem seems to have fixed itself...
 
I'm sorry to bump such an old topic, but i'm having problems with the .SMD exporting. Instead of getting lots of cordinates i just get loads of #Copy and paste this blablablabla# without any numbers.

Looks like James MacAdams had same kind of problem earlier, i can't pick my mesh with the exporter either. I'm really puzzled here.  :neutral:

I already have the .OBJ exporter someone suggested earlier but it does the same thing.
 
Back
Top Bottom