Copying files to production storage on publish

Hi,

I’m looking at replacing various incarnations of asset libraries here (eg. models, HDRs, comp elements) with one based on Shotgun. I’ve created a ‘library’ shotgun project and made modifications to the tk-multi-loader app config so that publishes from the ‘library’ project are accessible in all other projects, as described here.

Potential advantages of this are:

  • Good integration with host DCC apps, with tk-multi-loader
  • Easy cross platform publishing with standalone publish app (eg. producers on Macs can publish easily alongside vfx artists on linux)
  • Thumbnails, categorisation, searching in Shotgun web interface

One missing piece of the puzzle though is that when publishing files through the standalone publish app, it just creates a Published File in shotgun, which refers to it’s original location on disk wherever that is (could even be someone’s desktop).

What I’d really like is to be able to copy a file to the production storage for the ‘library’ project, organised nicely on disk in asset folders according to the categorisation in shotgun. That way it would be very easy for people to add things to the library, and dramatically reduce the barrier to entry for creating a good library. This would also be useful easily publishing per-project reference material that often comes out of emails.

Has anyone written a publish plugin to copy files on publish that they could share? It would be great if there was (optional) functionality for this sort of thing built in to shotgun. Otherwise I guess I’ll have to re-invent the wheel…

3 Likes

Hi Matt. I implemented a publish file hook for tk-multi-publish2 that does a copy instead of an “in place” publish of the input path like you described. I’ve attached a copy for reference although I wouldn’t recommend using it verbatim since there’s layers upon layers of hacky mods we’ve put in for various reasons. They key takeaway is that the stock publish_file.py that comes with tk-multi-publish2 already has copy functionality built-in provided you’ve defined a work template and a publish template and the input path happens to match the work template. In our case, since we want to support publishing of arbitrarily named data from anywhere regardless of naming convention, our hook removes the dependency on the work template and constructs all the keys from the user-supplied task instead.publish_file.py (20.4 KB)

6 Likes

There’s also this custom toolkit app developed by the Griffith Observatory team that might be of use to you:

I’ve not had a chance to eval it myself, but it seems pretty well thought out and might fit your needs.

4 Likes

Thanks very much nico, that should be quite helpful! Most appreciated.

6 Likes