Friday, December 4, 2009

CustomAnimation Class Preview

I've made significant progress on the Augmented Reality game I've been working on, and it is now in a Beta Testing phase on the big screen here in the office!

Decided while I had a free moment, I'd upload the character I created for the game in a model viewer to show how the CustomAnimation Class works.  This is a single .DAE weighing in at around 400k. There are 5 different animation sets on the 3DS Max timeline. 0-25 is the walkcycle, 26-27 is idle, 28-38 is a jump, 39-50 is the landing, and 51-70 is a generic 'working' animation (typing on keys.. ish.)

Clicking the model in the model viewer will call the .nextSequence() command from the CustomAnimation Class. But each Sequence can also be called independently with .playSequence(name).

8 comments:

  1. Hi Revalis, I really impress of what you get out of Away3d ... I'm still learning it. Currently I want to be able to control the animation of a collada that has "walk", "run", "stand" and "jump" animation in a single timeline ... could you please share your code in the above sample? ...

    ReplyDelete
  2. Sure thing. :) Over on the right side of the blog you should now see a 'Downloads' link list. I added it to the list as 'CustomAnimation Class'. Hopefully the comments in the file explain it well enough to get you going, else feel free to ask questions!

    ReplyDelete
  3. Thank you revalis :) ... thank you soo very much :) ... I'm sure it would give me a great leap on this learning :)

    ReplyDelete
  4. Why doesn't this work anymore? It's such a brilliantly simple solution to implementing Collada animation sequences, yet it seems to have been stripped of all functionality.

    ReplyDelete
  5. @Liam, Yeah, unfortunately Away3D 3.5.2 and forward did away with the SkinAnimation class (on which this was based). And I'm not certain what became of it really, but it may have evolved into what is the BonesAnimator Class. Although in comparison, they have very little in common.

    In any case, after upgrading to 3.5.2 I opted not to try and re-create the CustomAnimation class due to time limitations. It was quicker to just adopt the .MD2 format and use its animator; which, admittedly, is rather easy to use. The downside is finding an exporter. And the only I could find was QTip, which will cost you 20 bucks. Although, I think there are others using Milkshape to export to .md2.

    Anyways, glad you liked the CustomAnimation class and sorry it doesn't work anymore. ;) If you need help figuring out MD2, let me know and I can draft up a quick walkthrough of it.

    ReplyDelete
  6. That's very kind of you to offer, but I'm going to play with Collada a little more before I go into MD2. To be honest though, if it were easier to export into MD2 (without paying for it, this is a student project after all) I probably would have started using it sooner.

    ReplyDelete
  7. I think my only real issue is to force Collada to export it's animations into distinctly named loops instead of one long "default" loop. I'm sure I'll figure it out.

    ReplyDelete
  8. Yeah, that's definately the trick. The things you want to focus on are AnimationLibrary, AnimationData, and channels arrays. Maybe it's as easy as Casting the Collada to a Mesh and then using the .addAnimation("blah") and customizing the various elements: http://away3d.com/livedocs/3.6.0_lib/away3d/loaders/data/AnimationData.html
    Then you can use Mesh.animationLibrary.getAnimation("blah").animator.play() to cycle through each. About to go into a meeting, but I may give it a try when I get out. :P

    ReplyDelete