ynput / ayon-maya

Maya addon for AYON
Apache License 2.0
6 stars 9 forks source link

Look Assigner: Ignore invalid entity ids in `get_folders` query #85

Closed BigRoy closed 2 months ago

BigRoy commented 2 months ago

Changelog Description

Fixes an issue where look assigner would not list anything if it had to list entries that had invalid ids (those that are NOT valid uuid patterns) and hence the ayon_api.get_folders query would fail.

Additional info

Ignore invalid entity ids in get_folders query to avoid GraphQlQueryFailed exception which then also fails to return for the valid ids in the set.

Fixes #84

Note that due to other logic in the code a warning will still be logged for these invalid ids, which is as intended. For example:

// Warning: ayon_maya.tools.mayalookassigner.commands : Id found on 2 nodes for which no folder is found database, skipping 'ac991b60b4c5a70'
// Warning: ayon_maya.tools.mayalookassigner.commands : Id found on 2 nodes for which no folder is found database, skipping 'ac991b60b1eeb7fc773031a70'

Testing notes:

  1. Load some assets
  2. Go to the cbId attribute. Remove some characters from before the : in the value.
  3. Try the look assigner on that node - it doesn't list anything. (should log a warning instead!)
  4. Now try that node together with nodes that do have valid ids - it still lists nothing. (should list instead, plus log warning)

OR

Load a scene with OpenPype assets together with a scene with AYON asset. Look assigner should still list entries for AYON.

BigRoy commented 2 months ago

@m-u-r-p-h-y can you run this through your demo scene with the alembic character? :)