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

Fix write node creation while broken project Anatomy. #12

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

robin-ynput
Copy link
Contributor

@robin-ynput robin-ynput commented Aug 14, 2024

Changelog Description

Address #9

I Implemented the solution suggested by @BigRoy on the associated issue which makes perfect sense:

  • scoped the anatomy resolve to the required scoped template when creating a Write node
  • No more resolving all templates when we use a single entry

Testing notes:

  1. Set broken Anatomy preset for something irrelevant to the Write node creation
    (note additional ] after variant)
    image

  2. Open Nuke and create a Write node from AYON -> Create

  3. Ensure a write node get properly created despite part of the Anatomy being wrong

@robin-ynput robin-ynput added the type: bug Something isn't working label Aug 14, 2024
@robin-ynput robin-ynput self-assigned this Aug 14, 2024
@robin-ynput robin-ynput marked this pull request as draft August 14, 2024 19:01
@robin-ynput robin-ynput marked this pull request as ready for review August 14, 2024 19:28
Copy link
Member

@moonyuet moonyuet left a comment

Choose a reason for hiding this comment

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

Seems to be a weird bug but looks good in my side. I can create the creator for both prerender and render product type as expected.
image

@moonyuet
Copy link
Member

moonyuet commented Aug 15, 2024

It's good for the merge. One more thing to add, it contributes to other draft PR which is associated to this. (I also tested along with that PR)
It is still not quite working in terms of formatting data for the publish if adding {variant]} if the users use their own custom template to publish the render. It's not related to this PR but you can just mark it as a note.
image

DEBUG: prerenderKey01 is missing reference to staging directory. Will try to get it from representation.
DEBUG: Looking for matching profile for: hosts: "nuke" | product_types: "prerender" | task_names: "compositing" | task_types: "Compositing"
DEBUG: "nuke" not found in "hosts": ['standalonepublisher']
DEBUG: "nuke" not found in "hosts": ['maya']
DEBUG: "nuke" not found in "hosts": ['traypublisher']
DEBUG: "nuke" not found in "hosts": ['max']
DEBUG: Profile selected: {'product_types': ['review', 'render', 'prerender'], 'hosts': [], 'task_types': [], 'task_names': [], 'template_name': 'test'}
DEBUG: Product: prerenderKey01
DEBUG: Resetting dropped connection: localhost
DEBUG: http://localhost:5000 "POST /graphql HTTP/1.1" 200 407
DEBUG: Response <RestApiResponse [200]>
DEBUG: Prepared product: prerenderKey01
DEBUG: http://localhost:5000 "POST /graphql HTTP/1.1" 200 105
DEBUG: Response <RestApiResponse [200]>
DEBUG: Source: {root[work]}/interior_lenny/lenny_bedroom/asset/work/compositing/il_asset_compositing_v004.nk
DEBUG: Creating new version ...
DEBUG: Prepared version: v007
DEBUG: http://localhost:5000 "POST /graphql HTTP/1.1" 200 112
DEBUG: Response <RestApiResponse [200]>
DEBUG: Anatomy template name: test
CRITICAL: Error when registering
Traceback (most recent call last):
  File "D:\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 158, in process
    self.register(instance, file_transactions, filtered_repres)
  File "D:\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 246, in register
    prepared = self.prepare_representation(
  File "D:\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 731, in prepare_representation
    template_filled = path_template_obj.format_strict(
  File "D:\ayon-core\client\ayon_core\lib\path_templates.py", line 140, in format_strict
    result.validate()
  File "D:\ayon-core\client\ayon_core\pipeline\anatomy\templates.py", line 39, in validate
    raise AnatomyTemplateUnsolved(
ayon_core.pipeline.anatomy.exceptions.AnatomyTemplateUnsolved: Anatomy template "{root[work]}/{project[name]}/{hierarchy}/{folder[name]}/source/{variant]}/v{version:0>3}/{project[code]}_{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}><.{udim}>.{ext}" is unsolved. Missing keys: "variant]".

Traceback (most recent call last):
  File "C:\Users\Kayla\AppData\Local\Ynput\AYON\dependency_packages\ayon_2402141620_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "D:\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 170, in process
    raise exc
  File "D:\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 158, in process
    self.register(instance, file_transactions, filtered_repres)
  File "D:\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 246, in register
    prepared = self.prepare_representation(
  File "D:\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 731, in prepare_representation
    template_filled = path_template_obj.format_strict(
  File "D:\ayon-core\client\ayon_core\lib\path_templates.py", line 140, in format_strict
    result.validate()
  File "D:\ayon-core\client\ayon_core\pipeline\anatomy\templates.py", line 39, in validate
    raise AnatomyTemplateUnsolved(
ayon_core.pipeline.anatomy.exceptions.AnatomyTemplateUnsolved: Anatomy template "{root[work]}/{project[name]}/{hierarchy}/{folder[name]}/source/{variant]}/v{version:0>3}/{project[code]}_{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}><.{udim}>.{ext}" is unsolved. Missing keys: "variant]".

DEBUG: Establishing staging directory @ D:\sh_boss_proj\interior_lenny\lenny_bedroom\asset\work\compositing\renders\nuke\renderCompositingMain
DEBUG: Looking for matching profile for: hosts: "nuke" | product_types: "render" | task_names: "compositing" | task_types: "Compositing"
DEBUG: "nuke" not found in "hosts": ['standalonepublisher']
DEBUG: "nuke" not found in "hosts": ['maya']
DEBUG: "nuke" not found in "hosts": ['traypublisher']
DEBUG: "nuke" not found in "hosts": ['max']
DEBUG: Profile selected: {'product_types': ['review', 'render', 'prerender'], 'hosts': [], 'task_types': [], 'task_names': [], 'template_name': 'test'}
DEBUG: Product: renderCompositingMain
DEBUG: http://localhost:5000 "POST /graphql HTTP/1.1" 200 433
DEBUG: Response <RestApiResponse [200]>
DEBUG: Prepared product: renderCompositingMain
DEBUG: http://localhost:5000 "POST /graphql HTTP/1.1" 200 105
DEBUG: Response <RestApiResponse [200]>
DEBUG: Source: {root[work]}/interior_lenny/lenny_bedroom/asset/work/compositing/il_asset_compositing_v004.nk
DEBUG: Creating new version ...
DEBUG: Prepared version: v005
DEBUG: http://localhost:5000 "POST /graphql HTTP/1.1" 200 112
DEBUG: Response <RestApiResponse [200]>
DEBUG: Anatomy template name: test
CRITICAL: Error when registering
Traceback (most recent call last):
  File "D:\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 158, in process
    self.register(instance, file_transactions, filtered_repres)
  File "D:\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 246, in register
    prepared = self.prepare_representation(
  File "D:\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 731, in prepare_representation
    template_filled = path_template_obj.format_strict(
  File "D:\ayon-core\client\ayon_core\lib\path_templates.py", line 140, in format_strict
    result.validate()
  File "D:\ayon-core\client\ayon_core\pipeline\anatomy\templates.py", line 39, in validate
    raise AnatomyTemplateUnsolved(
ayon_core.pipeline.anatomy.exceptions.AnatomyTemplateUnsolved: Anatomy template "{root[work]}/{project[name]}/{hierarchy}/{folder[name]}/source/{variant]}/v{version:0>3}/{project[code]}_{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}><.{udim}>.{ext}" is unsolved. Missing keys: "variant]".

Traceback (most recent call last):
  File "C:\Users\Kayla\AppData\Local\Ynput\AYON\dependency_packages\ayon_2402141620_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "D:\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 170, in process
    raise exc
  File "D:\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 158, in process
    self.register(instance, file_transactions, filtered_repres)
  File "D:\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 246, in register
    prepared = self.prepare_representation(
  File "D:\ayon-core\client\ayon_core\plugins\publish\integrate.py", line 731, in prepare_representation
    template_filled = path_template_obj.format_strict(
  File "D:\ayon-core\client\ayon_core\lib\path_templates.py", line 140, in format_strict
    result.validate()
  File "D:\ayon-core\client\ayon_core\pipeline\anatomy\templates.py", line 39, in validate
    raise AnatomyTemplateUnsolved(
ayon_core.pipeline.anatomy.exceptions.AnatomyTemplateUnsolved: Anatomy template "{root[work]}/{project[name]}/{hierarchy}/{folder[name]}/source/{variant]}/v{version:0>3}/{project[code]}_{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}><.{udim}>.{ext}" is unsolved. Missing keys: "variant]".

@robin-ynput robin-ynput self-assigned this Aug 19, 2024
@robin-ynput robin-ynput merged commit 698a7c0 into develop Aug 19, 2024
1 check passed
@robin-ynput robin-ynput deleted the bugfix/9-fix-anatomy-write-nodes branch August 19, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants