Skip to content
Discussion options

You must be logged in to vote
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)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by voidreamer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant