Animation isn't smooth when change animation's playrate.

Hello everyone.

I have some problem that I stuck it to long.
I try to adjust the play-rate of animation.

Example I has 3 animation , 80 frame for each other.
(The code like this)

self.boy = Actor("boy.bam",		
		{'stand' :"stand.bam",
		 'walk' :"walk.bam",
		 'attack' :"attack.bam"})
self.boy.loop('stand')

It play every animation smooth normally.
but when I try to increase or decrease the play-rate.

	self.boy.setPlayRate(1,'stand')
	self.boy.setPlayRate(0.5,'walk')
	self.boy.setPlayRate(2,'attack')

The stand animation is smooth but another two are lack (must fogus to see).
If I set to

self.boy.setPlayRate(0.1,'walk') 

I will see a very lack animation.
I try to make a very long frame animation such as 400 frame for 1 animation and play at 1 playrate but result is the same.

I wondering Is there anything I shoud add to play a very slow smooth animation?
I fogus at show slow motion acion game.
(Like Batman arkham asylum.)
Any idea?

sorry for my English. :blush:
Thank you.

Put this in Config.prc:

interpolate-frames #t

Hello.
Thanks for your reply.

But it’s still not work.(I use panda3D-1.6.2)
I test by add setPlayRate as the code below.

self.ralph = Actor("models/ralph",
        {"run":"models/ralph-run",
         "walk":"models/ralph-walk"})
self.ralph.reparentTo(render)
self.ralph.setScale(.2)
self.ralph.setPos(ralphStartPos)
self.ralph.setPlayRate(.1,'run')

When the ralph is running it’s not smooth.
Any idea?

Thank you.

That should have fixed it. Perhaps it didn’t read your config variable setting, for instance because you spelled it incorrectly, or because you modified the wrong Config.prc file?

Another way to achieve the same thing is to make the call:

self.ralph.setBlend(frameBlend = True)

David

I dont know why it doesn’t see the config file.

But your solution setBlend solve my issue.

Thank you very much!! :astonished:

I remember seeing in the manual that the PRC value will only effect eggs that have yet to be cached. So likely you weren’t seeing it working with the config value because the egg was already sitting in the modelcache.

The setBlend option works regardless of modelcache status.