Link instead of copy in traypublisher

So i would like to have an option in the trayPublisher to just link/publish the files. Without copy-ing them, but just publish the original files as a link.
I’ve got some renders that are already at the correct location with the correct naming convention, i just want to link (and prefer create a preview) from them.
This is not something that’s fully pipeline dev worthy, but in some cases can be really helpful for jobs that just require an out of the box quick solution.

How are others dealing with this issue?

Actual hardlinks (e.g. Python’s os.link) have been very hard across Windows - and hence the usage in AYON itself has been limited and found a lot of push back. Also many less technical people aren’t that knowledgeable about the behavior of linked files (specifically that editing the source file, basically also edits the published file since they link the same underlying file system data).

The File Transactions used by the Integrator technically allow hardlinking still but I don’t believe nothing actually sets that mode.

Anything in instance.data["hardlinks"] would be hardlinked however, that’s not the case for files of the representations, only for resources. There currently is no global toggle to switch representations to use hardlinking instead of copying.


If instead of generating a published filepath, you can also publish using {originalBasename} or something like that in the publish template - so that the publish destination is basically the source file. @mustafa_jafar do you have more details for that? But that’d basically register the publish at the source file’s path and avoid the copy.

All sounds reasonable indeed, and the balance between fool proof and usability is on the edge here.
We’re now just putting it in a temp spot and then publishing it to work around this.
You just can get a lot of duplicated data, which is also not always a nice thing

And the little trick with {originalDirname} \ {originalBasename} doesnt work as it cant write on top of the source (or at least didn’t work at this end :wink: )