collada animation sequence constraints?
by Martin Banks · in Torque 3D Professional · 09/04/2009 (2:12 pm) · 9 replies
I am attempting to import an animation sequence from a collada file exported from Maya. It has 130 frames and is packed with animation keys. When I bring it in as a sequence or stand alone, it gets clipped to 70 frames. When I have it compressed down to 100 frames, it comes into torque at 100 frames.
I have another object that has a corresponding animation that is also 130 frames. However the first 70 of it have no keys at all. When it comes into torque it stays at 130 frames.
Are there some constraints here with collada animation sequences that are causing this clipping?
I have another object that has a corresponding animation that is also 130 frames. However the first 70 of it have no keys at all. When it comes into torque it stays at 130 frames.
Are there some constraints here with collada animation sequences that are causing this clipping?
About the author
#2
There were entire parts of the sequence missing. We tried extending the frame count to see if they might appear, but they were just clipped in relation to the new total frame count.
Eventually, I found that there were some offending animation keys that once removed in Maya then re-exported, quelled the clipping problem. I don't know why they were causing the sequenced to be clipped.
09/21/2009 (11:56 am)
Hi Chris,There were entire parts of the sequence missing. We tried extending the frame count to see if they might appear, but they were just clipped in relation to the new total frame count.
Eventually, I found that there were some offending animation keys that once removed in Maya then re-exported, quelled the clipping problem. I don't know why they were causing the sequenced to be clipped.
#3
09/21/2009 (7:30 pm)
How odd. Was there anything different about those particular keyframes?
#4
In the example from this thread, I have yet to identify why this occured but the offending frames were on the character's left hand, and they were moving , in part, simultaneously with the right. After they finished moving, the right was supposed to continue. However, the clipping occured wherever the left's movement ceased. So it seems that the right's end point governed where the clipping was happening. We removed them, and the animation showed up as expected.
I also have to note that the entire time it looked fine in Maya. We even opened the collada file there, and it showed up as expected.
09/22/2009 (11:30 am)
We have experienced problems with maya animations exported to collada on frames keyed by the skeleton joints as opposed to by locators, and they have appeared in different forms on different models. One consistent pattern that results in a problem is when joints that are keyed closely. Deleting some frames between usually solves this. In the example from this thread, I have yet to identify why this occured but the offending frames were on the character's left hand, and they were moving , in part, simultaneously with the right. After they finished moving, the right was supposed to continue. However, the clipping occured wherever the left's movement ceased. So it seems that the right's end point governed where the clipping was happening. We removed them, and the animation showed up as expected.
I also have to note that the entire time it looked fine in Maya. We even opened the collada file there, and it showed up as expected.
#5
That's very useful to know => means it is definitely something on the Torque import side rather than an issue with exporting the DAE.
Very strange - the frame count in Torque should not depend on how many frames are in Maya. The Torque frame count is calculated as:
numKeyFrames = (animation.end - animation.start) * 30
Where the animation start and end is either specified in the Collada <animation_clip> attributes, or calculated automatically as the smallest and largest of the <animation>s 'INPUT' source values.
Torque then re-samples the animation curves at 30fps to get the node transform at each keyframe.
09/22/2009 (10:51 pm)
I just found a bug in the collada importer to do with animations => could you try the fix here and let me know if the clipping is still happening? Quote:I also have to note that the entire time it looked fine in Maya. We even opened the collada file there, and it showed up as expected.
That's very useful to know => means it is definitely something on the Torque import side rather than an issue with exporting the DAE.
Quote:One consistent pattern that results in a problem is when joints that are keyed closely.
Very strange - the frame count in Torque should not depend on how many frames are in Maya. The Torque frame count is calculated as:
numKeyFrames = (animation.end - animation.start) * 30
Where the animation start and end is either specified in the Collada <animation_clip> attributes, or calculated automatically as the smallest and largest of the <animation>s 'INPUT' source values.
Torque then re-samples the animation curves at 30fps to get the node transform at each keyframe.
#6
Unfortunately that fix did not work for me. I continue to get clipped animations on import.
09/23/2009 (12:24 pm)
@ChrisUnfortunately that fix did not work for me. I continue to get clipped animations on import.
#7
09/23/2009 (2:54 pm)
It seems that if in Maya a character has control curve keys, and joint keys, the joint keys rule the length of the total animation. In other words, if they exist in the animation, when the joint keys are done, during import the rest of the animation is ignored. We solved some problems with the animation clipping by extending some joint keys to equal the duration of curve control keys.
#8
OK - the symptoms were different to what you are describing anyway, but was worth a try.
Your issue sounds more like the T3D collada importer is not calculating the duration of the animation correctly. Is there any way you can send me a DAE file that demonstrates the issue? Completely understand if you cannot, but it makes debugging a lot more difficult without a local test case.
09/23/2009 (10:26 pm)
Quote:Unfortunately that fix did not work for me. I continue to get clipped animations on import.
OK - the symptoms were different to what you are describing anyway, but was worth a try.
Your issue sounds more like the T3D collada importer is not calculating the duration of the animation correctly. Is there any way you can send me a DAE file that demonstrates the issue? Completely understand if you cannot, but it makes debugging a lot more difficult without a local test case.
#9
The problem was that the 'maxEndTime' value was only being calculated using the first animation channel instead of all channels. So if the first channel was shorter (ie. had less keyframes) then the total sequence would appear to be clipped.
10/28/2009 (11:26 pm)
I think I have found the problem here - I just saw it in another model. To fix, just modify the loop that processes the animation channels in ColladaShapeLoader::enumerateScene in colladaShapeLoader.cpp to match the following:for (int iSeq = 0; iSeq < appSequences.size(); iSeq++) {
ColladaAppSequence* appSeq = dynamic_cast<ColladaAppSequence*>(appSequences[iSeq]);
F32 maxEndTime = 0;
for (int iAnim = 0; iAnim < appSeq->getClip()->getInstance_animation_array().getCount(); iAnim++) {
domAnimation* anim = daeSafeCast<domAnimation>(appSeq->getClip()->getInstance_animation_array()[iAnim]->getUrl().getElement());
processAnimation(anim, maxEndTime);
}
if (appSeq->getEnd() == 0)
appSeq->setEnd(maxEndTime);
}The problem was that the 'maxEndTime' value was only being calculated using the first animation channel instead of all channels. So if the first channel was shorter (ie. had less keyframes) then the total sequence would appear to be clipped.
Associate Chris Robertson
I'm not aware of any limit to collada (or Torque) animation sequences that could be causing this, and I have imported animation sequences with over 1000 frames before).
Are parts of the sequence missing in Torque? Or is it just the frame count that has changed? Torque uses a fixed animation frame rate of 30 fps to resample the input animation data, so you won't get the same frame count if you modelled the animation with a different frame rate. There shouldn't be anything 'missing' though since Torque uses the total sequence duration to determine how many frames to generate.