I want to send notifications to artists when a publish for a related task happen. By related, I mean I'd like to handle these cases:
- an animator publishes a new animation cache for shot XXX => artists assigned to lighting tasks on shot XXX
- a modeler publishes a new model of asset YYY => artists assigned to rigging and lookdev tasks on asset YYY
- a rigger publishes a new rig of asset YYY => artists assigned to animation tasks on shots containing the asset YYY
I'm thinking that this action should happen in the event daemon rather than in the publish tools. Please tell me if you think otherwise!
Next, how to detect that a publish has completed and can be processed? When the primary publish is registered in Shotgun, none of the secondary outputs have been generated. I'd like to know about them so I can send notifications that mention everything that's been published (eg. cache for actor xxx, cache for actor yyy, etc.) There is no "publish complete" event recorded. Also, I can't rely on the fact that the publish would be complete by the time the publish is detected by the daemon because publishes can take a long time (eg. anim cache to generate).
I could add a field in the primary publish that says: this publish contains 2 caches xxx and yyy, but ultimately this will be redundant once the publish is finished.
I thought about a kind of boolean on the PublishedFile to say if it's in progress or complete, and discovered that there's already a "Published Status" field (sg_status_list) , with meaningful entries: in progress, complete, approved. This covers what I want and more!
But shouldn't Toolkit set these values already? I looked at a simple way to set the values, the most logical place would be the post_publish hook in tk-multi-publish, but the hook doesn't receive the shotgun entries, so I would have to do the queries again in the hook to find what has just been published, which I find weird. Shouldn't it be handled directly in the app?
Is there a better way to do all that?
Have you done something similar?