Created
November 14, 2024 11:21
-
-
Save BigRoy/37ed50ff22a12f34d37ae28ce948609a to your computer and use it in GitHub Desktop.
Force enable Word Wrap in Maya's script editor output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.OpenMayaUI as mui | |
import shiboken2 | |
from PySide2 import QtWidgets | |
# <-- get maya main window QMainWindow --> | |
ptr = mui.MQtUtil.mainWindow() | |
main_window = shiboken2.wrapInstance(int(ptr), QtWidgets.QMainWindow) | |
# <-- set wordWrap on script editor feedback field --> | |
cmdScrollFieldReporter = main_window.findChild(QtWidgets.QPlainTextEdit, "cmdScrollFieldReporter1") | |
cmdScrollFieldReporter.setLineWrapMode(QtWidgets.QPlainTextEdit.WidgetWidth) | |
# <-- set wordWrap on each scriptEditor tab --> | |
for i in range(1000): | |
cmdScrollFieldExecuter = main_window.findChild(QtWidgets.QPlainTextEdit, f"cmdScrollFieldExecuter{i}") | |
if cmdScrollFieldExecuter is not None: | |
cmdScrollFieldExecuter.setLineWrapMode(QtWidgets.QPlainTextEdit.WidgetWidth) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment