Author Topic: AnimationSplitInfo not working  (Read 4084 times)

amirr

  • Jr. Member
  • **
  • Posts: 6
AnimationSplitInfo not working
« on: June 04, 2013, 04:57:18 PM »
I used the AnimationSplitInfo class but it didn't work
Here's the initialization for AnimationSplitInfo

and this function return "0" and so i can't change the animation.

So any advice ?

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: AnimationSplitInfo not working
« Reply #1 on: June 04, 2013, 05:22:46 PM »
For skeletal animation (as specified in javadoc), works as expected.
Md2 have morph animation and obviously there isn't any skeleton to split.

amirr

  • Jr. Member
  • **
  • Posts: 6
Re: AnimationSplitInfo not working
« Reply #2 on: June 04, 2013, 05:38:42 PM »
So in MD2 and using morph animation, How to animate a certain number of frames and after awhile play another number of frames ?

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: AnimationSplitInfo not working
« Reply #3 on: June 04, 2013, 05:49:10 PM »
For morph animation, it's straightfoward:

Create a new Animation object and set the name, start, end, speed fields as wanted. Add the animation to the model using addAnimation. You can now play that animation when you want.
When it's complete, you can play any other Animation.

You can do all of that in the viewer from the animation tab of the model panel. There's a popup in the animation list to add/remove anims.
« Last Edit: June 04, 2013, 05:50:26 PM by jerome_j »

amirr

  • Jr. Member
  • **
  • Posts: 6
Re: AnimationSplitInfo not working
« Reply #4 on: June 05, 2013, 01:50:10 PM »
I did what you had said and I've a problem.
Here's the animation sample:

  • if i set "start" greater than 0 it didn't animate.
  • is "start" and "end" for frames ? because if i set specific frames at start and end it ignores the values and repeat all the frames.
  • whatever the value i set for "loop" it didn't loop
  • what the unit for "speed" and "loopDuration" ?

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: AnimationSplitInfo not working
« Reply #5 on: June 05, 2013, 02:04:33 PM »
Start/end/loop/loopDuration units is seconds. Start/end/loop are times in the morph animation keyframe, whereas loopDuration is a duration. Speed has no unit and scale the time to play faster or slower the animation.

Start/end being the time of the first/last frame of the animation. Speed is by default 1 to play at regular speed. Loop is the loop time, the animation is rewinded to that time when it reaches end. Loop is enabled when the value is in the range [start;end[. LoopDuration is by default 0 to instantly go from end to loop, specify a duration in seconds to have a smooth interpolation between them (if needed).

You can take as reference the values from the default animation of your model, and adjust the start/end values for your new animation.
« Last Edit: June 05, 2013, 02:09:45 PM by jerome_j »