3ds Max: Exporting a Rigged Model with full animations?

Hi, I have an NPC I’m trying to get into Garrysmod but I’m not sure how to export it. If I export one SMD with full animations and skeleton and model, or model SMD, sever animation SMD’s, and one Skeleton SMD, or one model and skeleton SMD and one Full Animations SMD. How do I export these? I am unable to find any tutorial or information other than adding animations to citizen NPC’s which is of no help. I am using 3ds Max 2011 and have Softimage 2011 but I don’t know what softimage is for in SMD, I read somewhere it’s needed for exporting animations in Source. Thank you.

You’ll need one SMD for the ‘reference model’ (The one that contains your model’s actual appearance and skeleton) and several for individual animations (sequences). Sequences are referenced in the *.qc with the $sequence command.

Here’s what a *.qc for model containing several animations might look like:


$modelname "props\mymodel.mdl"
$model "mymodel" "mymodel.SMD"
$cdmaterials "models/mymodel"
$surfaceprop "plastic"

$sequence idle "idle" ACT_IDLE 1 loop fps 30.00
$sequence wave "wave01" fps 30.00
$sequence shake "shake01"

The first name called by the $sequence parameter is the name you’re giving the animation and the one in quotes is the actual SMD’s filename. The SMDs used to make this model are:

mymodel.smd (reference model)
idle.smd (sequence)
wave01.smd (sequence)
shake01.smd (sequence)

What about Collision?

The collision model is also exported as a reference model and it’s called in the .QC file like this:



$collisionmodel "phymodel.smd" {

	$concave
	$mass 1.0
	$inertia 1.00
	$damping 0.00
	$rotdamping 0.00
}

That’s for a solid, non-moving prop. If you want the prop to be moveable, you have to insert a line like this above the previous block of code:


$keyvalues  { prop_data { "base" "Plastic.Medium"  } } 

If you want the model to behave as a ragdoll, that’s an entirely different story and things will get a bit more verbose.

Great, thankyou. This is perfect.

but for animation Activities, how do I differentiate Animations with weapons and unarmed?

also, if i use $keyvalues “{ prop_data { “base” “Plastic.Medium” } }” on an NPC, will the animations still work? because I have a death animation.

Happy to help!

For NPC animation activities there are all kinds of parameters that you can amend to the $sequence lines to designate them as NPC functions, here’s en example for firing two different weapons using the combine soldier AI:


$sequence attack_pistol "attack" ACT_RANGE_ATTACK_PISTOL 1 fps 30.00 
$sequence attack_smg1 "attack" ACT_RANGE_ATTACK_SMG1 1 fps 30.00 
$sequence reload "reload" ACT_RELOAD 1 fps 30.00 {
  { event 2 1 }
}

This setup is using the same animation for both the SMG and Pistol firing animations. There are two things going on with the ‘reload’ animation; it first gets called by the ACT_RELOAD function, then runs an animation event (2) on frame 1 to tell the NPC what frame to actually reload the weapon on.