Is there a way to access / override the USD Layer editor buttons from python ? #3666
Replies: 1 comment
import maya.OpenMayaUI as omui
from shiboken2 import wrapInstance
from PySide2 import QtWidgets, QtCore
usdLayerEditorView = omui.MQtUtil.findControl('mayaUsdLayerEditor')
usdLayerEditorViewPtr = wrapInstance(int(usdLayerEditorView), QtWidgets.QWidget)
def customFunction():
print('test')
for buttonn in usdLayerEditorViewPtr.findChildren(QtWidgets.QPushButton):
if buttonn.toolTip().lower() == "save all edits in the layer stack":
buttonn.clicked.disconnect()
buttonn.clicked.connect(customFunction) |
0 replies
Answer selected by
voidreamer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi, I really like this UI, is there a way I could override what the save button does ? so I bring different options / constraints when I want to save ?
thanks
All reactions