Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMSUSD-1264 add tooltip for lookdevx button in material section in AE #3788

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ def onCreate(self, *args):
hasLookdevX = self._hasLookdevX()
graphIcon = 'LookdevX.png' if hasLookdevX else None

self.assignedMat = self._createTextField('material', 'kLabelAssignedMaterial', graphIcon)
self.assignedMat = self._createTextField('material', 'kLabelAssignedMaterial', graphIcon, 'kAnnShowMaterialInLookdevx')
self.assignedMatMenu = self._createGraphMenu(self.assignedMat.button)

self.strengthMenu = self._createDropDownField(
'strength', 'kLabelMaterialStrength',
['kLabelWeakerMaterial', 'kLabelStrongerMaterial'])

self.inheritedMat = self._createTextField('inherited', 'kLabelInheritedMaterial', graphIcon)
self.inheritedMat = self._createTextField('inherited', 'kLabelInheritedMaterial', graphIcon, 'kAnnShowMaterialInLookdevx')
self.inheritedMatMenu = self._createGraphMenu(self.inheritedMat.button)

# Note: icon image taken from Maya resources.
Expand All @@ -76,7 +76,7 @@ def _hasLookdevX():
'''
Copy link
Collaborator

Choose a reason for hiding this comment

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

I didn't realize that we have soft dependency on LookdevX. Is this necessary or could we expose a callback for LookdevX to add their own ?

return bool(cmds.pluginInfo('LookdevXMaya', query=True, loaded=True))

def _createTextField(self, longName, uiNameRes, image=None):
def _createTextField(self, longName, uiNameRes, image=None, imageTooltipRes=None):
'''
Create a disabled text field group and an optional image button with the correct label.
'''
Expand All @@ -86,7 +86,8 @@ def _createTextField(self, longName, uiNameRes, image=None):
cmds.text(label=uiLabel, annotation=uiLabel)
textField = cmds.textField(annotation=uiLabel, editable=False, enableKeyboardFocus=True)
if image:
button = cmds.symbolButton(enable=False, image=image)
imageTooltip = getMayaUsdLibString(imageTooltipRes) if imageTooltipRes else ''
button = cmds.symbolButton(enable=False, image=image, annotation=imageTooltip)
else:
button = None
return MaterialCustomControl.TextField(rowLayout, textField, button)
Expand Down
1 change: 1 addition & 0 deletions lib/mayaUsd/resources/scripts/mayaUsdLibRegisterStrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def mayaUsdLibRegisterStrings():
register('kOpenImage', 'Open')
register('kLabelMaterial', 'Material')
register('kLabelAssignedMaterial', 'Assigned Material')
register('kAnnShowMaterialInLookdevx', 'Show in LookdevX')
register('kLabelInheritedMaterial', 'Inherited Material')
register('kLabelInheritedFromPrim', 'Inherited from Prim')
register('kLabelInheriting', 'inheriting')
Expand Down