VertexAnimator, VertextAnimationSequence in Away3d 4

Software: Away3D 4.x

bakajin, Newbie
Posted: 11 April 2012 02:08 PM   Total Posts: 24

I’m trying to use the VertexAnimator in Away3d 4.

I load a sequence of OBJ files (md5 is no option sadly), containing the shapes geometry.

I was using http://abiyasa.com/blog/2010/05/20/vertex-animation-with-away3d/ as a starting point.
But it looks like also the VertexAnimator has been completly revamped, for the better it looks like.

Anyway, after loading the objects and setting a seperate namespace (shouldnt one really set AssetType?).
In an onAssetComplete event handler I now call :

if (event.asset.assetType == AssetType.MESH && event.asset.assetNamespace == "shp"
 
{  
  
var shp Mesh event.asset as Mesh;
       
  
ShapeAnimation = new VertexAnimator(Model.animationState as VertexAnimationState);
      
  
ShapeSequence = new VertexAnimationSequence("unfold")
  
ShapeSequence.addFrame(shp1);
      
  
ShapeAnimation.addSequence(ShapeSequence);
      
 

However this throws me;
1195: Attempted access of inaccessible method addFrame through a reference with static type away3d.animators.data:VertexAnimationSequence.
An error I don’t understand, should I be using _frames instead?

Sorry for the messy code, I am in the fase of trying to figure this out.
Plus, I guess i should call addSequence() only after i’ve added all the frames really.

Any clues from the gurus?

   

Avatar
kurono, Sr. Member
Posted: 11 April 2012 03:10 PM   Total Posts: 103   [ # 1 ]

Method “addFrame” isn’t “public”, so compiler treats it as inaccesible when tried to use it. But “addFrame” belongs to “arcane” namespace and can be used within it. So, try to include “arcane” in your main class.

   

bakajin, Newbie
Posted: 12 April 2012 12:21 PM   Total Posts: 24   [ # 2 ]

Thanks a bundle,

exactly what i needed and also found out after some more digging.

use namespace arcane

at the top of my Main class seems to have fixed any problems leading to this error.

My incompentence and the scarce documentation on the vertexAnimator and such in away3d 4, will most likely yield an expansion of this thread.

Please stay tuned wink

O.

   

bakajin, Newbie
Posted: 13 April 2012 02:41 PM   Total Posts: 24   [ # 3 ]

Moved my last post to a new thread.

As it was really a new question.

pls refer to:
        thread: 2332 (poses, how to set for VertextAnimator or VertexAnimationState)

Thanks

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X