Author Topic: [resolved] changing animation via interaction  (Read 13343 times)

Offline cefengxu

  • int
  • **
  • Posts: 65
    • View Profile
[resolved] changing animation via interaction
« on: December 10, 2015, 10:11:00 am »
hi raft :

i want to implement a feature .
when i touch the object with loop animation-1 , the object must have some respond ( do  another animation-2 ) , and then come back to the original animation-1 after the animation-2 is finished.

how to do that ? i know how to change the animation with model using :
group.animateSkin(index, animationID);

but i do not know how to handle the time of the animation, or does Bones have some simple ways to deal with it ??
« Last Edit: December 11, 2015, 04:37:03 am by cefengxu »

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: [resolving] changing animation via interaction
« Reply #1 on: December 10, 2015, 02:07:30 pm »
there is no automated mechanism for that but you can easily implement one.

you can query the time of a skin animation via SkinClip. (each animation is represented by a SkinClip)

Code: [Select]
AnimatedGroup/Animated3D.getSkinClipSequence().getClip(index).getTime()
here index is zero based so according to your sample, essentially :

Code: [Select]
index = animationID - 1;

Offline cefengxu

  • int
  • **
  • Posts: 65
    • View Profile
Re: [resolving] changing animation via interaction
« Reply #2 on: December 11, 2015, 04:36:02 am »
thanks you ,but seem not so convenient ~~  it work . thanks again raft