MD2 AnimationSequence class disappeared

Software: Away3D 4.x

serge, Newbie
Posted: 05 September 2012 01:35 PM   Total Posts: 6

Hi. I migrate to Away3d 4.0 . But Animation Sequence class is disappeared. But now how i will play some animation state in MD2 mesh ? I need play and stop it. No need to loop it. And i need to add Events . I want to know when animation state complete and what is current frame played.

   

Avatar
Fabrice Closier, Administrator
Posted: 05 September 2012 02:14 PM   Total Posts: 1265   [ # 1 ]

You could start by looking at examples.

https://github.com/away3d/away3d-examples-fp11/blob/master/src/Basic_LoadMD2.as

You could also read doc on http://away3d.com/livedocs/away3d/4.0/

and eventually load and export an md2 to AS3 from Prefab, to see how vertex animations animators are builded. Note that animators package has been improved again (see dev branch) and that some imports and details will be different in the upcomming 4.1.

   

serge, Newbie
Posted: 05 September 2012 05:25 PM   Total Posts: 6   [ # 2 ]
   

serge, Newbie
Posted: 05 September 2012 05:27 PM   Total Posts: 6   [ # 3 ]

Ok.This is my code :

private function onAssetCompleteMy(event:AssetEvent):void
{
if (event.asset.assetType == AssetType.MESH) {
 
      var vertexAnimator:VertexAnimator = new   VertexAnimator(_animationSet);

_mesh = event.asset as Mesh;
   
      vertexAnimator.play(‘name’);
     
      _mesh.animator = vertexAnimator;
  }
 
  else if (event.asset.assetType == AssetType.ANIMATION_SET) {
    _animationSet = event.asset as VertexAnimationSet; 
_animationSet.getState(“name”).looping = false;
 
  }

}


this start md2 object play ‘name’ animation but after end of animation i get
[Fault] exception, information=RangeError: Error #1125: index 11 out of range 11.

what i doing wrong??? Thanks for your answer.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X