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

Maya: Fix update reference without reference node showing wrong error message #3

Merged

Conversation

BigRoy
Copy link
Contributor

@BigRoy BigRoy commented Jul 2, 2024

Note

PR moved from ynput/ayon-core#465

Changelog Description

Raise LoadError instead of assert on no reference node found on Maya reference update

Additional info

Fixes #9

Note: This now currently shows no dialog.

Testing notes:

Easiest way to get into a 'broken' state for the ReferenceLoader:

  1. Load a Maya reference
  2. In outliner enable > Display > Ignore "Hidden in outliner"
  3. In AVALON_CONTAINERS add an object into the reference container (just so that maya does not auto-delete it in next step)
  4. On the loaded maya reference remove the reference (via Maya itself, not via AYON tools)
  5. Container object set should still exist, but no reference node
  6. Via Ayon > Manage.. try to set the version of the container - it will fail.

@BigRoy BigRoy added the type: bug Something isn't working label Jul 2, 2024
@BigRoy BigRoy linked an issue Jul 3, 2024 that may be closed by this pull request
2 tasks
@LiborBatek LiborBatek self-requested a review July 4, 2024 06:19
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

I have followed the steps....as said, no any error raised via UI just the following log in the script editor:

# Traceback (most recent call last):
#   File "C:\Work\REPO\ayon-core\client\ayon_core\tools\sceneinventory\view.py", line 366, in <lambda>
#     lambda: self._show_version_dialog(item_ids, active_repre_id)
#   File "C:\Work\REPO\ayon-core\client\ayon_core\tools\sceneinventory\view.py", line 843, in _show_version_dialog
#     self._update_containers_to_version(
#   File "C:\Work\REPO\ayon-core\client\ayon_core\tools\sceneinventory\view.py", line 1032, in _update_containers_to_version
#     self._update_containers(item_ids, versions)
#   File "C:\Work\REPO\ayon-core\client\ayon_core\tools\sceneinventory\view.py", line 1007, in _update_containers
#     update_container(container, item_version)
#   File "C:\Work\REPO\ayon-core\client\ayon_core\pipeline\load\utils.py", line 539, in update_container
#     return Loader().update(container, context)
#   File "c:\Work\REPO\ayon-maya\client\ayon_maya\plugins\load\load_reference.py", line 256, in update
#     super(ReferenceLoader, self).update(container, context)
#   File "c:\Work\REPO\ayon-maya\client\ayon_maya\api\plugin.py", line 808, in update
#     raise LoadError("No reference node found in container")
# ayon_core.pipeline.load.utils.LoadError: No reference node found in container

image

@BigRoy
Copy link
Contributor Author

BigRoy commented Jul 4, 2024

Thanks @LiborBatek - the lack of UI dialog on the error is indeed an issue, but a separate one from reporting the correct error starting here. The UI issue would need changes in ayon-core. After this will be merged I can make a follow-up issue on Ayon core.

@iLLiCiTiT
Copy link
Member

Handling of errors in scene inventory is a different beast.

@LiborBatek
Copy link
Member

@BigRoy thx for clarification, as I wasnt sure if thats all needed for Approval review, call it my lack of knowledge :)

@BigRoy BigRoy requested a review from LiborBatek July 4, 2024 12:28
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

Works ok.

@BigRoy BigRoy merged commit 0893f47 into ynput:develop Jul 4, 2024
1 check passed
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.

Maya: ReferenceLoader update failure due to no reference node reports wrong message
3 participants