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
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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