ayon-core
ayon-core copied to clipboard
Make customizing workfile template during project usable with existing workfiles
Is your feature request related to a problem? Please describe.
For a long running project we noticed that the workfile template that we're using generates insanely long filenames in some cases and as such we want to change the template. However, doing so would break workfiles tool for any assets that had been worked on because original files had a different template and thus wouldn't be detected as existing versioning using the new template.
As such, when saving a new version the tool would think it needs to create a version 1.
Describe the solution you'd like
I was thinking that whenever changing the template or whenever generating the first workfile on an asset (or even task) that it could store the asset's workfile template so that by then it's locked for that asset. It'd be similar to how a publish stores it template with the representation, etc.
OR:
Another approach could be that instead of storing it on the Asset is to register workfiles in the database and to store the templates there with the registered workfiles, and then when detecting existing workfiles in the Workfiles tool to query against files on disk but also those in database. This could make it so that the template changes midway for an asset however - but still version detection is as expected.
Describe alternatives you've considered
Alternatives:
- Don't change the workfile template. :)
- Change the workfile template and update all existing workfiles using a python script to adhere to the new template. (Hacky, but not impossible)
Additional context
This could be a feature request of which we could say: "Don't change the template after production started." Which in a way I guess is also a decent way of looking at it. Do it right, right away. :) The complexity in logic/code that might come from having a different workfile template per asset should be worth whatever this would solve and maybe it isn't.
[cuID:OP-5261]