Player.dts nodes and the standard dsq's
by Thor Zollinger · in Torque Game Engine · 02/09/2003 (9:20 pm) · 12 replies
Hi guys,
I'm attempting to create a player 3D mesh in Milkshape which can use the .dsq anim files that come with the demo player.dts. What do I name the joints and groups to get the model to match the nodes in the standard player.dts file? Remember, I don't have 3DSMax or I'd already have my own answer. The Milkshape format is far simpler than the max or 3ds formats, so all I need are the names of the parts and joints... I think.
Any information would be helpful, thanks.
I'm attempting to create a player 3D mesh in Milkshape which can use the .dsq anim files that come with the demo player.dts. What do I name the joints and groups to get the model to match the nodes in the standard player.dts file? Remember, I don't have 3DSMax or I'd already have my own answer. The Milkshape format is far simpler than the max or 3ds formats, so all I need are the names of the parts and joints... I think.
Any information would be helpful, thanks.
About the author
#2
I want to replace the model, not the animation sequences. I think I can pull that off if I set up my new model exactly the same way as the stock one.
Thor
02/10/2003 (7:33 am)
I do understand that Milkshape can't create .dsq animations, but can't I create and save a model that can use the existing .dsq anims that come with the stock player.dts? I want to replace the model, not the animation sequences. I think I can pull that off if I set up my new model exactly the same way as the stock one.
Thor
#3
Bip01 Pelvis
Bip01 Spine
Bip01 Spine1
Bip01 Spine2
- Parent: Bip01 Spine2
Bip01 Neck
Bip01 Head
- Parent: Bip01 Spine2
Bip01 L Clavicle
Bip01 L UpperArm
Bip01 L Forearm
Bip01 L Hand
- Parent: Bip01 Spine2
Bip01 R Clavicle
Bip01 R UpperArm
Bip01 R Forearm
Bip01 R Hand
- Parent: Bip01 Pelvis
Bip01 L Thigh
Bip01 L Calf
Bip01 L Foot
- Parent: Bip01 Pelvis
Bip01 R Thigh
Bip01 R Calf
Bip01 R Foot
02/10/2003 (7:33 pm)
I don't know if that's gonna work but here are the node names that I extracted from a dsq file (I don't have 3ds max). Please tell us your results on that matter.Bip01 Pelvis
Bip01 Spine
Bip01 Spine1
Bip01 Spine2
- Parent: Bip01 Spine2
Bip01 Neck
Bip01 Head
- Parent: Bip01 Spine2
Bip01 L Clavicle
Bip01 L UpperArm
Bip01 L Forearm
Bip01 L Hand
- Parent: Bip01 Spine2
Bip01 R Clavicle
Bip01 R UpperArm
Bip01 R Forearm
Bip01 R Hand
- Parent: Bip01 Pelvis
Bip01 L Thigh
Bip01 L Calf
Bip01 L Foot
- Parent: Bip01 Pelvis
Bip01 R Thigh
Bip01 R Calf
Bip01 R Foot
#4
Thanks for the help!
I found a few animation skeletons in the root Milkshape directory which look really close to the nodes you listed, especially the valve_skeleton.ms3d. They lack the eye, cam, mount0, etc. points which are required, but I'm going to add those in and attach a low-poly model I have to the base skeleton.
I'll keep you posted. I'm going to give it a try over the next week or so and see how it comes out...
02/10/2003 (10:01 pm)
Hi Marc,Thanks for the help!
I found a few animation skeletons in the root Milkshape directory which look really close to the nodes you listed, especially the valve_skeleton.ms3d. They lack the eye, cam, mount0, etc. points which are required, but I'm going to add those in and attach a low-poly model I have to the base skeleton.
I'll keep you posted. I'm going to give it a try over the next week or so and see how it comes out...
#5
The Names of the bones and joints allone aren't enough. The DTS Format saves all names in a string table and all nodes, objects and so on stores the name thru a name index.
Like the nodes
So Milkshape and 3D Max, generate all datas and every node gets a "name index". If you look with a Hex Editor in the Player.dts you will see following string table.
Detail145
Detail80
Detail60
Detail30
Detail12
Detail6
Detail3
Bip01 Pelvis
Bip01 Spline1
Bip01 Spline2
...
So, the first Node.name = 8 and if you export your model with Milk, your Bip01 Pelvis gets another Name Index.
02/10/2003 (11:31 pm)
Don't get me wrong (i hope you will have success), but your new Milk Player won't work with the dsq animations.The Names of the bones and joints allone aren't enough. The DTS Format saves all names in a string table and all nodes, objects and so on stores the name thru a name index.
Like the nodes
struct Node
{
int name ; //!< Index of its name in the DTS string table
int parent ; //!< Number of the parent node, -1 if it is root
int firstObject ; //!< Deprecated: set to -1
int child ; //!< Deprecated: set to -1
int sibling ; //!< Deprecated: set to -1
Node() {
// These values unused in data file
firstObject = child = sibling = -1;
}
};So Milkshape and 3D Max, generate all datas and every node gets a "name index". If you look with a Hex Editor in the Player.dts you will see following string table.
Detail145
Detail80
Detail60
Detail30
Detail12
Detail6
Detail3
Bip01 Pelvis
Bip01 Spline1
Bip01 Spline2
...
So, the first Node.name = 8 and if you export your model with Milk, your Bip01 Pelvis gets another Name Index.
#6
The first thing it does is match the nodes of the sequence to the nodes of the shape based on the names. And then it will remap all the node numbers of the sequence to make it work with the shape.
02/11/2003 (4:37 am)
Well, I don't really know the .dts and .dtq format all that well but I just went step by step through TSShape::ImportSequences(). That's the function used to import .dsq sequences.The first thing it does is match the nodes of the sequence to the nodes of the shape based on the names. And then it will remap all the node numbers of the sequence to make it work with the shape.
#7
in this function, it compares the given nameIndex (Signed Int) with all nameIndex from the sequence and if it founds the same nameIndex in the sequence it returns i.
It compare only the two nameIndex and not the names, so if one of the two string tables has another order it shouldn't work.
Ok, maybe i'm totaly wrong (hope so, we have only Milkshape in use ;))
02/11/2003 (5:32 am)
Marc, you meen this function ????S32 TSShape::findSequence(S32 nameIndex) const
{
for (S32 i=0; i<sequences.size(); i++)
if (sequences[i].nameIndex==nameIndex)
return i;
return -1;
}in this function, it compares the given nameIndex (Signed Int) with all nameIndex from the sequence and if it founds the same nameIndex in the sequence it returns i.
It compare only the two nameIndex and not the names, so if one of the two string tables has another order it shouldn't work.
Ok, maybe i'm totaly wrong (hope so, we have only Milkshape in use ;))
#8
importSequences() uses readName() which uses findName() which does a dStrcmpi() to compare the node names.
I've done a little test, if I name all the nodes corectly the sequences are properly merged with my dts file. Use different names and nothing happens which proves that the names are used not the nameIndex. The sequences are replayed incorectly which is quite expected since my skeleton isn't exactly the same. But if I could import the skeleton from the original player.dts into milkshape3d I'm quite sure it would work.
02/11/2003 (5:51 am)
No that's not how it works.importSequences() uses readName() which uses findName() which does a dStrcmpi() to compare the node names.
I've done a little test, if I name all the nodes corectly the sequences are properly merged with my dts file. Use different names and nothing happens which proves that the names are used not the nameIndex. The sequences are replayed incorectly which is quite expected since my skeleton isn't exactly the same. But if I could import the skeleton from the original player.dts into milkshape3d I'm quite sure it would work.
#9
Eye, Mount0, Mount1, Mount2, Unlink and Cam.
What's Unlink? It seems to be the parent to Cam, but I'm not quite sure what it's used for.
02/11/2003 (10:00 am)
I went through all of the .dsq files and the nodes listed are all standard Bip01 skeleton nodes, plus a couple of extras. The extra Torque ones are:Eye, Mount0, Mount1, Mount2, Unlink and Cam.
What's Unlink? It seems to be the parent to Cam, but I'm not quite sure what it's used for.
#10
02/13/2003 (6:39 am)
No luck so far.
#11
02/13/2003 (6:43 am)
Thor, have you seen Tim Gift's response in hits thread: www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=8838
#12
02/14/2003 (6:51 am)
Hmmm... I was hoping to reuse the animations over a range of models, i.e. have a set of light armor sequences, a set for medium, and a set for heavies, then change the model from a script. I guess I'll just have to make a set of animation sequences myself in milkshape and add them into each new model every time.
Torque Owner Sven "RaCooN" Knie
It needs a new Milkshape exporter.