getavalon / core

The safe post-production pipeline - https://getavalon.github.io/2.0
MIT License
214 stars 48 forks source link

Launcher doesn't show any representations #421

Closed mottosso closed 4 years ago

mottosso commented 4 years ago

What happened?

Loader doesn't show any published material, and throws an exception in the script editor. It started happening since #418, but doesn't appear related. It may be specific to colorbleed-config, but can't tell for certain. Has anyone else spotted this?

# Traceback (most recent call last):
#   File "C:\Users\marcus\packages\avalon_core\5.3.2\python\avalon\tools\loader\app.py", line 174, in _assetschanged
#     subsets_model.set_asset(document['_id'])
#   File "C:\Users\marcus\packages\avalon_core\5.3.2\python\avalon\tools\loader\model.py", line 37, in set_asset
#     self.refresh()
#   File "C:\Users\marcus\packages\avalon_core\5.3.2\python\avalon\tools\loader\model.py", line 135, in refresh
#     active_groups = lib.get_active_group_config(asset_id)
#   File "C:\Users\marcus\packages\avalon_core\5.3.2\python\avalon\tools\loader\lib.py", line 132, in get_active_group_config
#     default_group_config = predefineds.pop("__default__")
# KeyError: '__default__'

To Reproduce

  1. Launch Maya
  2. Open Loader

Workaround

I found that if I manually call this, it works as expected afterwards.

from avalon.tools.loader import lib
lib.refresh_group_config()
BigRoy commented 4 years ago

I believe initially somewhere it did a first refresh with lib.refresh_group_config() as the module got loaded or something alike. See wherever it got triggered or initializes the dictionary with __default__.

davidlatwe commented 4 years ago

Hmm, I'll have a check on this, once I got back to office tomorrow.

mottosso commented 4 years ago

I found the issue, there was a missing call to that function in the app.py.

https://github.com/getavalon/core/blame/6102ed740e3897516cf4b457d5b495aa202500a5/avalon/tools/cbloader/app.py#L121

It's a result of the refactor from #388, this commit in particular: here

davidlatwe commented 4 years ago

Thanks !

mottosso commented 4 years ago

Fixed with https://github.com/getavalon/core/pull/429