Hi.
I’m tying to do some ‘strange’ stuff with taskMgr and I’m starting to wonder if it’s possible or if I’m just doing it wrong.
The goal is to have two states in the program, with each their own task.
I would like to do something like:
task_list = taskMgr.getTasks()
[ taskMgr.remove(task.name) for task in task_list]
//every task is paused/stop,...
//...other part of the program...
[ taskMgr.add(task, task.name) for task in task_list]
//and everything restart
But If I do that, when I restart the task, it is discarded immediately After a little investigation, I found that task.isremoved() is True, which is probably why that doesn’t work.
I don’t see a way to pause the task.
They do have a pause method, but that seems to return me an another task ? I’m not sure that I understand how that work.
Sounds like you’re using Panda3D 1.5.x or earlier. Have you tried it with 1.6.x? The task manager with that version was completely rewritten. I don’t honestly know whether the new task manager supports re-adding of removed Task objects either, though–it wasn’t part of the original design spec.
thank for the idea tutunkommon, but the scale of the project I’m in is much bigger.
I’m talking about 2-3 application, that work already, to work in a different tab in the same application. With only the tab active having task working.
The whole nearly work now, The task is one of the last thing that I need