AWD2 and skeletal animation

Software: Away3D 4.x

mytoaster, Newbie
Posted: 04 August 2011 06:37 PM   Total Posts: 3

Is there a working example of how to do this?  It appears that the mesh, skeleton, and animation are exported into the awd file using a sequences.txt file.  But when I load it into a Loader3D, what do you do with it from there?  I tried creating a SmoothSkeletonAnimator but the mesh’s animationState was null when loaded.  Any thoughts would be greatly appreciated.

   

John Brookes, Moderator
Posted: 04 August 2011 08:27 PM   Total Posts: 732   [ # 1 ]

If your skin was called “polySurface1”
And your root joint “Root” (notice down there its Root.1)
And the animation “Walk”

myMesh AssetLibrary.getAsset('polySurface1') as Mesh
view
.scene.addChild(myMesh);

var 
skel Skeleton;
var 
_anim SkeletonAnimation;
var 
_skel_ctrl SmoothSkeletonAnimator;
var 
_state:SkeletonAnimationState

skel 
Skeleton(AssetLibrary.getAsset('Root.1') as Skeleton); 
trace(AssetLibrary.getAsset('Root.1'))
_anim = new SkeletonAnimation(skel3true);
_state = new SkeletonAnimationState(_anim);

_skel_ctrl = new SmoothSkeletonAnimator(SkeletonAnimationState(_state));
_skel_ctrl.timeScale 1//speed
_skel_ctrl.updateRootPosition true

_skel_ctrl
.addSequence(SkeletonAnimationSequence(AssetLibrary.getAsset('walk')));

myMesh.geometry.animation _anim;
myMesh.animationState _state;

_skel_ctrl.play('walk'

This is something Richard gave me a bit ago.. just tested and still works ( for me)

   

mytoaster, Newbie
Posted: 04 August 2011 09:11 PM   Total Posts: 3   [ # 2 ]

Thanks so much!  I put this in and everything seems to be loading fine, and calling play on the controller doesn’t error, but the animation doesn’t play.  there used to be an awd2 bindtest example in the incubator branch, but it seems like a lot of things have been restructured since then.

   

John Brookes, Moderator
Posted: 04 August 2011 09:53 PM   Total Posts: 732   [ # 3 ]

Not usre if you have done this, but the sequences file needs to be something like

# Maya AWD exporter sequence definition file.
#
# Lines beginning with the pound sign will be regarded as comments
# and ignored by the exporter. All other lines are assumed to define
# sequences in the timeline, using the following format
# <name> <start_frame> <end_frame>
#
#
walk 2 74
#waveOtt 49 64
#wavenormal 65 88 

You put that in the same folder that the awd2 is exported to ( before you export).
Then export from Maya.
That tells the maya plugin what your clip names are.

You can also check the animations by doing

AssetLibrary.addEventListener(AssetEvent.ANIMATION_COMPLETEonAnimLoadComplete);
private function 
onAnimLoadComplete(e:AssetEvent):void 
{
 trace
("onAnimLoadComplete "+e.asset.name);

Other than that, not a clue wink

   

mytoaster, Newbie
Posted: 04 August 2011 10:15 PM   Total Posts: 3   [ # 4 ]

Ok it works! Stupid issue on my end. Last question, currently there’s no gpu skinning right?  I try turning off force CPU and it doesn’t like it much.

   

John Brookes, Moderator
Posted: 04 August 2011 10:22 PM   Total Posts: 732   [ # 5 ]

That I dont know.
Richard Olsson would be the one to know.

   

Richard Olsson, Administrator
Posted: 05 August 2011 12:49 PM   Total Posts: 1192   [ # 6 ]

GPU skeletal animation should work fine. But it requires that you have a low number of joints. The exact number varies depending on what materials you’re using and how many. The reason being that there is only a limited number of constants that can be sent into the GPU shader, and these are shared between animation and material sub-systems.

Honestly though, you should be able to do just fine with CPU animation.

   

Avatar
sebbdk, Jr. Member
Posted: 26 September 2011 11:07 PM   Total Posts: 39   [ # 7 ]

ups wrong thread, please disregard this

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X