We’re going further with the implementation of tk-multi-workfiles2 but I get an field error.
It’s normal since this field value is “open”. It’s a field with user initials and we need to keep it working during transition to fully Shotgun integrated pipeline.
Is there a hook I could call to provide this field value to the app?
Can you give us a little more detail about what you’re trying to do and where it’s falling down? What are the details of the field and how is it being used in Workfiles? What do you mean that the field value is “open”?
We have a guess that you’re trying to use a user initials field in your workfile’s file name, and you’re getting an error because Workfiles is not able to resolve your field from the context? Is that correct?
Because the mapping of file paths to entities in Shotgun comes from the path cache, and path cache entries are generated at folder creation time, based on your folder schema, there is a limitation that you have to an entity/field represented in your folder schema before you can resolve it in a file name.
Unfortunately, this all takes place before any of the Workfiles hooks run, so there’s really no way around it.
I’ve been stuggeling with something similar for the last few days too (sorry I still have no solution)
My company has a very specific naming convention, so I tried and added new keys to the template.yml in the core api, but they won’t resolve unless they are known to shotgun.
Then I added alias: name to one of my keys and a LineEdit appeared on the Save File Window. Similiar with the alias: extension, where a combobox was shown.
So is there maybe a way to add a UI-Element to the Save File Window, whose input gets resolved?
If yes, then maybe this would work for you as well.
A couple of days ago, I solved the issue I had with the save-file window in creating the UI elements needed for our naming convention.
If you (or anyone else struggling with this) are willing to put the effort in, go ahead and add a UI element to the file
python\tk_multi_workfiles\ui\file_save_form.py (I basically copied the name_edit/name_label and adjusted the settings I needed).
than in
python\tk_multi_workfiles\file_save_form.py
you find the corresponding functionality for the UI to work. Again I copied the code used for the name_edit and name_label and fixed every bug that I encountered until it worked.
Than the only thing left to do is to create the field-key in the core’s template.yml and add it to the paths that need it.
Good luck and enjoy the path-preview (It was a great relieve for me, when it had finally shown the path rather than the exception).