From a20499eb3ebef7bf5ef2826414ec4416054e388f Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Sun, 16 Jan 2022 10:55:19 +0100 Subject: [PATCH 1/2] Remove mayalookassigner check to avoid tool initialize on startup --- openpype/hosts/maya/api/customize.py | 33 ++++++++++------------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/openpype/hosts/maya/api/customize.py b/openpype/hosts/maya/api/customize.py index 8474262626..eef100ddfc 100644 --- a/openpype/hosts/maya/api/customize.py +++ b/openpype/hosts/maya/api/customize.py @@ -95,29 +95,20 @@ def override_toolbox_ui(): # Create our controls background_color = (0.267, 0.267, 0.267) controls = [] - look_assigner = None - try: - look_assigner = host_tools.get_tool_by_name( - "lookassigner", - parent=pipeline._parent - ) - except Exception: - log.warning("Couldn't create Look assigner window.", exc_info=True) - if look_assigner is not None: - controls.append( - mc.iconTextButton( - "pype_toolbox_lookmanager", - annotation="Look Manager", - label="Look Manager", - image=os.path.join(icons, "lookmanager.png"), - command=host_tools.show_look_assigner, - bgc=background_color, - width=icon_size, - height=icon_size, - parent=parent - ) + controls.append( + mc.iconTextButton( + "pype_toolbox_lookmanager", + annotation="Look Manager", + label="Look Manager", + image=os.path.join(icons, "lookmanager.png"), + command=host_tools.show_look_assigner, + bgc=background_color, + width=icon_size, + height=icon_size, + parent=parent ) + ) controls.append( mc.iconTextButton( From 1bfe3c1fd013e5ebf010cdfef8114cedae18cdf2 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Sun, 16 Jan 2022 10:56:35 +0100 Subject: [PATCH 2/2] Remove explicit background color - icons are transparent and it works fine without --- openpype/hosts/maya/api/customize.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/openpype/hosts/maya/api/customize.py b/openpype/hosts/maya/api/customize.py index eef100ddfc..c7fb042ead 100644 --- a/openpype/hosts/maya/api/customize.py +++ b/openpype/hosts/maya/api/customize.py @@ -93,7 +93,6 @@ def override_toolbox_ui(): return # Create our controls - background_color = (0.267, 0.267, 0.267) controls = [] controls.append( @@ -103,7 +102,6 @@ def override_toolbox_ui(): label="Look Manager", image=os.path.join(icons, "lookmanager.png"), command=host_tools.show_look_assigner, - bgc=background_color, width=icon_size, height=icon_size, parent=parent @@ -119,7 +117,6 @@ def override_toolbox_ui(): command=lambda: host_tools.show_workfiles( parent=pipeline._parent ), - bgc=background_color, width=icon_size, height=icon_size, parent=parent @@ -135,7 +132,6 @@ def override_toolbox_ui(): command=lambda: host_tools.show_loader( parent=pipeline._parent, use_context=True ), - bgc=background_color, width=icon_size, height=icon_size, parent=parent @@ -151,7 +147,6 @@ def override_toolbox_ui(): command=lambda: host_tools.show_scene_inventory( parent=pipeline._parent ), - bgc=background_color, width=icon_size, height=icon_size, parent=parent