Initializing work directory and set up "Extra work folders" for custom application

I would like to be able to launch a custom application (which is not a supported integrated host currently) via OpenPype.

For this you can set up a custom Application in System Settings: applications/additional_apps.

Now whenever a user launches this application I’d like to still create a relevant work directory and specificy “Extra work folders” for that particular application. It seems that project_settings/global/tools/Workfiles/extra_folders is focused on hosts filtering and not applications filtering and thus cannot be defined for custom applications.

Additionally - the custom application also does not create the workdir - even though I would like that to happen. Is there any way I can get this to work?


If not possible currently, does it make sense to for custom applications add a checkbox under the Application that says:

  • Initialize work directory on launch [yes/no]
  • Initialize work directory using host name [xyz]

Then additionally also in project_settings/global/tools/Workfiles/extra_folders also allow Extra work folders (for when work directory initializing is enabled for the application) for these extra folders to also get generated if the filtering is True - and then add a “Applications” filter there which can also filter to the custom applications.

Any thoughts?


Purely as an example:

  • I want to add Zbrush as a custom application, when the user launches it I want a work directory to get created including some extra work folders related to their Zbrush work - even though Zbrush currently is not (yet) a supported integrated host.
2 Likes

Hello,
I was checking un answered posts, and cam across this one. I hope I’m not too late. :sweat_smile:


Another example: PureRef

In this post: Robert thought about using arguments related to PureRef to save in a custom path on opening. (I didn’t manage to make it work. but… I started to realize something)


When I used to use Prism… It had something called empty workfiles / workfiles presets
where prism does a simple trick:

  1. Copy that file into the target location with the proper naming and version.
  2. Open That file.

I think we can adopted such a simple solution in which we rely on the OS it self to copy/open the app in the correct directory.
Maybe something like:

  • If Template workfile per variant is empty fall to the main template workfile.
  1. if any of wokfile templates are presented:
    • add image
  2. if skip is enabled it works as usual (or jump to 4)
  3. if it’s not enabled. check if there are any files, open the latest
  4. if it’s not enabled, and there are no files
    • get the workfile location and name (task directory/workfile_name_template_version)
    • copy workfile template to the task directory, replace the template file name with (task directory/workfile_name_template_version)
    • open the file with the given executables.
2 Likes

I think it’s an interesting approach - there may be some applications that do not take the workfile just as argument but might need an extra flag like -file or whatever, but it’s rare and we can tackle that when we hit that I suppose.

Admittedly the “Workfile Template Path” will need to somehow be transferrable to other ‘sites’ maybe? Although again, that can be considered a more advanced topic for later.

At the very least it sounds like we could use a global prelaunch hook to implement a “Additional Applications” ‘workfile’ support. It could also be by just specifying an Ayon specific environment variable in the global environment like AYON_CREATE_WORKDIR_ON_LAUNCH=1 and AYON_WORKFILE_TEMPLATE=/path/to/template maybe to create the first file?

Anyway, lots of directions to go - but I like the idea!

1 Like

I think the same applies to the icon :thinking: