If there was a way from the GUI to access the item, you could toggle the farm submission flag on the item for all tasks instead of doing it at the task level. Unfortunately we didn’t consider that scenario when we wrote the create/set/get methods for the GUI update method and we’re only passing in the settings of the task and not the item associated to it like we do for other methods.
I’m afraid that right now there is no clean way to do this. Fortunately, we can always hack something with Python, right?
Let me preface this that I haven’t tried this personally, so I might get some of the details wrong.
When the FarmWrapper plugin’s
accept method get’s called, the settings and items are passed in. Maybe you could update a dictionary inside your plugin that maps settings to items, so this way you have a reference back to the item associated with the settings. Don’t forget to call the base class at the same time.
Then inside the GUI code, you will be able to resolve the item associated with the settings and toggle the flag at the item level, modifying the flag for all tasks under the item.
You’ll also need to update the logic inside
FarmWrapper._is_submitting_to_farm to check for the
Submit to Farm flag on the item instead of on the task.
Finally, since the
render_node.py, script won’t be able to tell if a particular task is using the
FarmWrapper, so you’ll need to store a hint in the settings of those task that basically says “If I’m present, then check if the item has the farm toggle set”.
For the logging, I’m assuming that you are talking about the logging you usually get in the GUI, is that it? Yeah, unfortunately it seems like this logging does not get logger in the Toolkit logs. Once again, .
EDIT: Oh actually, there might be a solution to that logger problem. The publish manager object has a
logger property. You could add a handler on it that simply routes logs back to the
sgtk.LogManager().root_logger. The output might be a bit messy tough.
Let us know if this works!
PS: I’m in no way recommending that this becomes the official way to do this. We’ll see if we can make this more simple in a future release of the publish app.