実行した複数のMELコマンドをひとまとめにして一発でUndo
undoInfoのopenChunkとcloseChunkのフラグを使う。
cmds.undoInfo(openChunk=True) # ひとまとめにする処理 """ move ~ rotate ~ move ~ ...とか """ cmds.undoInfo(closeChunk=True)
以下のような形も可
def _on_mouse_pressed(self): # ひとまとめにする処理開始 cmds.undoInfo(openChunk=True) def _on_mouse_released(self): # ひとまとめにする処理終了 cmds.undoInfo(closeChunk=True) def _on_mouse_moved(self): # ひとまとめになる処理 pass