Skip to content

Commit

Permalink
Merge pull request #3 from BigRoy/bugfix/maya_referenceloader_update_…
Browse files Browse the repository at this point in the history
…error

Maya: Fix update reference without reference node showing wrong error message
  • Loading branch information
BigRoy authored Jul 4, 2024
2 parents c0e64ff + bc72562 commit 0893f47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion client/ayon_maya/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -4093,7 +4093,8 @@ def get_reference_node(members, log=None):

references.add(ref)

assert references, "No reference node found in container"
if not references:
return

# Get highest reference node (least parents)
highest = min(references,
Expand Down
5 changes: 4 additions & 1 deletion client/ayon_maya/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,8 @@ def update(self, container, context):
# Get reference node from container members
members = get_container_members(node)
reference_node = lib.get_reference_node(members, self.log)
if reference_node is None:
raise LoadError("No reference node found in container")
namespace = cmds.referenceQuery(reference_node, namespace=True)

file_type = {
Expand All @@ -814,7 +816,8 @@ def update(self, container, context):
"usd": "USD Import"
}.get(repre_entity["name"])

assert file_type, "Unsupported representation: %s" % repre_entity
if file_type is None:
raise LoadError(f"Unsupported representation: {repre_entity}")

assert os.path.exists(path), "%s does not exist." % path

Expand Down

0 comments on commit 0893f47

Please sign in to comment.