Tell awd to play a vertex animation

Software: Away3D 4.x

drbii, Member
Posted: 02 June 2014 05:33 PM   Total Posts: 72

Ok I have an awd that has two vertex animations in it.  One is the idle state: “idle” and the other makes the eyes blink:  “blink”.  I want to push a button on the keyboard and make the eyes blink but I can’t get the states to play.  I know the states are there because I can play them in awaybuilder.
I think I have tried every example online but most are older versions and obviously I am doing something wrong.  Anybody have a clear example of what to do. 

Thanks for your help!

   

drbii, Member
Posted: 14 June 2014 11:36 PM   Total Posts: 72   [ # 1 ]

In Prefab I have created vertex animation nodes and saved a md2 file.
I open the md2 in away builder and the animations are there (the four animation states that I created in prefab).  I add a vertex animator in away builder and apply that to the mesh object.  Save it as an awd and load it in my flash builder project. 
I cannot get the states to play.

mesh.play(“qfour”);  does not work

What am I doing wrong?

See the attached screen shot of my model in away builder.  You can see my mesh (“mesh”), vertex animator and animation states. 

 

File Attachments
away3dvertex.tiff  (File Size: 151KB - Downloads: 167)
   

Avatar
Fabrice Closier, Administrator
Posted: 15 June 2014 03:27 PM   Total Posts: 1265   [ # 2 ]

VertexAnimator(mesh.animator).play(“qfour”);

 

   

drbii, Member
Posted: 15 June 2014 10:05 PM   Total Posts: 72   [ # 3 ]

Here is what I have:

...


var mesh:ObjectContainer3D = ObjectContainer3D(AssetLibrary.getAsset(“mesh”));
 
var animator:VertexAnimator = VertexAnimator(AssetLibrary.getAsset (“disc1”));   

if (event.keyCode == 65) {
VertexAnimator(mesh.animator).play(qfour);

}
...


animator is showing up as undefined.

Feel like I [we] are close.

 

   

Avatar
Fabrice Closier, Administrator
Posted: 16 June 2014 08:07 AM   Total Posts: 1265   [ # 4 ]

make sure you the animator is defined (when received on AssetEvent during parsing) and start play the animation, only when you have assigned the animator to the mesh and that entire parsing is done.
Take a look at loading and animation examples on github.

 

   

drbii, Member
Posted: 16 June 2014 01:15 PM   Total Posts: 72   [ # 5 ]

Thanks Fabrice, I’ll do some homework.
  Thanks for your help!

 

   

drbii, Member
Posted: 16 June 2014 11:19 PM   Total Posts: 72   [ # 6 ]

Ok I got it!  Thanks Fabrice!

I have two questions:
Can you play two vertex animations at the same time?  For instance if I have a vertex animation for a left eye close and one for a right eye close can I play both animations at the same time to get both eyes to close at the same time?

and

Can you stop a vertex animation at a frame or percentage during the animation.  For instance if an eye blinks can you stop it at the closed frame?  Can you stop it at 50% closed?

Thanks again to all for your help!

 

   

Avatar
Fabrice Closier, Administrator
Posted: 17 June 2014 09:24 AM   Total Posts: 1265   [ # 7 ]

I don’t think the current architecture would allow this using VertexAnimator. You probably will need to dev a custom “secondary animation” update thingy.

 

   

drbii, Member
Posted: 01 July 2014 09:31 PM   Total Posts: 72   [ # 8 ]

Can skeleton animation do that?  Can you scale or move two bones at once?

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X