Tk-multi-workfiles2 published files with multiple templates

Hi everyone !

I modified the tk-multi-workfiles2 to be able to choose between multiple templates instead of just specifying one work and one publish templates.

I did that by adding a qComboBox to the UI and using it’s index to change the workArea used templates (and modified settings on tk-config and app.yaml file to create my multi-template system).

The templates switch works fine and everything is working the way I want for the work files.

BUT, it doesn’t work for the published files.

Test 01

  • I open the open UI

  • I use my first template (qComboBox index 0)

  • I choose my task

  • Everything is ok, the related published files appear.

  • I choose my second template (qComboBox index 1)

  • I still see the published files related to my first template

Test 02

  • I open the open UI

  • I use my second template (qComboBox index 1)

  • I choose my task

  • Everything is ok, as I don’t have publish related files

  • I choose my first template (qComboBox index 0)

  • Everything is ok, the related publish files appears

  • I choose my second template again (qComboBox index 1)

  • I still see the published files related to my first template.

I tried to use the filter_publishes.py hook with a template_path.validate() and it changes nothing. And I saw that the same action occures in the _filter_publishes of the file_finder.py.

It’s like if the publishes were loaded once in the UI, they’ll always be there… no matter the change of template etc.

Do you have any clue on how to get rid of that ?

Sincerly,
Tristan LG

2 Likes

I find a way to do it by getting the publish_file_type of my publishFiles.
As they’re corresponding to a part of my templates, I managed to filter the display of my files by doing a simple comparison between the template I want to see and my file publish_file_type.

1 Like