sequence question

A question about sequences (I use Panda 1.4.0):
I have something like this (snippet):

self.myactor = Actor.Actor(

#~ # part dictionary
{"head":"models/head_01_mod
"torso":"models/torso_01_mo
}, 

# dictionary of anim dictionaries
{"head":{"ani1":"models/head
"torso":{"ani3":"models/tors
"ani2":"models/torso_01_ani
})

self.myactor.attach('head', 'to
self.myactor.reparentTo(render)

self.myactor.enableBlend()

i2 = Sequence(self.myactor.actorInterval ('ani2', duration = 3, partName = 'torso'),
LerpAnimInterval(self.myactor, 5, 'ani2', 'ani3', partName ='torso'),
self.myactor.actorInterval ('ani3', duration = 3, partName = 'torso'),
LerpAnimInterval(self.myactor, 5, 'ani3', 'ani2', partName ='torso'),
self.myactor.actorInterval ('ani2', duration = 3, partName = 'torso'))

i2.start()

so what I have found out that the actorInterval is not working with enableBlend() and the LerpAnimInterval is not working with disableBlend(). Is it possible to combine those two Intervals in a sequence then and how?

cheers

mmm, maybe I should explain my problem a bit more elaborate ?

I tried out to sequentially play an actorInterval, then a LerpAnimInterval and then an actorInterval again.

according to this thread :
discourse.panda3d.org/viewtopic.php … iminterval

from direct.directbase.DirectStart import *
from direct.interval.IntervalGlobal import *
from direct.actor.Actor import Actor

ralph = Actor('models/ralph.egg',
              {'walk' : 'models/ralph-walk.egg',
               'run' : 'models/ralph-run.egg',
               'jump' : 'models/ralph-jump.egg',
               })
ralph.reparentTo(render)

# Put Ralph in blend mode, to enable multiple animations at once.
ralph.enableBlend()

# Start both cycle animations running.  They'll play indefinitely, but
# until we call setControlEffect(), they won't have any visible effect
# on Ralph.
ralph.loop('walk')
ralph.loop('run')
ralph.play('jump')

i2 = Sequence(ActorInterval(ralph, 'walk', loop = 1, duration = 3),
              LerpAnimInterval(ralph, 0.5, 'walk', 'jump'),
              ActorInterval(ralph, 'jump'),
              LerpAnimInterval(ralph, 0.5, 'jump', 'walk'),
              ActorInterval(ralph, 'run', loop = 1, duration = 1),
              LerpAnimInterval(ralph, 0.5, 'run', 'walk'))
              ActorInterval(ralph, 'walk', loop = 1, duration = 3))

i2.loop()

run()

For me it seems that it is not possible because if blend is enabled (ralph.enabledBlend()) the actorInterval is not working and without enabledBlend() the LerpInterval is not working.

Am I right or am I doing something wrong?

If I am right, is there some kind of workaround?

thx

Sorry, can’t help you directly.

Just want to ask you to give it some time… some users aren’t here 24/7 - so an useable answer might take some time (hours). :slight_smile:

Regards, Bigfoot29

halfknight, i might understand you wrong, but you can add between the intervals a FunctionInterval in the Sequence: for example:

Sequence(
    Func(actor.disableBlend)    ,
    ActorInterval(stuff)   ,
    Func(actor.enableBlend)    ,
    LerpAnimInterval(stuff)     )

or something like that.

hey thanks @ bigfoot and pro-rsoft
@pro-rsoft: Indeed this is what I am looking for. Seems to work now. :slight_smile: