Animated props

Started by ahktang, January 24, 2012, 06:11:30 PM

Previous topic - Next topic

ahktang

first off, thank you very much for this tool. I'm positive that I wouldn't have gotten very far along in my prop creation pipeline without this excellent tool.

this forum may not be the right place for my question, but here goes anyway. I have created an animated prop with one sequence in addition to the default idle sequence.   I have exported using wwmt and it looks correct in HLMV. the problem i'm having is that WWMT used $collisionjoints in my QC file, which means that I don't have a concave collision mesh.  according to the valve wiki, $collisionjoints cannot use $concave.


I tried changing the $collisionjoints to $collisionmodel, but then my collision mesh stops animating.

does anyone know how to set up the max scene correctly for animated  collision meshes or a resource for working with concave collision meshes?  I read https://developer.valvesoftware.com/wiki/$collisionjoints  but i'm still confused.

thanks for any help.


wallworm

I think I may be a little confused. Are you saying that the collision model is not working correctly with $collisionjoints?

The $collisionjoints is necessary with animated hulls. I have exported many models with $collisionjoints and the hulls are $concave overall... though I believe that each piece of hull skinned to any particular bone must be convex (I don't think you can have concvaity between multiple hull pieces skinned to the same bone... but I haven't verified that).

Maybe if you made a sample file and linked to it, it might be a little more clear as to the problem and/or the cause of your issue.

ahktang

#2
Thanks for the help.  First off I'm sure this issue is user error stemming from my inexperience with the source engine.

To clarify what I'm grappling with, I have a model that works correctly and animates properly. the collision mesh animates properly as well. the problem is that the cage does not "shrink wrap" around my model properly due to not being able to use the $concave keyvalue.

If I understand what you are saying, I need to create separate bones for each convex piece of my collision hull. is that correct?  is it proper to have a separate bone rig for the collision mesh and the main model?

I have attached a simple project to illustrate what I'm trying to do. I wasn't sure what you needed so I included all of my exported files from max and the compiled files as well. I am working on a custom mod on the alien swarm SDK. so that's the compiler that was used.

edit: i made a mistake in the scene i just uploaded give me one moment to fix the files

edit 2: here is a zip with the max scene file and all of the wwmt output..
http://www.gnatmagone.com/wp-content/uploads/2012/01/animtest2.zip

wallworm

The problem comes down to the fact that your two hull "pieces" are skinned to a single bone. I say two pieces even though they are a single object... they are two pieces because the hull is composed of two convex elements.

When using animated models... you can only have one convex hull per bone.

What you need to do is add another bone into the model, break the hull into two parts... keep one skinned to the current bone and the second skinned to the new bone. Of course you'll need to animate that new bone like the existing one.

Hopefully that makes sense.

PS. Although the $concave parameter in the QC is not valid for $collisionjoints... the compiler ignores that option... so having the $concave setting will not hurt you in this case.

ahktang

#4
Part of the issue, I believe, is that I am creating the asset in maya and importing to max purely to use your tools. my ignorance about max is making this process harder than it probably should be.

anyway, I attempted to make the changes as you suggest. but I seem to be having an issue. when I separated the 2 convex hull pieces into separate objects and gave them 2 separate bones, the collision mesh was shaped properly, and it animated along with the main model properly, but when I loaded it into HLMV, the second convex hull of my collision mesh was offset by a few units. I'm not sure what I'm doing wrong since the animation and the object's pivots look correct in the max viewport.

here's what it looks like in hlmv:


I went ahead and tried to apply this workflow to the actual asset that I am working on for the mod. it's a subway  turnstile, with a rotating 3 pronged bar. I am trying to make the turnstile rotate and have the collision hull rotate properly along with the model. even making each bar into a separate collision hull, with a single bone for each object, the resulting physics model is not concave.  I'm starting to wonder if the export from maya to max is somehow messing up the bones. (joints in maya)

here's what that looks like in HLMV:


I have attached a max scene with my rotating bar. if you have time to look at it, I'd be really grateful. 

http://www.gnatmagone.com/wp-content/uploads/2012/01/turnstile01cVER2.zip

wallworm

I've downloaded the file but won't be able to look at it tonight. Maybe someone else will be able to get back to you before I do. KevingLongtime (one of our moderators) also uses Maya so maybe he will jump in.

wallworm

I've opened the file and see your dilemma. I will try to figure out the cause of the problem.

ahktang

thanks for looking at the file! I've manage to fix the issue in my model. I'm not sure exactly how the bone hierarchy is supposed to be organized for the source engine, so I'm not exactly sure what changes I needed to make to fix it but I have managed to get my model working.

I removed all of my bones from their hierarchy. I just used one root bone and duplicated it in place three times. (one for each individual part of the collision mesh) I then key framed each bone individually. I think by keeping the bones right on top of each other I was able to fix the problem with my hull pieces becoming offset in source.  I'm not sure if this fix would work for a more complex model that needed bones parented together into a hierarchy, but for this asset, everything works perfectly.

it's a very weird, non-intuitive workflow for me, but it seemed to work out. here's the asset in HLMV:



thanks again for your help. I'm still guessing that my problems with bones are stemming from the conversion from maya to max. since everything seems to look good inside both 3D packages. it's only the source engine export that seems to be messed up.

SMF spam blocked by CleanTalk