<?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 Pyside Translucent Window Feature Not Working in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside-translucent-window-feature-not-working/m-p/7876850#M10875</link>
    <description>&lt;P&gt;This is a pretty superficial post but I figured I'd add it anyway and see what comes of it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been wanting to create more unique, visually pleasing interfaces for a while now. One of the main things I would love to add to a small window is a translucent/transparent effect on just the background of the Window (not buttons and text and everything else on top). I searched for this and came up with a few suggestions but none of them worked they were the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Setting the widget's QtCore.Qt.WA_TranslucentBackground attribute to true:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - This just turns the background black.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;self.setAttribute(QtCore.Qt.WA_TranslucentBackground, True)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Setting the window opacity to a given value between 0.0 and 1.0:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- This set the opacity for EVERYTHING in the window. Buttons, fields, text, and all. Not what I hoped for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;self.setWindowOpacity(.75)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And there were other suggestions that I didn't understand nor did I know how to implement.&amp;nbsp;I would love to be able to use a png file with transparency for the widget background and have it show through. Not sure if this is possible or not or if Max would even allow for it but I figured I'd ask anyway. Thanks.&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;Here are some images for the look I want to go for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://i.stack.imgur.com/FrgcD.jpg" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="29366523_10155682072407917_164112276633157632_o.jpg" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/479306iB0D9EFAFEC624D15/image-size/large?v=v2&amp;amp;px=999" role="button" title="29366523_10155682072407917_164112276633157632_o.jpg" alt="29366523_10155682072407917_164112276633157632_o.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Flat-UI-KIT.jpg" style="width: 428px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/479310i0E8280EF17BD018A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Flat-UI-KIT.jpg" alt="Flat-UI-KIT.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zen_ui_kit-760x570.jpg" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/479309i174726F102AA752D/image-size/large?v=v2&amp;amp;px=999" role="button" title="zen_ui_kit-760x570.jpg" alt="zen_ui_kit-760x570.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Mar 2018 21:55:21 GMT</pubDate>
    <dc:creator>Huston94</dc:creator>
    <dc:date>2018-03-22T21:55:21Z</dc:date>
    <item>
      <title>Pyside Translucent Window Feature Not Working</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside-translucent-window-feature-not-working/m-p/7876850#M10875</link>
      <description>&lt;P&gt;This is a pretty superficial post but I figured I'd add it anyway and see what comes of it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been wanting to create more unique, visually pleasing interfaces for a while now. One of the main things I would love to add to a small window is a translucent/transparent effect on just the background of the Window (not buttons and text and everything else on top). I searched for this and came up with a few suggestions but none of them worked they were the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Setting the widget's QtCore.Qt.WA_TranslucentBackground attribute to true:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - This just turns the background black.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;self.setAttribute(QtCore.Qt.WA_TranslucentBackground, True)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Setting the window opacity to a given value between 0.0 and 1.0:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- This set the opacity for EVERYTHING in the window. Buttons, fields, text, and all. Not what I hoped for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;self.setWindowOpacity(.75)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And there were other suggestions that I didn't understand nor did I know how to implement.&amp;nbsp;I would love to be able to use a png file with transparency for the widget background and have it show through. Not sure if this is possible or not or if Max would even allow for it but I figured I'd ask anyway. Thanks.&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;Here are some images for the look I want to go for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://i.stack.imgur.com/FrgcD.jpg" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="29366523_10155682072407917_164112276633157632_o.jpg" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/479306iB0D9EFAFEC624D15/image-size/large?v=v2&amp;amp;px=999" role="button" title="29366523_10155682072407917_164112276633157632_o.jpg" alt="29366523_10155682072407917_164112276633157632_o.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Flat-UI-KIT.jpg" style="width: 428px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/479310i0E8280EF17BD018A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Flat-UI-KIT.jpg" alt="Flat-UI-KIT.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zen_ui_kit-760x570.jpg" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/479309i174726F102AA752D/image-size/large?v=v2&amp;amp;px=999" role="button" title="zen_ui_kit-760x570.jpg" alt="zen_ui_kit-760x570.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 21:55:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside-translucent-window-feature-not-working/m-p/7876850#M10875</guid>
      <dc:creator>Huston94</dc:creator>
      <dc:date>2018-03-22T21:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Pyside Translucent Window Feature Not Working</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside-translucent-window-feature-not-working/m-p/7878723#M10876</link>
      <description>&lt;P&gt;This is an interesting question.&amp;nbsp; With PySide, you could override the paint event of a QWidget to control the transparency, but that no longer seems to be working with PySide2.&amp;nbsp; I wonder if you could do something in QML?&amp;nbsp; I'll have to try this out when I have a chance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Drew&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 13:51:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside-translucent-window-feature-not-working/m-p/7878723#M10876</guid>
      <dc:creator>drew_avis</dc:creator>
      <dc:date>2018-03-23T13:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Pyside Translucent Window Feature Not Working</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside-translucent-window-feature-not-working/m-p/7879680#M10877</link>
      <description>&lt;P&gt;Yeah the Paint Event thing was something else I saw while researching into this. I just don't really know what it is, how it works, or how to go about manipulating it. lol&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 17:58:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside-translucent-window-feature-not-working/m-p/7879680#M10877</guid>
      <dc:creator>Huston94</dc:creator>
      <dc:date>2018-03-23T17:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Pyside Translucent Window Feature Not Working</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside-translucent-window-feature-not-working/m-p/7881230#M10878</link>
      <description>&lt;P&gt;Alrighty, I have good news and bad news.&amp;nbsp; The good news is&amp;nbsp;I have a demo that gives you a semi-transparent background and non-transparent child widgets in Pyside2 in Max.&amp;nbsp; The bad news is that this requires setting Qt.FramelessWindowHint, which means you can't easily move or resize the window (at least not using the native windowing system).&amp;nbsp; Anyway, here's the demo, maybe you can do something with it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;# Transparent PySide Widget
from PySide2 import QtGui, QtCore, QtWidgets
import MaxPlus

# protect from garbage collection:
class _GCProtector(object):
	widgets = []

def main():		
	w = TranspGui()
	w.run()

class TranspGui( QtWidgets.QWidget):
	def __init__(self, parent=MaxPlus.GetQMaxMainWindow()):		
		QtWidgets.QWidget.__init__(self)		
		self.setWindowFlags(QtCore.Qt.FramelessWindowHint) 
		self.setAttribute(QtCore.Qt.WA_TranslucentBackground)		

		emptylbl = QtWidgets.QLabel("",self)
		groupBox = QtWidgets.QGroupBox("Demo", self)
		main_layout = QtWidgets.QVBoxLayout()
	
		self.load_btn = QtWidgets.QPushButton("A Button")
		self.load_btn.setAutoFillBackground(True)
		main_layout.addWidget(self.load_btn)
		
		self.text_lbl = QtWidgets.QLabel("Transparent GUI")
		self.text_lbl.setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
		self.text_lbl.setFixedSize(200,200)
		self.text_lbl.setWordWrap(True)
		main_layout.addWidget(self.text_lbl)
		
		self.image_lbl = QtWidgets.QLabel(self)
		main_layout.addWidget(self.image_lbl)
		# self.image_lbl.setFixedSize(200,300)

		self.prev_btn = QtWidgets.QPushButton("Another Button")
		main_layout.addWidget(self.prev_btn)	
		
		self.next_btn = QtWidgets.QPushButton("More Buttons")
		# self.next_btn.clicked.connect(self.click_next)
		main_layout.addWidget(self.next_btn)	
	
		self.close_btn = QtWidgets.QPushButton("Close")
		self.close_btn.clicked.connect(self.click_close)
		main_layout.addWidget(self.close_btn)	
		
		groupBox.setLayout(main_layout)	
		#groupBox.move(100,200)
		
		self.resize(400, 400)	
		_GCProtector.widgets.append(self)			
	
	
	def run(self):
		self.show()
		
	def click_close(self):
		self.hide()
	
	def paintEvent(self, e):
		super(TranspGui, self).paintEvent(e)
		painter = QtGui.QPainter()
		painter.begin(self)		
		painter.fillRect( 0, 0, self.width(), self.height(), QtGui.QColor( 0,0,0,200))
		painter.setCompositionMode(QtGui.QPainter.CompositionMode_Source)
		painter.end()

if __name__ == '__main__':
	main()
&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 Mar 2018 14:44:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/pyside-translucent-window-feature-not-working/m-p/7881230#M10878</guid>
      <dc:creator>drew_avis</dc:creator>
      <dc:date>2018-03-24T14:44:45Z</dc:date>
    </item>
  </channel>
</rss>

