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

Maya: Look assigner UI improvements #3208

Conversation

icyvapor
Copy link
Contributor

Look assigner now handles RuntimeError and continues with material assignment; also some UI usability improvements for host tools.

Add a bit error handling so LookAssigner doesn't abort when there's any single RuntimeError.
Also we noticed LookAssigner is not docked as a sub-window of the main Maya window, and once it's opened, clicking the menu item(or icon) wouldn't bring up the UI to the default size. So I added showNormal() call. Did the same for couple of other UI tools.

Note: Please squash my commits when merging!

Thanks!

igg-ca-cg and others added 25 commits January 19, 2022 18:31
This reverts commit bf39fc7.
Comment on lines +1740 to +1743
try:
cmds.sets(filtered_nodes, forceElement=id_shading_engines[0])
except RuntimeError as rte:
log.error("Error during shader assignment: {}".format(rte))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you describe the errors you were facing that needed this to solve it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was a case we had with outsourcing files, where the 'initialShadingGroup' node was locked.

# Traceback (most recent call last):
#   File "D:\dev\OpenPype\openpype\tools\mayalookassigner\app.py", line 253, in on_process_selected
#     assign_look_by_version(nodes, version_id=version["_id"])
#   File "D:\dev\OpenPype\openpype\hosts\maya\api\lib.py", line 1608, in assign_look_by_version
#     apply_shaders(relationships, shader_nodes, nodes)
#   File "D:\dev\OpenPype\openpype\hosts\maya\api\lib.py", line 1724, in apply_shaders
#     cmds.sets(filtered_nodes, forceElement=id_shading_engines[0])
# RuntimeError: # Connection not made: 'wesley_shield_03_geoShape.instObjGroups[0]' -> 'initialShadingGroup.dagSetMembers[88]'.  Destination is locked.
Error while parsing arguments.
# 

The point of this change is so that the whole process won't abort the first time there's an error. If it happens that the first piece of geo gives an error, Look assigner probably still should try for the rest.

@antirotor antirotor self-requested a review May 23, 2022 11:42
@antirotor antirotor added host: Maya type: enhancement Enhancements to existing functionality labels May 23, 2022
@icyvapor
Copy link
Contributor Author

Hey @antirotor, I see you assigned this back to me, is there something I need to address still?

@antirotor
Copy link
Member

Hey @antirotor, I see you assigned this back to me, is there something I need to address still?

No, just that it's your PR :) so whenever someone comments on it or request changes you'll get notified (you'll probably get them anyway, it renders your avatar next to the PR title and that's worth it :))

@icyvapor
Copy link
Contributor Author

Hey @antirotor, I see you assigned this back to me, is there something I need to address still?

No, just that it's your PR :) so whenever someone comments on it or request changes you'll get notified (you'll probably get them anyway, it renders your avatar next to the PR title and that's worth it :))

Probably I'm not used to how you guys run the PR process. I see the 'assignee' is the person to take the next step of a PR. So I'm a bit confused when you assigned this to me. Do I get merge privilege somehow? :P

@icyvapor icyvapor removed their assignment May 25, 2022
@icyvapor icyvapor changed the title Look assigner UI improvements Maya: Look assigner UI improvements May 26, 2022
@mkolar
Copy link
Member

mkolar commented May 31, 2022

Assignee is the person responsible for the PR. That's not always the author, but most often it is. Reviewers are the ones to act on it unless they already did. Assignee monitors what needs to be done....and usually also does it. Assignee can and should also poke people and remind the PR is ready if nobody seems to be reviewing it.

@icyvapor
Copy link
Contributor Author

icyvapor commented May 31, 2022

@antirotor

<poke> No outstanding comments I need to address, as far as I can tell. Pending your review?  </poke>

@mkolar mkolar changed the base branch from develop to feature/OP-3350_Maya-Look-assigner-UI-improvements June 6, 2022 14:34
@ynbot
Copy link
Contributor

ynbot commented Jun 6, 2022

Task linked: OP-3350 Maya: Look assigner UI improvements

@mkolar
Copy link
Member

mkolar commented Jun 6, 2022

@icyvapor we'll merge this into an intermediary branch so all the commit history is kept and it doesn't require any more work from you and so we can have it show in the Changelog properly. we have some small issue on the CI front with external PRs

@icyvapor
Copy link
Contributor Author

icyvapor commented Jun 7, 2022

@icyvapor we'll merge this into an intermediary branch so all the commit history is kept and it doesn't require any more work from you and so we can have it show in the Changelog properly. we have some small issue on the CI front with external PRs

Hope it's not me? ..

@mkolar
Copy link
Member

mkolar commented Jun 8, 2022

Hope it's not me? ..

Nope. it's just our rudimentary CI, that needs to be improved, so I wanna test what it does if we go through 2 PRs. You're just a good guinea pig right now ;)

@mkolar mkolar merged commit 24cb024 into ynput:feature/OP-3350_Maya-Look-assigner-UI-improvements Jun 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
host: Maya type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants