Game Development Community

T3D 1.1 Beta 3 - Animation sequence node problem (with fix) - LOGGED

by Kerry Enfinger · in Torque 3D Professional · 11/23/2010 (8:19 pm) · 4 replies

Build: 1.1 Beta 3

Platform: Windows 7 64-bit

Target: Editors, Platform

Issues: When parsing an animation from a Collada file, skeleton nodes that are not keyframed are imported into the DTS file.

Steps to Repeat:
1. Import Collada file for character animation with root joint rotated.

Suggested Fix:
The function isEqualQ16 in tsShapeLoader.cpp is returning incorrect values. This causes the rotationMatters to be set on every node in every frame during animation import. It will also cause arbitraryScale count to be set inappropriately. I don't know why the "==" operator was not used.

To fix the problem, just use the "==" in each case in TSShapeLoader::setRotationMembership and TSShapeLoader::setScaleMembership. I also did this in TSShapeLoader::setTranslationMembership:

In TSShapeLoader::setRotationMembership:

if (!isEqualQ16(nodeRotCache[iNode][iFrame], defaultRot))

should be:

if(!(nodeRotCache[iNode][iFrame] == defaultRot))


In TSShapeLoader::setScaleMembership:

if (!nodeTransCache[iNode][iFrame].equal(defaultTrans))

should be:

if (!(nodeTransCache[iNode][iFrame] == defaultTrans))


About the author

Owner of Altered Reality Software -- Bachelors Degree in Game and Simulation Programming -- Masters Degree in Database Management -- Currently working on Ph.D. in Computer Science


#1
11/23/2010 (8:28 pm)
This looks interesting, maybe its another plank in the fleet that will allow a safe journey for our character from 3Dmax to T3D.
#2
11/24/2010 (8:49 am)
Kerry,this fix is OK,but eventually will not fix the arbitrary scale animations on dts shapes.
Search for a thread named "Crash when using scale animations",I think you should integrate the last fix from this thread.

The problem is that in TSShapeInstance::animateNodes(),at the beginning of this method are resized only the vectors that hold data about translation and rotation.

smNodeCurrentRotations.setSize(mShape->nodes.size());
smNodeCurrentTranslations.setSize(mShape->nodes.size());
smRotationThreads.setSize(mShape->nodes.size());
smTranslationThreads.setSize(mShape->nodes.size());

In this list you should resize also these vectors:
smNodeCurrentArbitraryScales
smNodeCurrentAlignedScales
smNodeCurrentUniformScales
#3
11/24/2010 (4:03 pm)
Thanks for that addition, Ivan. These problems have been driving me crazy for awhile.

#4
01/07/2011 (11:58 pm)
Logged as THREED-1311.