diff --git a/direct/src/task/Task.py b/direct/src/task/Task.py index 49d3a6dd31..c190f96523 100644 --- a/direct/src/task/Task.py +++ b/direct/src/task/Task.py @@ -163,6 +163,12 @@ class TaskManager: # Next time around invoke the default handler signal.signal(signal.SIGINT, self.invokeDefaultHandler) + def getCurrentTask(self): + """ Returns the task currently executing on this thread, or + None if this is being called outside of the task manager. """ + + return Thread.getCurrentThread().getCurrentTask() + def hasTaskChain(self, chainName): """ Returns true if a task chain with the indicated name has already been defined, or false otherwise. Note that