ayon-core icon indicating copy to clipboard operation
ayon-core copied to clipboard

Publisher: Fails to initialize if only invalid instances are present (e.g. from OpenPype)

Open BigRoy opened this issue 7 months ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior:

Whenever opening the publisher in a workfile that has only instances that are not valid in current context (e.g. invalid ids/names) then the publisher UI does not initialize at all (you can't create anything) due to an error. See logs.

cb.2\ayon_core\pipeline\create\context.py", line 2382, in validate_instances_context
#     if len(folder_entities) == 1:
# TypeError: object of type 'NoneType' has no len()

This issue came up in Maya 2024.2

Expected Behavior:

No errors should hold the Publisher UI from functioning normally due to legacy instances being present.

Version

1.0.0

What platform you are running on?

Windows

Steps To Reproduce:

  1. Launch e.g. maya with a workfile created from OpenPype

Are there any labels you wish to add?

  • [X] I have added the relevant labels to the bug report.

Relevant log output:

# Traceback (most recent call last):
#   File "C:\Users\Maqina-05\AppData\Local\Ynput\AYON\addons\core_0.4.1-cb.2\ayon_core\tools\publisher\window.py", line 569, in _on_show_timer
#     self.reset()
#   File "C:\Users\Maqina-05\AppData\Local\Ynput\AYON\addons\core_0.4.1-cb.2\ayon_core\tools\publisher\window.py", line 632, in reset
#     self._controller.reset()
#   File "C:\Users\Maqina-05\AppData\Local\Ynput\AYON\addons\core_0.4.1-cb.2\ayon_core\tools\publisher\control_qt.py", line 83, in reset
#     super().reset()
#   File "C:\Users\Maqina-05\AppData\Local\Ynput\AYON\addons\core_0.4.1-cb.2\ayon_core\tools\publisher\control.py", line 325, in reset
#     self._create_model.reset()
#   File "C:\Users\Maqina-05\AppData\Local\Ynput\AYON\addons\core_0.4.1-cb.2\ayon_core\tools\publisher\models\create.py", line 258, in reset
#     self._reset_instances()
#   File "C:\Users\Maqina-05\AppData\Local\Ynput\AYON\addons\core_0.4.1-cb.2\ayon_core\tools\publisher\models\create.py", line 624, in _reset_instances
#     with self._create_context.bulk_instances_collection():
#   File "C:\Program Files\Autodesk\Maya2024\Python\lib\contextlib.py", line 142, in __exit__
#     next(self.gen)
#   File "C:\Users\Maqina-05\AppData\Local\Ynput\AYON\addons\core_0.4.1-cb.2\ayon_core\pipeline\create\context.py", line 2219, in bulk_instances_collection
#     self.validate_instances_context(instances_to_validate)
#   File "C:\Users\Maqina-05\AppData\Local\Ynput\AYON\addons\core_0.4.1-cb.2\ayon_core\pipeline\create\context.py", line 2382, in validate_instances_context
#     if len(folder_entities) == 1:
# TypeError: object of type 'NoneType' has no len()

Additional context:

No response

BigRoy avatar Jul 19 '24 11:07 BigRoy