Our rigging lead wants to be able to name a task in the Rigging pipeline step "Whole", "Body", "Face" or "Combine rigs" by just picking it from a dropdown (for reasons). I have admin access, but don't seem to be able to configure the 'task_name' field to be a list instead of text. So instead we've settled for naming all Rigging tasks "Rig", adding a column called 'Subtask' (code 'sg_subtask') to the Rigging step, and making that a list with the desired values.
Unfortunately, this means over in Maya, the Shotgun File Manager ends up with say 3 tasks associated with a given asset that all just say "Task: Rig". Instead, I want those with subtasks to say something like "Task: Rig, Subtask: Body" so the artist knows which one they're loading into the scene.
I've located the process_result(self, result) method in task_browser.py and altered the way that particular display string is concatenated.
# figure out the name to display for the task
task_name = "<b>Task: %s" % d.get("content", "") #where d is extracted from the results param a bit higher up
subtask_name = d.get("sg_subtask", "")
if subtask_name != "":
task_name += " Subtask: " + subtask_name + "</b>"
else:
task_name += "</b>"
But of course it turns out that d does not contain the sg_subtask key. I want to find where results is constructed (ie where process_results is called from) so I can tell it to load in that field too, but I can't seem to locate it in the code. Can you point me to it?
Also, thinking about it now, I'm wondering if I need to decant this somewhow into a hook so that it remains after an app update. Any pointers here also welcome! :)