the second question is, what would be the best way to have the widget to be drawn again when the user change the size of the UI, when he switches from attribute editor to channel box etc? Please see attached gif:
Are you just using MPxDrawOverride? If so, how can you achieve widget-like behavior (like a button) with DrawOverride classes?
Yes! You can ask Maya for the OpenGL or DirectX context, and use it like you would in a normal standalone application.
If so, how can you achieve widget-like behavior (like a button) with DrawOverride classes?
There are likely many ways, but we went the route of implementing a MPxManipulator which captures mouse movements and blocks other Maya inputs at the same time. From there, you would draw graphics and interpret mouse inputs like any normal application.
This does deserve a longer write-up, because I don’t know of any resource for it. I cautiously experimented my way forwards and was happy and surprised it “just worked”.
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/84965d5e-1787-4528-a583-1adb83f96780n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/de459ef4-a021-48ad-8a71-c39b273cc5dcn%40googlegroups.com.