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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bf39fc7
Update submodules.
igg-ca-cg Jan 20, 2022
48fd45e
Revert "Update submodules."
igg-ca-cg Jan 24, 2022
9e50985
Merge branch 'pypeclub:develop' into develop
icyvapor Jan 24, 2022
1e3b782
Merge branch 'pypeclub:develop' into develop
icyvapor Feb 2, 2022
e54f27c
Merge branch 'pypeclub:develop' into develop
icyvapor Feb 3, 2022
8820ae1
Merge remote-tracking branch 'upstream/develop' into develop
igg-ca-cg Feb 3, 2022
6019c4f
Merge branch 'develop' of github.com:icyvapor/OpenPype into develop
igg-ca-cg Feb 3, 2022
c97a494
Merge branch 'pypeclub:develop' into develop
icyvapor Feb 15, 2022
94787e8
Merge branch 'pypeclub:develop' into develop
icyvapor Mar 16, 2022
91de71b
Merge branch 'pypeclub:develop' into develop
icyvapor Mar 16, 2022
0760c87
Merge branch 'develop' of https://github.com/pypeclub/OpenPype into d…
igg-ca-cg Mar 16, 2022
c079df3
Merge branch 'pypeclub:develop' into develop
icyvapor Mar 24, 2022
33ad486
Merge branch 'develop' of github.com:icyvapor/OpenPype into develop
igg-ca-cg Mar 24, 2022
3de8eaf
Merge branch 'develop' of https://github.com/pypeclub/OpenPype into d…
igg-ca-cg Mar 29, 2022
c5aa315
Add toggle button for Loaders' family filter widget.
icyvapor Mar 29, 2022
ea84c18
Fix left splitter indexing.
icyvapor Mar 29, 2022
2fca227
Merge branch 'develop' of https://github.com/pypeclub/OpenPype into d…
icyvapor Apr 7, 2022
9e25ffb
Merge branch 'pypeclub:develop' into develop
icyvapor Apr 21, 2022
5ab8982
Merge branch 'develop' of https://github.com/pypeclub/OpenPype into d…
icyvapor Apr 21, 2022
178ffff
Merge branch 'develop' of github.com:icyvapor/OpenPype into develop
icyvapor Apr 21, 2022
aa1faff
Merge branch 'pypeclub:develop' into develop
icyvapor Apr 28, 2022
c0bcea0
Merge branch 'pypeclub:develop' into develop
icyvapor May 18, 2022
433e019
Merge branch 'pypeclub:develop' into develop
icyvapor May 18, 2022
a64b3f5
Revert "Add toggle button for Loaders' family filter widget."
icyvapor May 18, 2022
b8e8b6a
LookAssigner continues after handling error; other minor UI improveme…
icyvapor May 18, 2022
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
5 changes: 4 additions & 1 deletion openpype/hosts/maya/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1737,8 +1737,11 @@ def apply_shaders(relationships, shadernodes, nodes):
log.warning("No nodes found for shading engine "
"'{0}'".format(id_shading_engines[0]))
continue
try:
cmds.sets(filtered_nodes, forceElement=id_shading_engines[0])
except RuntimeError as rte:
log.error("Error during shader assignment: {}".format(rte))
Comment on lines +1740 to +1743
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.


cmds.sets(filtered_nodes, forceElement=id_shading_engines[0])
# endregion

apply_attributes(attributes, nodes_by_id)
Expand Down
10 changes: 10 additions & 0 deletions openpype/tools/utils/host_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def show_loader(self, parent=None, use_context=None):
loader_tool.show()
loader_tool.raise_()
loader_tool.activateWindow()
loader_tool.showNormal()

if use_context is None:
use_context = False
Expand Down Expand Up @@ -180,6 +181,7 @@ def show_scene_inventory(self, parent=None):
# Pull window to the front.
scene_inventory_tool.raise_()
scene_inventory_tool.activateWindow()
scene_inventory_tool.showNormal()

def get_library_loader_tool(self, parent):
"""Create, cache and return library loader tool window."""
Expand All @@ -200,8 +202,10 @@ def show_library_loader(self, parent=None):
library_loader_tool.show()
library_loader_tool.raise_()
library_loader_tool.activateWindow()
library_loader_tool.showNormal()
library_loader_tool.refresh()


def show_publish(self, parent=None):
"""Try showing the most desirable publish GUI

Expand Down Expand Up @@ -243,6 +247,11 @@ def show_look_assigner(self, parent=None):
look_assigner_tool = self.get_look_assigner_tool(parent)
look_assigner_tool.show()

# Pull window to the front.
look_assigner_tool.raise_()
look_assigner_tool.activateWindow()
look_assigner_tool.showNormal()

def get_experimental_tools_dialog(self, parent=None):
"""Dialog of experimental tools.

Expand Down Expand Up @@ -270,6 +279,7 @@ def show_experimental_tools_dialog(self, parent=None):
dialog.show()
dialog.raise_()
dialog.activateWindow()
dialog.showNormal()

def get_tool_by_name(self, tool_name, parent=None, *args, **kwargs):
"""Show tool by it's name.
Expand Down