<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MAXScript Qt UI in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052245#M5762</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1634609"&gt;@denisT.MaxDoctor&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have quite a lot of experience with Qt (Maya) user interfaces. As my experience shows, serious tools cannot be created without events. Connections are usually not enough. My guess is that Qt events can be a problem in MXS because additional Qt coding (override, extend) is always required.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hmmm, did I miss something or can't you just a) replace the default event with a custom one, b) store the original if you want to extend it?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;(
	local QtWidgets = python.import "PySide2.QtWidgets"
	local GetQMaxMainWindow = (python.import "qtmax").GetQMaxMainWindow

	if isProperty ::testDialog #close do testDialog.close()
	global testDialog = QtWidgets.QDialog(GetQMaxMainWindow())
	testDialog.mousePressEvent = fn mousePressEvent evnt = py.print (py.str.format "dialog click at {}" (evnt.pos()))
	testDialog.setWindowTitle "Pyside Qt Window"
	testDialog.setFixedSize 250 250

	local button = QtWidgets.QPushButton "Button" parent:testDialog
	button.clicked.connect (fn _ = py.print "original click")
	local origEvnt = button.mousePressEvent
	button.mousePressEvent = fn __ evnt = (py.print "extended click"; origEvnt evnt)

	testDialog.show()
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Feb 2021 21:48:26 GMT</pubDate>
    <dc:creator>Swordslayer</dc:creator>
    <dc:date>2021-02-02T21:48:26Z</dc:date>
    <item>
      <title>MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10049173#M5749</link>
      <description>&lt;P&gt;In the end, using Qt from MAXScript was more straightforward than I thought, kudos to&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1634609"&gt;@denisT.MaxDoctor&lt;/a&gt;&amp;nbsp;for setting me on the right track with the&amp;nbsp;&lt;SPAN&gt;QtUiLoader. Here's an edited sample from the max python sample scripts:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(
	local QFile = (python.import "PySide2.QtCore").QFile
	local QUiLoader = (python.import "PySide2.QtUiTools").QUiLoader
	local GetQMaxMainWindow = (python.import "qtmax").GetQMaxMainWindow

	local ui_file = QFile "QtTest.ui"
	ui_file.open QFile.ReadOnly
	local ui = (QUiLoader()).load ui_file (GetQMaxMainWindow())
	ui_file.close()

	fn hello = messageBox "Hello world!"

	ui.pushButton.clicked.connect hello
	ui.toolButton.clicked.connect getSaveFileName
	ui.show()
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Put it in the same folder as the .ui file from the attached zip and run the ms file. The two buttons are connected to maxscript functions, I guess you get the idea. Have fun &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 22:43:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10049173#M5749</guid>
      <dc:creator>Swordslayer</dc:creator>
      <dc:date>2021-02-01T22:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10049544#M5750</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1275790"&gt;@Swordslayer&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(
	local QFile = (python.import "PySide2.QtCore").QFile
	local QUiLoader = (python.import "PySide2.QtUiTools").QUiLoader
	local GetQMaxMainWindow = (python.import "qtmax").GetQMaxMainWindow

	local ui_file = QFile "QtTest.ui"
	ui_file.open QFile.ReadOnly
	local ui = (QUiLoader()).load ui_file (GetQMaxMainWindow())
	ui_file.close()

	fn hello = messageBox "Hello world!"

	ui.pushButton.clicked.connect hello
	ui.toolButton.clicked.connect getSaveFileName
	ui.show()
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very nice snippet!&lt;BR /&gt;I'm pretty far from it now, but I've tried ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;local GetQMaxMainWindow = (python.import "qtmax"). GetQMaxMainWindow&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it doesn't work for me in 2020. no "qtmax".&lt;/P&gt;&lt;P&gt;Also I couldn't connect mxs function like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;fn format_time = (format "time:% \ n" (timestamp ()))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it connects but does not printout&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another question about UNDO for connected functions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;defining them as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;fn something = undo on (...)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it is not a good practice. any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 03:27:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10049544#M5750</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2021-02-02T03:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10049844#M5751</link>
      <description>&lt;P&gt;In 2020, it'd be &lt;FONT face="courier new,courier"&gt;MaxPlus&lt;/FONT&gt; instead of&amp;nbsp;&lt;FONT face="courier new,courier"&gt;qtmax&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;As for printing, I guess you'd have to use python &lt;FONT face="courier new,courier"&gt;print&lt;/FONT&gt; for the output, this works in 2021:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;local py = python.import "builtins"
fn format_time = py.print (py.str.format "time: {0}" (timeStamp()))&lt;/LI-CODE&gt;
&lt;P&gt;In 2020, that'd be&amp;nbsp;python.import &lt;FONT face="courier new,courier"&gt;"__builtin__"&lt;/FONT&gt; instead.&lt;/P&gt;
&lt;P&gt;As for the undo, neither that nor automatic redraw are there so yeah, I guess that would be the way to go.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 07:15:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10049844#M5751</guid>
      <dc:creator>Swordslayer</dc:creator>
      <dc:date>2021-02-02T07:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10049966#M5752</link>
      <description>&lt;P&gt;Here's a bit more functional snippet using the same .ui file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(
	local QFile = (python.import "PySide2.QtCore").QFile
	local QUiLoader = (python.import "PySide2.QtUiTools").QUiLoader
	local GetQMaxMainWindow = (python.import "qtmax").GetQMaxMainWindow
	local py = python.import "builtins"
	
	local ui_file = QFile "QtTest.ui"
	ui_file.open QFile.ReadOnly

	if isProperty ::testDialog #close do testDialog.close()
	global testDialog = (QUiLoader()).load ui_file (GetQMaxMainWindow())
	ui_file.close()

	local filename
	fn print_filename = py.print (py.str.format "filename: {0}" filename)
	fn get_filename = filename = getOpenFileName()

	testDialog.pushButton.setText "Print filename"
	testDialog.pushButton.setToolTip "Click the '...' button to pick file."
	testDialog.pushButton.clicked.connect print_filename
	testDialog.toolButton.clicked.connect get_filename
	testDialog.show()
)&lt;/LI-CODE&gt;
&lt;P&gt;The&lt;FONT face="courier new,courier"&gt; '...'&lt;/FONT&gt; button updates the internal filename var with the picked file and the other button prints it in listener. I've made the &lt;FONT face="courier new,courier"&gt;testDialog&lt;/FONT&gt; global so that it can be easily closed if it already exists.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 08:22:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10049966#M5752</guid>
      <dc:creator>Swordslayer</dc:creator>
      <dc:date>2021-02-02T08:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10050021#M5753</link>
      <description>&lt;P&gt;Creating the UI directly without the help of a .ui file seems to work rather nice as well:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(
	local QtWidgets = python.import "PySide2.QtWidgets"
	local GetQMaxMainWindow = (python.import "qtmax").GetQMaxMainWindow

	if isProperty ::testDialog #close do testDialog.close()
	global testDialog = QtWidgets.QDialog(GetQMaxMainWindow())
	testDialog.setWindowTitle "Pyside Qt Window"

	local dialog_layout = QtWidgets.QVBoxLayout()
	local label = QtWidgets.QLabel "Click button to create a cylinder in the scene"
	dialog_layout.addWidget label

	fn make_cylinder = with undo on Cylinder isSelected:on

	local cylinder_btn = QtWidgets.QPushButton "Cylinder"
	cylinder_btn.clicked.connect make_cylinder
	dialog_layout.addWidget cylinder_btn

	testDialog.setLayout dialog_layout
	testDialog.show()
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 08:45:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10050021#M5753</guid>
      <dc:creator>Swordslayer</dc:creator>
      <dc:date>2021-02-02T08:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10050944#M5754</link>
      <description>&lt;P&gt;It's kinda fun to play with, that's for sure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;(
	local QtWidgets = python.import "PySide2.QtWidgets"
	local GetQMaxMainWindow = (python.import "qtmax").GetQMaxMainWindow
	local py = python.import "builtins"

	if isProperty ::teapotRotator #close do teapotRotator.close()
	global teapotRotator = QtWidgets.QDialog(GetQMaxMainWindow())
	local layout = QtWidgets.QGridLayout()

	local dials = for i = 1 to 3 collect
	(
		local btn = QtWidgets.QPushButton ("Zero " + #("X", "Y", "Z")[i] + " Rot")
		layout.addWidget btn 0 i
		btn.clicked.connect (execute ("(fn zeroRot = teapotRotator.zeroDials #{" + i as string + "})"))

		local dial = QtWidgets.QDial()
		layout.addWidget dial 1 i
		dial.setMaximum 360
		dial.setWrapping on
		dial.valueChanged.connect (execute ("(fn rot val = teapotRotator.setPotRot val " + i as string + ")"))
		dial.sliderPressed.connect (fn startHold = theHold.superBegin())
		dial.sliderReleased.connect (fn acceptHold = theHold.superAccept "Teapot Rotate")
		dial
	)
	
	local togglePushButton = QtWidgets.QPushButton "Zero All"
	togglePushButton.clicked.connect (fn zeroAll = teapotRotator.zeroDials #{1..3})
	layout.addWidget togglePushButton 2 2

	delete $TeapotRot*
	local pot = Teapot prefix:"TeapotRot" isSelected:on

	py.setattr teapotRotator "setPotRot" (
		fn setRot val i =
		(
			if isValidNode pot do with undo on pot[3][2][i].value = val
			redrawViews()
		)
	)
	py.setattr teapotRotator "zeroDials" (
		fn zeroDials idx = for i in idx do dials[i].setValue 0
	)
	teapotRotator.setWindowTitle "Teapot Rotator"
	teapotRotator.setLayout layout
	teapotRotator.show()
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 14:40:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10050944#M5754</guid>
      <dc:creator>Swordslayer</dc:creator>
      <dc:date>2021-02-02T14:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10051576#M5755</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1275790"&gt;@Swordslayer&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;It's kinda fun to play with, that's for sure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;btn.clicked.connect (execute ("(fn zeroRot = teapotRotator.zeroDials #{" + i as string + "})"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;so soon you will get to lambdas &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 17:47:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10051576#M5755</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2021-02-02T17:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10051620#M5756</link>
      <description>&lt;P&gt;In any case, you are on the right track. The main idea behind using Qt is to create dynamic interfaces, which is a big problem for MXS.&lt;BR /&gt;Speaking of some of the issues above ...&lt;BR /&gt;I'm pretty sure we can find a workaround for most of the problems (like format, print), but that's not a solution. I need to be aware of all the limitations before starting any big project. In this case, I just want to first understand why the MXS format (print) is not working. Is this a &lt;STRONG&gt;main thread&lt;/STRONG&gt; or &lt;STRONG&gt;basic output stream&lt;/STRONG&gt; problem? Are they different for mxs and python, Qt(PySide2)? How could this happen?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Another one...&lt;BR /&gt;Attempting to UNDO a connected function may result in MAX failure if the function has not been run undoable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 18:04:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10051620#M5756</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2021-02-02T18:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10051635#M5757</link>
      <description>&lt;P&gt;Okay, that's kinda ugly, would you prefer this from the point of 'nice to read' code? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;local partial = (python.import "functools").partial
fn zeroRot arg = teapotRotator.zeroDials #{arg}
...
btn.clicked.connect(partial zeroRot i)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 18:09:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10051635#M5757</guid>
      <dc:creator>Swordslayer</dc:creator>
      <dc:date>2021-02-02T18:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10051694#M5758</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1634609"&gt;@denisT.MaxDoctor&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm pretty sure we can find a workaround for most of the problems (like format, print), but that's not a solution. I need to be aware of all the limitations before starting any big project. In this case, I just want to first understand why the MXS format (print) is not working. Is this a &lt;STRONG&gt;main thread&lt;/STRONG&gt; or &lt;STRONG&gt;basic output stream&lt;/STRONG&gt; problem? Are they different for mxs and python, Qt(PySide2)? How could this happen?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Another one...&lt;BR /&gt;Attempting to UNDO a connected function may result in MAX failure if the function has not been run undoable.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'd expect the possible problems are the same as if you were usin pymxs from python i.e. &lt;A href="https://help.autodesk.com/view/MAXDEV/2021/ENU/?guid=Max_Python_API_using_pymxs_pymxs_module_html" target="_blank" rel="noopener"&gt;this would apply&lt;/A&gt; (scroll down to &lt;EM&gt;MAXScript Undo and Redo&lt;/EM&gt; and &lt;EM&gt;Printing to the Listener&lt;/EM&gt;).&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 18:33:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10051694#M5758</guid>
      <dc:creator>Swordslayer</dc:creator>
      <dc:date>2021-02-02T18:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10051973#M5759</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1275790"&gt;@Swordslayer&lt;/a&gt;&amp;nbsp;wrote:&lt;P&gt;I'd expect the possible problems are the same as if you were usin pymxs from python i.e. &lt;A href="https://help.autodesk.com/view/MAXDEV/2021/ENU/?guid=Max_Python_API_using_pymxs_pymxs_module_html" target="_blank" rel="noopener"&gt;this would apply&lt;/A&gt; (scroll down to &lt;EM&gt;MAXScript Undo and Redo&lt;/EM&gt; and &lt;EM&gt;Printing to the Listener&lt;/EM&gt;).&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;before I start a serious project with MXS - Qt, I will test the entire pipeline ... as far as possible, I will keep you friends informed and updated&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 20:05:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10051973#M5759</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2021-02-02T20:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052090#M5760</link>
      <description>&lt;P&gt;Sounds great, can't wait to see what you find.&amp;nbsp;If there's anyone who could shed more light on this, it'd probably be&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4750151"&gt;@eric.brosseau&lt;/a&gt;&amp;nbsp;or&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/86770"&gt;@attilaszabo&lt;/a&gt;&amp;nbsp;(though with the next version release geting nearer and nearer, I imagine they're pretty busy).&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 20:43:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052090#M5760</guid>
      <dc:creator>Swordslayer</dc:creator>
      <dc:date>2021-02-02T20:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052186#M5761</link>
      <description>&lt;P&gt;I have quite a lot of experience with Qt (Maya) user interfaces. As my experience shows, serious tools cannot be created without events. Connections are usually not enough. My guess is that Qt events can be a problem in MXS because additional Qt coding (override, extend) is always required.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 21:19:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052186#M5761</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2021-02-02T21:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052245#M5762</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1634609"&gt;@denisT.MaxDoctor&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have quite a lot of experience with Qt (Maya) user interfaces. As my experience shows, serious tools cannot be created without events. Connections are usually not enough. My guess is that Qt events can be a problem in MXS because additional Qt coding (override, extend) is always required.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hmmm, did I miss something or can't you just a) replace the default event with a custom one, b) store the original if you want to extend it?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;(
	local QtWidgets = python.import "PySide2.QtWidgets"
	local GetQMaxMainWindow = (python.import "qtmax").GetQMaxMainWindow

	if isProperty ::testDialog #close do testDialog.close()
	global testDialog = QtWidgets.QDialog(GetQMaxMainWindow())
	testDialog.mousePressEvent = fn mousePressEvent evnt = py.print (py.str.format "dialog click at {}" (evnt.pos()))
	testDialog.setWindowTitle "Pyside Qt Window"
	testDialog.setFixedSize 250 250

	local button = QtWidgets.QPushButton "Button" parent:testDialog
	button.clicked.connect (fn _ = py.print "original click")
	local origEvnt = button.mousePressEvent
	button.mousePressEvent = fn __ evnt = (py.print "extended click"; origEvnt evnt)

	testDialog.show()
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 21:48:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052245#M5762</guid>
      <dc:creator>Swordslayer</dc:creator>
      <dc:date>2021-02-02T21:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052246#M5763</link>
      <description>&lt;P&gt;I don't like &lt;STRONG&gt;mixing code&lt;/STRONG&gt; with different languages in one project. This is why I don't like using .NET in combination with MXS. And I don't use this combination lately, although in the past I have done many projects with mix of MXS and C#.&lt;BR /&gt;I usually make the whole interface in MXS and C++ now.&lt;/P&gt;&lt;P&gt;So it's okay for me to use the MXS &lt;STRONG&gt;python&lt;/STRONG&gt; interface with access to Qt, but I don't want to do additional coding in Python and then use extended or custom modules.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 21:43:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052246#M5763</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2021-02-02T21:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052286#M5764</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1275790"&gt;@Swordslayer&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1634609"&gt;@denisT.MaxDoctor&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I have quite a lot of experience with Qt (Maya) user interfaces. As my experience shows, serious tools cannot be created without events. Connections are usually not enough. My guess is that Qt events can be a problem in MXS because additional Qt coding (override, extend) is always required.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hmmm, did I miss something or can't you just a) replace the default event with a custom one, b) store the original if you want to extend it?&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Oh. I didn't make myself clear. I mean a situation where a class (object) doesn't have a specific event and you need to add it.&lt;BR /&gt;Qt also has a very interesting mechanism called &lt;STRONG&gt;eventFilter&lt;/STRONG&gt; that I may miss.&lt;/P&gt;&lt;P&gt;... looked just now ... hmm ... like you can write event filters in MXS.&lt;BR /&gt;It's a pity, but now there is no time to try.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 22:05:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052286#M5764</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2021-02-02T22:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052522#M5765</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1634609"&gt;@denisT.MaxDoctor&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1275790"&gt;@Swordslayer&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another question about UNDO for connected functions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;defining them as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;fn something = undo on (...)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it is not a good practice. any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;we can wrap connection function with undo and other contexts like:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;partial = (python.import "functools").partial

fn runfn undotext fun = 
(
	undo undotext on
	(
		fun()
	)
)
fn deleteAll = (delete objects)

ww.Button_1.clicked.connect (partial runfn "Select None" clearSelection)
ww.Button_2.clicked.connect (partial runfn "Delete All" deleteAll)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 02 Feb 2021 23:49:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052522#M5765</guid>
      <dc:creator>denist.dts</dc:creator>
      <dc:date>2021-02-02T23:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052536#M5766</link>
      <description>&lt;P&gt;can we pack with partial optional arguments as well:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;fn deleteNodesByClass class: = 
(
	delete (for node in objects where iskindof node class collect node)
)
-- partial this: ???
deleteNodesByClass class:point&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 02 Feb 2021 23:57:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10052536#M5766</guid>
      <dc:creator>denist.dts</dc:creator>
      <dc:date>2021-02-02T23:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10725070#M5767</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I trigger close events using this method ?&lt;/P&gt;&lt;P&gt;Can't find a way...&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2021 16:45:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10725070#M5767</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-30T16:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: MAXScript Qt UI</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10725151#M5768</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I trigger close events using this method ?&lt;/P&gt;&lt;P&gt;Can't find a way...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Please open a new topic with a full and clear title and question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2021 17:49:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-qt-ui/m-p/10725151#M5768</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2021-10-30T17:49:22Z</dc:date>
    </item>
  </channel>
</rss>

