I’m having trouble with the animation blending interface in panda. I’m trying to just use the info I found in the Manual
http://panda3d.org/manual/index.php/Actor_Animations
To start with I’d like to have my character play some of its walk animation and some of its talk animation at the same time. My ulimate goal is to smoothly transition between the two animations. (I am not trying to do a multi-part animation where the model does both at the same time).
When I play each animation individually it works fine. When I try to blend them together it just plays the last animation (no apparent blending).
Here’s what I’m trying to do:
myActor= Actor.Actor()
myActor.loadModel("<myModelPath>")
myActor.loadAnims({"talk":"<myTalkAnimPath>"})
myActor.loadAnims({"walk":"<myWalkAnimPath>"})
myActor.enableBlend()
myActor.setControlEffect("talk", 0.5)
myActor.setControlEffect("walk", 0.5)
myActor.loop(talk)
myActor.loop('walk')
The above code just causes the ‘walk’ animation to be played as normal. If I switch the order of the calls to ‘loop’ it plays the ‘talk’ animation normally.
Ultimatly I’d like to fade the animations in and out. I found the following forum entry on this:
https://discourse.panda3d.org/viewtopic.php?t=1054
I tried to set this up as well using the following code:
def crossBlend(actor,fadeInAnim,fadeOutAnim,duration):
fadeInt = LerpAnimInterval(actor, duration = duration,
startAnim = fadeOutAnim,
endAnim = fadeInAnim)
fadeInt.start()
myActor= Actor.Actor()
myActor.loadModel("<myModelPath>")
myActor.loadAnims({"talk":"<myTalkAnimPath>"})
myActor.loadAnims({"walk":"<myWalkAnimPath>"})
myActor.enableBlend()
crossBlend(myActor,'talk','walk',4.0)
My hope was that this code would cross fade the walk anim to the talk anim over a 4 second interval. However, when I do this it seems to instantly pop from the walk anim to the talk anim and stick. Increasing the duration to a huge number doesn’t seem to help.
Again, the animations each play fine on their own, I just can’t seem to blend them together or fade them. Has anyone done any of the above recently? Is there somthing I’m missing in the way the animations are exported/created perhaps?
Thanks for any help on this