Sharing animations between different models
by Karen McKenna · in Artist Corner · 09/17/2006 (2:26 am) · 6 replies
Torque is still pretty new to me, so please forgive me if I'm missing something basic here. I'm working on a game where the player has a choice between two main characters, one male and one female. I'd like to make it so that these two characters (as well as some of the enemies) share the exact same animations. I'm a bit confused as to how to set this up, though.
I modeled the two characters in Maya 7.0 and gave them the exact same skeleton using the Torque Skeleton Generator. I've exported both successfully to DTS files, and they both show up correctly in Show Tools. I'm now trying to create the animation files. Say I create an animation using the female character... I can get the animation sequence to play in Show Tools for the female character, but not for the male character (if I load the sequence, it doesn't show up under thread control for the other character). Do I need to create each animation separately for each individual character, or can they share the same DSQ files? From the documentation I've read, I'm under the impression that DSQ files should work with different models as long as they share the same skeleton. Is this something I need to work out in the CS file? Is there something I need to do in Maya before I export the animation? I've been struggling with this for a while now and just can't seem to figure it out. Any help would be very much appreciated.
I modeled the two characters in Maya 7.0 and gave them the exact same skeleton using the Torque Skeleton Generator. I've exported both successfully to DTS files, and they both show up correctly in Show Tools. I'm now trying to create the animation files. Say I create an animation using the female character... I can get the animation sequence to play in Show Tools for the female character, but not for the male character (if I load the sequence, it doesn't show up under thread control for the other character). Do I need to create each animation separately for each individual character, or can they share the same DSQ files? From the documentation I've read, I'm under the impression that DSQ files should work with different models as long as they share the same skeleton. Is this something I need to work out in the CS file? Is there something I need to do in Maya before I export the animation? I've been struggling with this for a while now and just can't seem to figure it out. Any help would be very much appreciated.
About the author
#2
It's most likely as Rex said, some node that exists in the DSQ that's not in your DTS. (It may not be your fault, the exporter sometimes remove nodes it decides are "useless", fix this by putting the needed nodes in the AlwaysExport list in your cfg file).
09/18/2006 (9:31 pm)
If you try to load the DSQ in showtool pro it should tell you what's going wrong if you bring down the console (press ~).It's most likely as Rex said, some node that exists in the DSQ that's not in your DTS. (It may not be your fault, the exporter sometimes remove nodes it decides are "useless", fix this by putting the needed nodes in the AlwaysExport list in your cfg file).
#3
09/19/2006 (7:52 pm)
Thank you both so much for the replies. I've been staring at the node listings in the two files, and I still can't figure out where I screwed it up, but I'm thinking it was something I did while copying the weights from one model to the other, since I had them both loaded in the same Maya file at one point. But I tried using the same skeleton for one of the enemy characters, and they were able to share animations without a problem. I'll try skinning and exporting the characters again to see if I can get it to work successfully. I have a much better idea of what to look for now. Thanks again. :)
#4
09/20/2006 (5:20 am)
@Magnus: I forget sometimes about the console in TSTP and the log[afterall it is the engine]...! It would be really nice if TSTP had a small message output letting you know about mismatched Node data. I know there is one small dialog that pops if your TSSConstructor script and file are mismatched...empty spaces in paths are the culprit, and TSTP needs script and file to be named the same[I think].
#5
I don't know how maya works exactly, but it should tell you some nodes/bones are named the same and perhaps ask to rename them.
Rename them with a new suffixes.
Then look into the names. The one with no suffix are different and could be the problematic bones/nodes since they are not shared by male/female.
09/20/2006 (6:22 am)
You could try to merge one of your character (with its skeleton) into the other character maya file.I don't know how maya works exactly, but it should tell you some nodes/bones are named the same and perhaps ask to rename them.
Rename them with a new suffixes.
Then look into the names. The one with no suffix are different and could be the problematic bones/nodes since they are not shared by male/female.
#6
09/20/2006 (8:08 am)
I used the exact same skeleton for both the male and female character (they have similar proportions), just binding different geometry to it without changing the bone names or positioning or anything. I'm just wondering if maybe something was either accidentally left in or accidentally changed or deleted when I imported the second character into the file to copy the weights and then deleted it before exporting. I'll need to wait until I have access to my school's lab again to see if I can check it out in ShowTool Pro. But I'll have to re-export both characters anyway since it looks like the mount points or something are pretty wonky when testing in the engine. But that should probably be a different thread... :)
Torque Owner Rex
BrokeAss Games
So for your example of a male & female character; as long as the same rig is used[and no male_leftArm/female_leftArm naming thing going], the sequences should load. There may be an issue with the TSShapeConstructor script, and it's not loading the correctly??
Now, once you've got sequences swapping files you're nearly there; to be totally swappable, the Nodes[skeleton] must have the Nodes in the exact position and rotation as the target .DTS file, otherwise you'll begin to see offsets in rotations and positions. Not pretty. The closer to the exact same physical structure, the better the sequences swap...
I'm not up on Maya, but the concepts of DTS/DSQ loading cross all the platforms...it's the end files and this is how the engine begins to deal with the assets.
Animation is fun...:).