Animation blending (interpolation) problem

So I’ve gone through the manual and reference about actors, and tried to make one animation go smoothly into another. There was another thread dealing with this, but it was using enableBlend, which the reference explains, then says not to use - and to use setBlend() instead. So that’s what I did. Combining this with the piece of code given by the other thread (which was never explained exactly what made it work), I got this:

  def move(self, task):

    global animState
    animState = animState
    if (self.keyMap["left"]!=0) and animState != 0:
      self.myChar.setBlend(frameBlend=1,blendType=1)
      interv = LerpAnimInterval(self.myChar, 0.75, "anim2", "anim1")
      #interv.start()
      self.myChar.loop("anim1")
      animState = 0
    if (self.keyMap["right"]!=0) and animState != 1:
      self.myChar.setBlend(frameBlend=1,blendType=1)
      interv = LerpAnimInterval(self.myChar, 0.75, "anim1", "anim2")
      #interv.start()
      self.myChar.loop("anim2")
      animState = 1
      
    return Task.cont

The LerpAnimInterval was used in the other thread, so I tried to implement it here. However, when I uncomment the interv.start() lines, all animation freezes.

Does anyone have interpolation working? Am I on the right track and simply missing a function, or is this done in a completely different way?

Thanks for your time yet again. :slight_smile:

From Actor.setBlend documentation:

However, you didn’t set animBlend = True, you set frameBlend = True instead, which is different:

David

Gah! I misunderstood the frameBlend definition. I didn’t want them to both be playing, I wanted them to transition smoothly. Naturally, this means having them both playing for a certain amount of time. So it (almost) all makes sense now, thanks!