Game Development Community

Skinned DTSs!!!!! YES

by Sean T. Boyette · in Torque X 2D · 08/20/2008 (7:39 pm) · 5 replies

Ok Gents,
I think this is a necessity and will be modifying pro in order to get it to support skinned DTS'.
Out of the box, it does not.
John or GG may have already had this fix in place, but it appears to be an issue with Object.NodeIndez not being set when its a Skinned object.
I will keep you informed of my progress...
but in order to simply see a skinned model in TX simply modify tsShapeInstance.cs

find:
_meshObjects[i].Object = _shape.Objects[i];
                _meshObjects[i].Visibility = 1.0f;
replace with
_meshObjects[i].Object = _shape.Objects[i];
                _meshObjects[i].Object.NodeIndex = 0;
                _meshObjects[i].Visibility = 1.0f;

I am sure that this is not 100% correct yet - but I will keep you guys informed...
ideally I want to get animations working properly.

Sean

#1
08/20/2008 (7:41 pm)
One slight issue -is that the skinned mesh seems to be rotated oddly - working on that too!
#2
10/20/2008 (9:07 pm)
Sorry for the lack of replies -
for skinning to work - DO NOT do the above..
Find the following:
srs.World.MultiplyMatrixLocal(_nodeTransforms[obj.Object.NodeIndex]);
replace it with
if (obj.Object.NodeIndex >= 0)
                    {
                        srs.World.MultiplyMatrixLocal(_nodeTransforms[obj.Object.NodeIndex]);
                    }
#3
10/20/2008 (9:18 pm)
Okay, that's odd... I guess that explains why it was working for me already, as I had this code already in place :

// Compensate for skinned meshes, which are already set up with their
// local->World transforms during export...
if ( obj.Object.NodeIndex != -1 )
	srs.World.MultiplyMatrixLocal( _nodeTransforms[ obj.Object.NodeIndex ] );

I cannot remember putting that code in, though I suppose it's possible that I had seen that information somewhere before and put it in, though it seems just as likely to me that I just had downloaded a more recent version of the codebase.

In any case, I can confirm that what Sean posted works flawlessly :)
#4
10/20/2008 (9:38 pm)
Jonah,

GREAT _ and thanks for the sanity check.

I wanted to make sure that everyone else has it.

Skinned models are pretty important for the engine.

Sean
#5
12/28/2008 (5:05 pm)
Was this ever fixed in the main build?