Hi. As written in the autodesk.com post, the way you write a UI like this is to create a transparent floating window, one without borders and title bar, positioned on top of the viewport. Then, it's the OS doing the alpha compositing, and everything works. This is how the hotbox and marking menus are implemented.
What is not working is creating a qt widget that is a transparent child of the viewport, for the technical reasons stated in that article. While that may seem like an issue, it's actually not what you would really want. You usually do not want to have a menu-like widget to be clipped by the viewport rectangle if the mouse was near the borders. You want that menu to appear around the mouse position, even if some of it would appear on top, for example, of the Attribute Editor, and you also want to get the mouse messages even when the mouse is not inside the viewport. The only way to do all of that that is to make it a separate always-on-top floating window. It will also redraw faster. On Friday, 8 May 2020 03:40:06 UTC-4, maks wrote: > > Hi, > I am trying to write a tool with a GUI similar to that: > https://youtu.be/ggQ8_IoDgl4?t=11 > I.e. making semi-transparent buttons around current mouse position. > > It seems that WA_TranslucentBackground doesn't work over viewport. I get > black fill where the tool's window overlaps with the viewport (works over > other GUI though.) > > Some googling gave me that: > https://knowledge.autodesk.com/support/maya/learn-explore/caas/sfdcarticles/sfdcarticles/How-Maya-handles-transparent-Qt-widget.html > > It seems that transparency over view-port is not supported? Like at all? > > I would appreciate any pointers of how could one go about writing a tool > like that. > > Thanks! > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ba2d88cd-c23f-41df-9bb7-41a8f000527c%40googlegroups.com.