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

Chore: Use 'folderPath' instead of 'asset' during publishing #81

Merged

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Feb 16, 2024

Changelog Description

Rename "asset" key used during publishing to "folderPath". This is first of many PRs changing asset naming to folder.

Additional info

I think resolve, hiero and traypublisher might not be converted correctly. Please @jakubjezek001 test them and if you find and issue try to fix it.

Testing notes:

Ideal test scenario:

  1. Open a host with workfile that already did have created instances.
  2. Use all possible creators.
  3. Publish all the instances.
  4. Everything is working and shiny.
  • 3dsMax
  • AfterEffects
  • Blender
  • Fusion
  • Hiero
  • Houdini
  • Maya
  • Nuke
  • Photoshop
  • Resolve
  • SubstancePainter
  • TrayPublisher
  • Unreal
  • Celaction
  • Harmony
  • TVpaint

I do expect that hosts using Publisher tool should not have any issues. Possible issues are with hosts using pyblish pype, automated publishin login and editorial.

@moonyuet
Copy link
Member

I encountered this.
image


Should this line be asset_name=context.data["folderPath"], ?

@iLLiCiTiT
Copy link
Member Author

Should this line be asset_name=context.data["folderPath"], ?

Yes, well spotted (I missed this because of other changes).

@moonyuet
Copy link
Member

collect_workfile.py and collect_render.py in 3dsMax hosts have both context.data["asset"] and instance.data["asset"] assigned.
And also collect_anatomy_instance_data.py in plugins folder is still using instance.data["asset"]

@simonebarbieri
Copy link
Contributor

simonebarbieri commented Feb 16, 2024

I'm getting this in Blender:

Traceback (most recent call last):
  File "C:\Users\Simone\AppData\Local\Ynput\AYON\dependency_packages\ayon_2401161802_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "C:\Dev\Ynput\ayon-core\client\ayon_core\plugins\publish\collect_anatomy_instance_data.py", line 54, in process
    self.fill_missing_asset_docs(context, project_name)
  File "C:\Dev\Ynput\ayon-core\client\ayon_core\plugins\publish\collect_anatomy_instance_data.py", line 71, in fill_missing_asset_docs
    _asset_name = instance.data["asset"]
KeyError: 'asset'

EDIT: ah, I missed that @moonyuet already mentioned this!

@iLLiCiTiT
Copy link
Member Author

iLLiCiTiT commented Feb 16, 2024

I had collapsed hosts when I've beek picking the lines to commit. Damn, should be fine now.

...I should not try to split the changes into multiple PRs in this case.

@@ -68,7 +68,7 @@ def fill_missing_asset_docs(self, context, project_name):
instances_with_missing_asset_doc = collections.defaultdict(list)
for instance in context:
instance_asset_doc = instance.data.get("assetEntity")
_asset_name = instance.data["asset"]
_asset_name = instance.data["folderPath"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we also be refactoring the variable names here so it's clear that these are now folder paths? There are quite a few still referring to asset and asset_name.

Copy link
Member Author

@iLLiCiTiT iLLiCiTiT Feb 19, 2024

Choose a reason for hiding this comment

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

Yes, that's what I have prepared. But I wanted to keep this PR as simple as possible. Change of variables can then happen in per-host PRs. I think there will be sometimes things to change, which is not goal of this PR.

Copy link
Member

@tokejepsen tokejepsen left a comment

Choose a reason for hiding this comment

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

Traceback (most recent call last):
  File "C:\Users\tokejepsen\AppData\Local\Ynput\AYON\dependency_packages\ayon_2402141620_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "C:\Users\tokejepsen\ayon-core\client\ayon_core\hosts\maya\plugins\publish\collect_render.py", line 310, in process
    label = "{0} ({1})".format(layer_name, instance.data["asset"])
KeyError: 'asset'

@moonyuet
Copy link
Member

moonyuet commented Feb 19, 2024

Tested with 3dsmax, Looks okay now with all families.
EDIT. Not related to this PR but I encountered failed job when doing the deadline submission. It seems that avalon environment isn't set up correctly. (Or my plugin is not updated?)

2024-02-19 17:22:51:  0: PYTHON: *** GlobalJobPreload start ...
2024-02-19 17:22:51:  0: PYTHON: >>> Getting job ...
2024-02-19 17:22:51:  0: PYTHON: >>> Injecting AYON environments ...
2024-02-19 17:22:51:  0: PYTHON: --- Ayon executable: D:\ayon_launcher\ayon-launcher\build\output\ayon_console.exe
2024-02-19 17:22:51:  0: PYTHON: >>> Temporary path: C:\Users\Kayla\AppData\Local\Temp\20240219092251386723_745ae9e2-cf08-11ee-b4db-d50b96553f92.json
2024-02-19 17:22:51:  0: PYTHON: Traceback (most recent call last):
2024-02-19 17:22:51:  0: PYTHON:   File "C:\ProgramData\Thinkbox\Deadline10\workers\DESKTOP-1U8VP0C\plugins\65d31de7ed35d15e0d48d0a5\GlobalJobPreLoad.py", line 488, in inject_ayon_environment
2024-02-19 17:22:51:  0: PYTHON:     raise RuntimeError((
2024-02-19 17:22:51:  0: PYTHON: RuntimeError: Missing required env vars: AVALON_PROJECT, AVALON_ASSET, AVALON_TASK, AVALON_APP_NAME
2024-02-19 17:22:51:  0: PYTHON: !!! Injection failed.
2024-02-19 17:22:51:  0: Done executing plugin command of type 'Start Job'

@MustafaJafar
Copy link
Contributor

MustafaJafar commented Feb 20, 2024

Everything still works as usual in Houdini.


instance.data["asset"] - These are wrong. Found 5 of these, and fixed them. If you find more, then report.

I found inst.data["asset"] here
https://github.com/ynput/ayon-core/blob/enhancement/OP-8208_Use-folderPath-during-publishing/client/ayon_core/hosts/houdini/plugins/publish/collect_usd_bootstrap.py

@moonyuet
Copy link
Member

Tested in Substance Painter, works smoothly

- Corrected a typo in a data key from "folferPath" to "folderPath".
- Updated the variable name from "asset" to "asset_name".
Copy link
Member

@jakubjezek001 jakubjezek001 left a comment

Choose a reason for hiding this comment

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

image

Traypublisher Editorial Simple is giving me following results

publish-report-240220-15-41.json

Copy link
Contributor

@MustafaJafar MustafaJafar left a comment

Choose a reason for hiding this comment

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

Tested in Houdini. Works as usual.
Thanks.

…-publishing

# Conflicts:
#	client/ayon_core/hosts/max/plugins/publish/collect_workfile.py
Copy link
Member

@64qam 64qam left a comment

Choose a reason for hiding this comment

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

all good in AE and PS

@iLLiCiTiT iLLiCiTiT merged commit 3888307 into develop Feb 21, 2024
2 checks passed
@iLLiCiTiT iLLiCiTiT deleted the enhancement/OP-8208_Use-folderPath-during-publishing branch February 21, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

9 participants