Check if the interval/sequence/parallel with the given name is currently playing?

I could track this with my own code, but since Panda asks for names for every Interval/Squence/Parallel you set up, I’m guessing it’s keeping track of them already.

So is there a way to check? I know tasks are handled by a Task Manager, but intervals/sequences/parallels it seems you have to just create an object for and run them by calling their method, not assigning the object to some manager.

So is there a way to query for an interval/sequence/parallel of a given name and check its state?

You could call base.ivalMgr.getIntervalsMatching(pattern) to get a list of the interval objects matching a given string name. (They are not required to be unique, so there may be multiple.) Then you can query isPlaying(), isPaused() or isStopped().

Thank you. It’s my fault that I somehow missed IntervalManager in the API reference. That said, it’s strange it is not mentioned anywhere else, especially that the default one is base.ivalMgr.

Fair enough, I’ll put a note in the manual.

1 Like
from direct.showbase.ShowBase import ShowBase

base = ShowBase()

base.ivalMgr

AttributeError: 'ShowBase' object has no attribute 'ivalMgr'

Sorry, I was mistaken, it is:

from direct.interval.IntervalManager import ivalMgr

Seems to also be imported by IntervalGlobal.
I feel like the object should be created in base. It makes sense, all other managers are there.