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

Workfiles tool: Fix work with anatomy templates #237

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Mar 25, 2024

Changelog Description

Workfiles tool uses anatomy templates correctly.

Additional info

The issue was caused by #190 . It did use template string when it should use object and opposite. Added few docstrings and comments.

Testing notes:

  1. Workfiles tool is able to save workfile (e.g. using Save As button).

@ynbot ynbot added size/XS type: bug Something isn't working labels Mar 25, 2024
Copy link
Collaborator

@BigRoy BigRoy left a comment

Choose a reason for hiding this comment

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

Can confirm this fixes this error:

Traceback (most recent call last):
  File "E:\dev\ayon-core\client\ayon_core\tools\workfiles\widgets\files_widget.py", line 253, in _on_workarea_save_clicked
    result = self._exec_save_as_dialog()
  File "E:\dev\ayon-core\client\ayon_core\tools\workfiles\widgets\files_widget.py", line 175, in _exec_save_as_dialog
    dialog.update_context()
  File "E:\dev\ayon-core\client\ayon_core\tools\workfiles\widgets\save_as_dialog.py", line 237, in update_context
    data = self._controller.get_workarea_save_as_data(folder_id, task_id)
  File "E:\dev\ayon-core\client\ayon_core\tools\workfiles\control.py", line 410, in get_workarea_save_as_data
    return self._workfiles_model.get_workarea_save_as_data(
  File "E:\dev\ayon-core\client\ayon_core\tools\workfiles\models\workfiles.py", line 683, in get_workarea_save_as_data
    return self._workarea_model.get_workarea_save_as_data(
  File "E:\dev\ayon-core\client\ayon_core\tools\workfiles\models\workfiles.py", line 310, in get_workarea_save_as_data
    comment_hints, comment = self._get_comments_from_root(
  File "E:\dev\ayon-core\client\ayon_core\tools\workfiles\models\workfiles.py", line 244, in _get_comments_from_root
    matcher = CommentMatcher(extensions, file_template, fill_data)
  File "E:\dev\ayon-core\client\ayon_core\tools\workfiles\models\workfiles.py", line 47, in __init__
    fname_pattern = file_template.format_strict(temp_data)
AttributeError: 'str' object has no attribute 'format_strict'

Tested in Houdini 20.

@iLLiCiTiT iLLiCiTiT merged commit 8a39bd0 into develop Mar 25, 2024
5 checks passed
@iLLiCiTiT iLLiCiTiT deleted the bugfix/workfiles-tool-templates branch March 25, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants