Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialog to choose from multiple template files per task in wrap #6

Conversation

kalisp
Copy link
Member

@kalisp kalisp commented Jul 15, 2024

This PR adds possibility to assign multiple Wrap templates for single task, as it is recommended to split Wrap logic into more workfiles for technical reasons.

This functionality is configured in ayon+settings://wrap/multiple_templates_per_tasks?project=ayon_test where multiple steps could be configured for profile of task name and type.

image

If matching profile is found during start of Wrap, artist is shown simple Workfile app that shows

  • list of configured templates in left column
  • existing workfiles created from this template
    App allows creation (copy of template to workarea) of new workfile, or selection of any existing workfile.
    image

This functionality is not required, if single workfile template per task is enough, ordinary ayon+settings://wrap/workfile_builder?project=ayon_test should be used.

kalisp added 21 commits July 11, 2024 14:11
Checks if current context has configuration for multiple templates. If not it skips Workfiles tool.
Will be used in Workfiles tool to get templates.
I prefer simpler interface for the tool, profile could be passed directly too, but it seems nicer to run the tool only on the context and let prepare data itself.
Added here as it is depending of multi profiles, `ayon+anatomy://ayon_test/templates/work` would be used even if not multi templates should be used.
`ayon+settings://core/tools/Workfiles/workfile_template_profiles?project=ayon_test` would duplicate tasks that should have multi templates.

It is not expected that there would be need for multiple path templates
Tried to inherit from WorkAreaFilesModel from Workfile app, didn't work. Had to copy and cleaned up code from there.
Workfile app sets env var to propagate new or opening existing workfile.
<_> pattern is problematic for basic formatting and there is no actual field to pass comment in.
Checks presence of workfiles in workarea to set enable state for Open and Create New buttons
launch_args contains old path to workfile, not from Workfile app for multiple templates per task.
Error in filling of placeholder shouldn't stop launching of application.
@ynbot
Copy link

ynbot commented Jul 15, 2024

@kalisp kalisp requested a review from iLLiCiTiT July 15, 2024 16:05
iLLiCiTiT and others added 6 commits July 16, 2024 14:19
…from-multiple-template-files-per-task-in-Wrap

# Conflicts:
#	client/ayon_wrap/api/lib.py
#	client/ayon_wrap/hooks/pre_replace_placeholders.py
After review comment, it should be in Anatomy, added to documentation and switched to pulling and formatting it from Anatomy.
This way it should be safer against circular imports
@kalisp
Copy link
Member Author

kalisp commented Jul 16, 2024

Added documentation PR ynput/ayon-documentation#202

…template-files-per-task-in-Wrap' of https://github.com/ynput/ayon-wrap into feature/AY-5403_Provide-dialog-to-choose-from-multiple-template-files-per-task-in-Wrap
@@ -37,6 +37,9 @@ def __init__(self, launch_data):

project_entity = ayon_api.get_project(project_name)

# template name in Anatomy
self.wrap_template_name = "wrap_multi"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you've already change it to use anatomy then use get_workfile_template_key to determine which should be used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow is applicable only for specific profiles, to be able to use Anatomy, I would need to duplicate that logic there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand, you are using anatomy, but also hardcoding template name... You should not hardcode template name, you should use whatever is defined in workfile settings, and studio should add the template (they should be able to name it whatever they want) and add it to profiles for wrap host.

iLLiCiTiT and others added 10 commits July 16, 2024 23:15
Button state must be refreshed after each template_change.
Proxy model counted it wrong (empty items included).
…template-files-per-task-in-Wrap' of https://github.com/ynput/ayon-wrap into feature/AY-5403_Provide-dialog-to-choose-from-multiple-template-files-per-task-in-Wrap
Co-authored-by: Jakub Trllo <[email protected]>
exec_() should be enough

Co-authored-by: Jakub Trllo <[email protected]>
…from-multiple-template-files-per-task-in-Wrap
No real Wrap host, creator and publish can only run in Traypublisher.
…template-files-per-task-in-Wrap' of https://github.com/ynput/ayon-wrap into feature/AY-5403_Provide-dialog-to-choose-from-multiple-template-files-per-task-in-Wrap
@kalisp kalisp merged commit c717a42 into develop Aug 9, 2024
1 check passed
@kalisp kalisp deleted the feature/AY-5403_Provide-dialog-to-choose-from-multiple-template-files-per-task-in-Wrap branch August 9, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants