Game Development Community

T3D 1.2 - Animation Threads/Blending Issues

by Nathan Bowhay - ESAL · in Torque 3D Professional · 11/26/2012 (12:35 pm) · 0 replies

I am updated to the latest official MIT release (none dev). I have added some console functions for getting number of animations in a model and some other stuff like that. I wasn't sure if I should put this here, in discussion or as a ticket on the github. I will probably end up making a ticket as well and linking to this.

Build: 1.2 (guessing previous versions even back to TGE since this code hasn't really been touched).

Platform: Windows 7 64-bit

Target: Script calls, Animation threading/blending.

Issues: I have a model with several animations (5):
  1. Jacks - 4 jacks, two on each side (think like a car and located by the 4 wheels), move from up to down
  2. Wheels - 4 wheels spin at the same time and same rate
  3. Vertical - crane neck moves from down to up
  4. slideA - part on top of crane neck moves from backward to forward
  5. slideB - part on top of slideB moves from left to right
From an art standpoint here is how it is laid out:
Vertical Lift: 19 bones 1 node keyed 30 objects total affected by transform (including children)
Wheels : 4 nodes keyed and total.
Jacks: 4 Nodes keyed and total.
slideA: 8 nodes keyed 9 total (including 1 child).
Slide B: 1 node keyed and total.

I made a gui in which it has 4 drop downs and then a slider next to each of them (I could probably post the code for it, it's pretty simple, if need be). The dropdowns are populated with the animations (names) available for the model. When you select an animation it calls:
%selected.playThread(%thread, %animName);
%selected.pauseThread(%thread);
where %selected is just a the selected object (ShapeBase) in the scene, %animName is the selected animation name, and %thread is the thread that dropdown pertains to. So the first one is 0 the last one is 3 since torque supports 0-3 (4) animation threads.

The slider next to the dropdown then sets the thread position (0-1 float).

Now here is the BUG. If I select 4 animations and move the sliders most of the time one will not do anything. What one it is usually depends on the order I selected the dropdowns. I can fix one by re-selecting the dropdown, but that will usually mess another one up. Sometimes things like on 1 of 4 wheels will move when dragging the slider for wheels. So it seems to be an issue with not just thread blending but actually some thread blending node limit or something.

As you can see from the model layout none of the animations share a thread, so there shouldn't be anything complicated going on.

Steps to Repeat:
1. Launch the game
2. Call playThread, pauseThread on jacks using thread 0 on a ShapeBase object (or select the first dropdown)
3. Call playThread, pauseThread on vertical using thread 1 on a ShapeBase object.
4. Call playThread, pauseThread on slideA using thread 2 on a ShapeBase object.
5. Call playThread, pauseThread on slideB using thread 3 on a ShapeBase object.
6. Call setThreadPosition on a ShapeBase object, passing each part several different values between 0-1 for each thread going from 0 - 3 (or start dragging the sliders).
7. You will notice slideA does nothing but all the others do something.
8. In this case if I reselect the slideA from the dropdown (call make the play pause calls) it will fix them all.
9. Now if I select wheels from the first dropdown (to change from jacks) everything except slideB works
10. If I continue to select dropdowns for animations that aren't doing anything until the wheels appear to not work then I look and only 1 wheel is rotating.

I am guessing you can do different combinations of the steps to get different results and use a different set of animations and get the same thing. We had another model we used for testing with just a bunch of animations for some blocks moving in different directions and go the same issue.

Let me know if you need any more info or some files/models or anything.