passing args to tasks

Not to resurrect an old thread unnecessarily, but I wanted to clarify a point: the “self” argument is in fact still required in the task callback method. It’s actually the “task” argument which is no longer required when you use the extraArgs parameter.

The reasoning is that if you are explicitly specifying the arguments to pass to your task callback function, you don’t need to have the “task” argument automatically passed to your function, which no one liked anyway. The only reason we had the task argument in the first place is to provide a place to hang task-specific data, before we added the extraArgs option.

In your example, the first parameter to turnObjectTask should have been called “self”, not “task”. This first parameter will be filled in with the World object, not the Task object.

Note that you can also use the PythonUtil.Functor class to bind parameters to a function callback anywhere a function callback is expected, even if there is no extraArgs parameter provided.

David