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

Commit

Permalink
maya look assigner is not added if can't be initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Oct 15, 2021
1 parent 9d67911 commit 97ed09c
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions openpype/hosts/maya/api/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,29 @@ def override_toolbox_ui():
# Create our controls
background_color = (0.267, 0.267, 0.267)
controls = []
controls.append(
mc.iconTextButton(
"pype_toolbox_lookmanager",
annotation="Look Manager",
label="Look Manager",
image=os.path.join(icons, "lookmanager.png"),
command=lambda: host_tools.show_look_assigner(
parent=pipeline._parent
),
bgc=background_color,
width=icon_size,
height=icon_size,
parent=parent
look_assigner = None
try:
look_assigner = host_tools.get_tool_by_name(
"lookassigner",
parent=pipeline._parent
)
except Exception as exc:
log.warning("Couldn't create Look assigner window.")

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(
Expand Down

0 comments on commit 97ed09c

Please sign in to comment.