Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Maya: Do not pass set to maya commands (fixes support for older maya versions) #2932

Merged
merged 1 commit into from
Mar 25, 2022

Conversation

BigRoy
Copy link
Collaborator

@BigRoy BigRoy commented Mar 23, 2022

Implementation

This fixes support for Maya 2018

Older versions of Maya do not allow set type to be passed to Maya commands and will result in e.g. "RuntimeError: # Syntax error: unexpected end ( at position 4 while parsing"

E.g. error as reported on discord:

# Traceback (most recent call last):
#   File "C:\Users\22DOGS\OpenPype\openpype\tools\mayalookassigner\app.py", line 253, in on_process_selected
#     assign_look_by_version(nodes, version_id=version["_id"])
#   File "C:\Users\22DOGS\OpenPype\openpype\hosts\maya\api\lib.py", line 1600, in assign_look_by_version
#     shader_nodes = get_container_members(container_node)
#   File "C:\Users\22DOGS\OpenPype\openpype\hosts\maya\api\lib.py", line 1519, in get_container_members
#     for ref in cmds.ls(members, exactType="reference", objectsOnly=True):
# RuntimeError: # Syntax error: unexpected end ( at position 4 while parsing:
#     set([u'Props_lookMain_01_RN'])
#        ^
: set([u'Props_lookMain_01_RN'])

Brief description

This fixes loaded version updating, shader assignments and more areas that relied on get_container_members.

Testing notes:

  1. start maya versions
  2. ensure updating versions of loaded content continues to work, and lookdev shader assignments still work

Older versions of Maya do not allow `set` type to be passed to Maya commands and will result in e.g. "RuntimeError: # Syntax error: unexpected end ( at position 4 while parsing"
@BigRoy
Copy link
Collaborator Author

BigRoy commented Mar 23, 2022

Maya 2018 does have a visual bug on the context menu in the Manager / Scene Inventory. Unrelated to this specific PR but just wanted to mention it:

manager_scene_inventory_context_menu_icons

Edit: This visual bug is also present in Maya 2019. It works fine in Maya 2020 and 2022.

Copy link
Contributor

@maxpareschi maxpareschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works now for both loading and material assignments, tested in maya 2018.7


return members
return list(all_members)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seem to work now, tested in Maya2018.7.
Both asset loading and look assignment work!

Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's working for me too, thanks!

@antirotor antirotor merged commit d179049 into ynput:develop Mar 25, 2022
@mkolar mkolar added the type: bug Something isn't working label Mar 29, 2022
@mkolar mkolar added this to the next milestone Apr 4, 2022
@BigRoy BigRoy mentioned this pull request Jan 31, 2023
2 tasks
@BigRoy BigRoy deleted the maya2018_fix_support branch March 20, 2024 15:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
host: Maya type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants