<?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: PySide2 widget to drag and drop materials? in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12869376#M807</link>
    <description>&lt;P&gt;The simple answer is, "You can't."&lt;/P&gt;&lt;P&gt;MAX has and uses its own Drag-n-Drop (DAD) mechanism that has nothing to do with Qt, .NET, or Win&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But there is a complicated way to do it... and it's the only one I see as possible unless you use c++ MAX and Qt SDKs...&lt;/P&gt;&lt;P&gt;The hard way is to add a MAX Rollout control (specifically MaterialButton) to the Qt widget. After that MAX DAD should work as an embedded one&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 30 Jun 2024 03:38:06 GMT</pubDate>
    <dc:creator>denisT.MaxDoctor</dc:creator>
    <dc:date>2024-06-30T03:38:06Z</dc:date>
    <item>
      <title>PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12868290#M805</link>
      <description>&lt;P&gt;I'm trying to develop a simple tool that allows loading and saving of material libraries&lt;/P&gt;&lt;P&gt;AND also &lt;STRONG&gt;drag and drop materials&lt;/STRONG&gt; from my widget to material editor and reverse.&lt;BR /&gt;&lt;BR /&gt;What &lt;STRONG&gt;QMimeData&lt;/STRONG&gt; type should I set to drop INTO material editor?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have set&amp;nbsp;&lt;STRONG&gt;def dropEvent&lt;/STRONG&gt; to accept all drops right now, it even triggers when I drop data from external application like files from windows explorer. But when I try to drag from material editor slot, it only activates over material slots and viewport objects. How can I force my widget to accept material drops?&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2024 19:59:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12868290#M805</guid>
      <dc:creator>inquestudios</dc:creator>
      <dc:date>2024-06-29T19:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12868338#M806</link>
      <description>&lt;P&gt;Simplified code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import pymxs, PySide2
from PySide2.QtWidgets import QHBoxLayout, QWidget, QPushButton
from PySide2.QtCore import Qt, QMimeData
from PySide2.QtGui import QDrag

rt = pymxs.runtime
rt.clearListener()

materialArr = []
maxWindow = QWidget.find(rt.windows.getMaxHWnd())

libFileName = rt.getOpenFileName(caption = "Select library to load", types = "Material library(*.mat)|*.mat")
if libFileName != None:
    clib = rt.loadTempMaterialLibrary(libFileName)
    for i in clib:
        materialArr.append(i)

class DragButton(QPushButton):
    def mouseMoveEvent(self, e):
        if e.buttons() == Qt.LeftButton:
            drag = QDrag(self)
            mime = QMimeData()
            mime.setUrls([])
            drag.setMimeData(mime)
            drag.exec_(Qt.MoveAction)

class tWindow(PySide2.QtWidgets.QMainWindow):
    def __init__(self, parent = maxWindow):
        super(tWindow, self).__init__(parent)
        self.setWindowTitle('Drag test')
        self.setMouseTracking(True)
        self.setAcceptDrops(True)
        self.blayout = QHBoxLayout()
        for l in materialArr:
            btn = DragButton(l.name)
            #btn = QPushButton(l)
            self.blayout.addWidget(btn)
        mw = QWidget()
        self.setCentralWidget(mw)
        mw.setLayout(self.blayout)
    
    def dragEnterEvent(self, e):
        e.accept()

    def dropEvent(self, e):
        pos = e.pos()
        widget = e.source()
        print(e.pos())
        e.accept()
tw = tWindow()
tw.show()&lt;/LI-CODE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2024 04:39:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12868338#M806</guid>
      <dc:creator>inquestudios</dc:creator>
      <dc:date>2024-06-29T04:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12869376#M807</link>
      <description>&lt;P&gt;The simple answer is, "You can't."&lt;/P&gt;&lt;P&gt;MAX has and uses its own Drag-n-Drop (DAD) mechanism that has nothing to do with Qt, .NET, or Win&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But there is a complicated way to do it... and it's the only one I see as possible unless you use c++ MAX and Qt SDKs...&lt;/P&gt;&lt;P&gt;The hard way is to add a MAX Rollout control (specifically MaterialButton) to the Qt widget. After that MAX DAD should work as an embedded one&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jun 2024 03:38:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12869376#M807</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-06-30T03:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12872587#M808</link>
      <description>&lt;P&gt;Another question then - can I&amp;nbsp;embed MAXscript rollout into QT window as layout, or something like that?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 23:06:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12872587#M808</guid>
      <dc:creator>inquestudios</dc:creator>
      <dc:date>2024-07-01T23:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12872718#M809</link>
      <description>&lt;P&gt;The answer is obvious... of course, you can... Almost the entire MAX user interface is made this way now.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 01:18:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12872718#M809</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-02T01:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12872767#M810</link>
      <description>&lt;P&gt;Very well, could you supply any example? How can I put simple rollout&lt;BR /&gt;&lt;BR /&gt;&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="general"&gt;rollout mbtest "Matbuttons"
(
	materialButton mb1 "Test" width:100 height:100
)&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;&lt;P&gt;into&amp;nbsp;&lt;/P&gt;&lt;P&gt;PySide2.QtWidgets.QMainWindow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import pymxs, PySide2
rt = pymxs.runtime
mxsstr = 'rollout mbtest "Matbuttons"\n(\n\tmaterialButton mb1 "Test" width:100 height:100\n)'
rt.execute(mxsstr)
maxWindow = PySide2.QtWidgets.QWidget.find(rt.windows.getMaxHWnd())
class CBrowser(PySide2.QtWidgets.QMainWindow):
    def __init__(self, parent = maxWindow):
        super(CBrowser, self).__init__(parent)
        ???
        self.setCentralWidget(???)
        self.resize(850, 600)
cWindow = CBrowser()
cWindow.show()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 02:27:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12872767#M810</guid>
      <dc:creator>inquestudios</dc:creator>
      <dc:date>2024-07-02T02:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12872785#M811</link>
      <description>&lt;P&gt;If I told you everything, it wouldn't be interesting!&lt;BR /&gt;Besides, Swordslayer and I have already shown how to do it, maybe not on this forum, but on some other forum.&lt;BR /&gt;&lt;BR /&gt;But I'll give you a hint:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;rollout mbtest "Matbuttons"
(
	materialButton mb1 "Test" width:100 height:100
)
createdialog mbtest
cui.RegisterDialogBar mbtest &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only thing left to do is to change the Qt parent...&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 02:34:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12872785#M811</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-02T02:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12872817#M812</link>
      <description>&lt;P&gt;By the way what MAX version do you use?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 03:25:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12872817#M812</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-02T03:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12872834#M813</link>
      <description>&lt;P&gt;I'm developing my tool for 2019 and later.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So, looks like after&amp;nbsp;cui.RegisterDialogBar rollout becomes a child widget for main 3ds MAX window.&lt;BR /&gt;That's the game changer, thank you for the good lead.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import pymxs, PySide2
rt = pymxs.runtime

rt.clearListener()

mxsstr = 'rollout mbtest "Matbuttons"\n(\n\tmaterialButton mb1 "Test" width:100 height:100\n)\ncreatedialog mbtest\ncui.RegisterDialogBar mbtest'
rt.execute(mxsstr)
maxWindow = PySide2.QtWidgets.QWidget.find(rt.windows.getMaxHWnd())
def procCh(wd):
    chArr = wd.children()
    for cch in chArr:
        if type(cch) == PySide2.QtWidgets.QDockWidget:
            if cch.windowTitle() == 'Matbuttons':
                print(cch)
procCh(maxWindow)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 02 Jul 2024 04:14:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12872834#M813</guid>
      <dc:creator>inquestudios</dc:creator>
      <dc:date>2024-07-02T04:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12874481#M814</link>
      <description>&lt;P&gt;Ok, I've managed to find and reparent widget with materialbuttons!&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import pymxs, PySide2
rt = pymxs.runtime

rt.clearListener()

mxsstr = 'rollout mbtest "Matbuttons"\n(\n\tmaterialButton mb1 "Test1" width:100 height:100 across:3\n\tmaterialButton mb2 "Test2" width:100 height:100\n\tmaterialButton mb3 "Test3" width:100 height:100\n)\ncreatedialog mbtest width:450\ncui.RegisterDialogBar mbtest'
#print(mxsstr)
rt.execute(mxsstr)
maxWindow = PySide2.QtWidgets.QWidget.find(rt.windows.getMaxHWnd())
def procCh(wd):
    chArr = wd.children()
    for cch in chArr:
        if type(cch) == PySide2.QtWidgets.QDockWidget:
            if cch.windowTitle() == 'Matbuttons':
                return cch
rw = procCh(maxWindow)
stuctArr = rw.children()
class CBrowser(PySide2.QtWidgets.QMainWindow):
    def __init__(self, parent = maxWindow):
        super(CBrowser, self).__init__(parent)
        self.setCentralWidget(stuctArr[5])
        self.resize(850, 600)
cWindow = CBrowser()
cWindow.show()
print(cWindow.centralWidget())&lt;/LI-CODE&gt;&lt;P&gt;The bad news - I can't find the way to access elements inside the widget.&lt;BR /&gt;children() returns some useless&amp;nbsp;QPropertyAnimation&lt;BR /&gt;layout() returns None&lt;BR /&gt;How can I address individual buttons?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 18:54:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12874481#M814</guid>
      <dc:creator>inquestudios</dc:creator>
      <dc:date>2024-07-02T18:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12874543#M815</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14733650"&gt;@inquestudios&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&lt;BR /&gt;How can I address individual buttons?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;by HWHD&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 19:40:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12874543#M815</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-02T19:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12874779#M816</link>
      <description>&lt;P&gt;I have collected&lt;BR /&gt;&amp;lt;rollout&amp;gt;.controls[&amp;lt;index&amp;gt;].hwnd&lt;BR /&gt;ran&lt;BR /&gt;PySide2.QtWidgets.QWidget.find()&lt;BR /&gt;with this parameter and got None&lt;BR /&gt;What am I doing wrong?&lt;BR /&gt;Should I get winId from reparented widget and offset from there?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 21:59:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12874779#M816</guid>
      <dc:creator>inquestudios</dc:creator>
      <dc:date>2024-07-02T21:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12875121#M817</link>
      <description>&lt;P&gt;The hwnd of the Rollout control is an array... because a control can consist of multiple windows. For example, a spinner has a body control and a caption control... and so on. In short, you usually use the first hwnd in the array.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 03:45:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12875121#M817</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-03T03:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12875133#M818</link>
      <description>&lt;P&gt;Is it some kind of challenge to make a tool in Python?&lt;BR /&gt;That's fine. But the implementation of Python in versions 2019 and 2025 is very different. You will have problems supporting all these versions with more or less the same code.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 03:54:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12875133#M818</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-03T03:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12875301#M819</link>
      <description>&lt;P&gt;Here's the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import pymxs, PySide2
rt = pymxs.runtime

rt.clearListener()

mxsstr = 'rollout mbtest "Matbuttons"\n(\n\tmaterialButton mb1 "Test1" width:100 height:100 across:3\n\tmaterialButton mb2 "Test2" width:100 height:100\n\tmaterialButton mb3 "Test3" width:100 height:100\n)\ncreatedialog mbtest width:450\ncui.RegisterDialogBar mbtest\n'
print(mxsstr)
rt.execute(mxsstr)
maxWindow = PySide2.QtWidgets.QWidget.find(rt.windows.getMaxHWnd())
def procCh(wd):
    chArr = wd.children()
    for cch in chArr:
        if type(cch) == PySide2.QtWidgets.QDockWidget:
            if cch.windowTitle() == 'Matbuttons':
                return cch
rw = procCh(maxWindow)
for i in rt.mbtest.controls:
    chwnd = i.hwnd[0]
    print(PySide2.QtWidgets.QWidget.find(chwnd))
stuctArr = rw.children()
class CBrowser(PySide2.QtWidgets.QMainWindow):
    def __init__(self, parent = maxWindow):
        super(CBrowser, self).__init__(parent)
        self.setCentralWidget(stuctArr[5])
        self.resize(850, 600)
cWindow = CBrowser()
cWindow.show()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;rollout mbtest "Matbuttons"
(
	materialButton mb1 "Test1" width:100 height:100 across:3
	materialButton mb2 "Test2" width:100 height:100
	materialButton mb3 "Test3" width:100 height:100
)
createdialog mbtest width:450
cui.RegisterDialogBar mbtest

None
None
None&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting hwnd for every control, but&amp;nbsp;&lt;SPAN&gt;QWidget.find(&amp;lt;hwnd&amp;gt;) returns None&lt;BR /&gt;Let's assume I am working with 3ds MAX 2019 only&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 06:16:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12875301#M819</guid>
      <dc:creator>inquestudios</dc:creator>
      <dc:date>2024-07-03T06:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12875532#M820</link>
      <description>&lt;P&gt;What are you searching for? You already have an hwnd for WinAPI methods and UI control to access its properties, such as material.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import pymxs, PySide2
rt = pymxs.runtime

rt.clearListener()

mxsstr = '''
rollout mbtest "Matbuttons"
(
	materialButton mb1 "Test1" width:100 height:100 across:3
	materialButton mb2 "Test2" width:100 height:100 
	materialButton mb3 "Test3" width:100 height:100


	on mbtest open do 
	(
		mb1.material = Standard name:#MAT_RED diffuse:red
		mb2.material = Standard name:#MAT_GRN diffuse:green
		mb3.material = Standard name:#MAT_BLU diffuse:blue
	)
)
createdialog mbtest width:450
cui.RegisterDialogBar mbtest
'''


print(mxsstr)
rt.execute(mxsstr)
maxWindow = PySide2.QtWidgets.QWidget.find(rt.windows.getMaxHWnd())
def procCh(wd):
    chArr = wd.children()
    for cch in chArr:
        if type(cch) == PySide2.QtWidgets.QDockWidget:
            if cch.windowTitle() == 'Matbuttons':
                return cch
rw = procCh(maxWindow)
for i in rt.mbtest.controls:
    chwnd = i.hwnd[0]
    print('hwnd:{0} control:{1} (by name &amp;gt;&amp;gt; {2}) mat:{3}'.format(chwnd, i, getattr(rt.mbtest, getattr(i, 'name')) ,getattr(i,'Material')))
    ##print(''.format(chwnd, i, '==', getattr(rt.mbtest, getattr(i, 'name')) , 'mat:', getattr(i,'Material'))
stuctArr = rw.children()
class CBrowser(PySide2.QtWidgets.QMainWindow):
    def __init__(self, parent = maxWindow):
        super(CBrowser, self).__init__(parent)
        self.setCentralWidget(stuctArr[5])
        self.resize(850, 600)
cWindow = CBrowser()
cWindow.show()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 08:55:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12875532#M820</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-03T08:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12875611#M821</link>
      <description>&lt;P&gt;So materialbuttons itself could not be accessed it qt at all, as they are &lt;STRONG&gt;NOT&lt;/STRONG&gt;&amp;nbsp;a QT widgets?&lt;BR /&gt;And how do I use winAPI with that? Can I override these buttons behavior, so they do not show material browser on left click and just check/uncheck like standard checkButton, but still with material drag and drop?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 09:31:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12875611#M821</guid>
      <dc:creator>inquestudios</dc:creator>
      <dc:date>2024-07-03T09:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12875636#M822</link>
      <description>&lt;P&gt;they are not Qt...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 09:20:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12875636#M822</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-03T09:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12875705#M823</link>
      <description>&lt;P&gt;So can I disable&amp;nbsp;&lt;SPAN&gt;material browser on left click?&lt;BR /&gt;On/off functinality could be made by switching button image with on_picked handler.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;P.S. in 2019 if you click materialButton and without closing material browser click it again 3ds MAX crashes.&lt;BR /&gt;Bravo, Autodesk &lt;span class="lia-unicode-emoji" title=":clapping_hands:"&gt;👏&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":clapping_hands:"&gt;👏&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":clapping_hands:"&gt;👏&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 10:33:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12875705#M823</guid>
      <dc:creator>inquestudios</dc:creator>
      <dc:date>2024-07-03T10:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: PySide2 widget to drag and drop materials?</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12876642#M824</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14733650"&gt;@inquestudios&lt;/a&gt;&amp;nbsp;wrote:&lt;P&gt;&lt;SPAN&gt;P.S. in 2019 if you click materialButton and without closing material browser click it again 3ds MAX crashes.&lt;BR /&gt;Bravo, Autodesk &lt;span class="lia-unicode-emoji" title=":clapping_hands:"&gt;👏&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":clapping_hands:"&gt;👏&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":clapping_hands:"&gt;👏&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Very unlikely... the material browser window that opens is modal, it doesn't allow you to click anything else...&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 16:48:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside2-widget-to-drag-and-drop-materials/m-p/12876642#M824</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-07-03T16:48:02Z</dc:date>
    </item>
  </channel>
</rss>

