Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Workfiles: Support more workfile templates #1966

Merged
merged 19 commits into from
Aug 31, 2021

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Aug 26, 2021

Goal

Be able to use different work template defined by host name and task type.

Changes

  • added settings to project_settings/global/Workfiles where are added workfile template profiles
  • added new enum anatomy-templates-enum which shows available template keys
  • implemented 2 new functions that return template key which should be used for passed context
    • "get workdir" functions are using that functions if template key was not passed
  • workfile tool has implemented it's own tasks model where are also stored task types
    • is using new functions to get new workdir
Depends on
avalon-core ynput/avalon-core#364

Closes: #246

@iLLiCiTiT iLLiCiTiT self-assigned this Aug 26, 2021
@iLLiCiTiT iLLiCiTiT added the type: enhancement Enhancements to existing functionality label Aug 26, 2021
Copy link
Member

@mkolar mkolar left a comment

Choose a reason for hiding this comment

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

working fine during launch, however in the workfiles tool inside host, I cannot save as in tasks, that don't have specifically defined template

// Warning: openpype.lib.profiles_filtering : None of profiles match your setup. hosts: "maya" | task_types: "Modeling" // 
# Traceback (most recent call last):
#   File "C:\Users\milan\code\openpype\openpype\tools\workfiles\app.py", line 722, in on_save_as_pressed
#     self._enter_session()   # Make sure we are in the right session
#   File "C:\Users\milan\code\openpype\openpype\tools\workfiles\app.py", line 581, in _enter_session
#     api.update_current_task(asset=self._asset, task=self._task_name)
#   File "C:\Users\milan\code\openpype\repos\avalon-core\avalon\pipeline.py", line 1435, in update_current_task
#     Session, task=task, asset=asset, app=app
#   File "C:\Users\milan\code\openpype\repos\avalon-core\avalon\pipeline.py", line 1412, in compute_session_changes
#     app
#   File "C:\Users\milan\code\openpype\openpype\lib\avalon_context.py", line 437, in get_workfile_template_key
#     "`get_workfile_template_key` requires to pass"
# ValueError: `get_workfile_template_key` requires to pass one of 'project_name' or 'project_settings' arguments.

in this case I can save file on lookdev task, but not on modeling
image

@iLLiCiTiT
Copy link
Member Author

working fine during launch, however in the workfiles tool inside host, I cannot save as in tasks, that don't have specifically defined template

Should be fixed now. I forgot to switch 2 arguments in avalon-core.

@mkolar mkolar self-requested a review August 31, 2021 16:38
@iLLiCiTiT iLLiCiTiT merged commit efb111e into develop Aug 31, 2021
@mkolar mkolar deleted the feature/multiple_workfile_templates branch September 17, 2021 22:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

anatomy multiroot workfiles per task
3 participants