Hi all
We have a multi root setup where one root is a local drive on each artists machine that we are using for a perforce integration
Is there anyway to disable the path cache syncing on the secondary root until publish time? We only use this secondary root to copy publish files that already exist on our primary root in the entity structure into a connected perforce depot.
I am having issues with the whole schema being created all the time when I just need a small part of it on that root
It sounds as though its not so much that you want to disable the path cache, (the way in which we record what folders have been created and what entity they are associated with), but more that you want to limit when and what folders are created in the secondary root, is that right?
Indeed that is the case, ideally I’d I only create the folder structure when I publish to a specific set of tank templates rather than sync all the time whilst working on the workfiles
Setting the defered_creation setting on your secondary root schema folders, and calling the folder creation via the API from your publish hook and providing what ever custom string you used to defer the creation with should work?
I will have a go, these are mainly hooks for tk-multi-publish2 in Houdini and Maya atm
I have deferred creation enabled lower down the schema but not at the project and not filtered by app - I’ll give it a go now
In terms of the second issue - can I stop the entire schema being generated when I am interested in one template structure only?
All of my publish scripts to this root already use the tank utility to ensure folders exist
Toolkit will only create the folders that can be created given a context and fulfil the rules.
Which is to say if you create the folders for a shot, you should only get the folders for that shot and no other shot, unless you have create_with_parent set to true on the shot folder, in which case all shots will get created when the sequence does.
By default step folders are set to create with their parent, so if you have a step folder in the secondary root, then make sure you set them to create_with_parent: false.
Also in your secondary root, avoid having static folders underneath your dynamic ones, and have your script generate the path using the template and ensure that the remaining folders not covered by the schema exist.
For example your schema might go: {root}/sequences/{Sequence}/{Shot}/{Step}
and will have no sub static folders, and your template would be sequences/{Sequence}/{Shot}/{Step}/publishes/maya/{name}_v{version}.ma
So your script would ensure it created the /publishes/maya/ bit.
Alternative approach
Or another option would be to just have a secondary root folder and no sub folders. Then you can use the template to build the path and you can ensure that the folders are created. However there are two catches here:
The folders won’t be registered in the path cache (other than the root of the secondary storage) which means you won’t be able to derive context from the paths.
You won’t be able to use Context.as_template_fields to generate the field values for resolving the template keys. You would manually have to generate the key values your self, or you could generate them based on a matching template on your primary root and then apply them to your secondary root template.
Aha! That makes total sense now. Losing the ability to determine context is an acceptable tradeoff for my requirements as I already have a full asset structure on primary