Maya Python Pyside2 GUI and Local Variable Passing Tutorial

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Search this Thread Display Modes
  4 Weeks Ago
Maya Python Pyside2 GUI and Local Variable Passing Tutorial

Hi,

I recently completed a Maya Python lesson for creating a Pyside2 GUI and passing local variables between definitions. These are two key things to know in order to create Python tools in Maya. I found the information on this a bit challenging to find, so I put together a simple lesson and template to share with all of you. Available in English and Urdu/Hindi.

http://www.madguru.com/learn/maya-p...ide2-local-vars

Thanks,

Adnan Hussain
http://www.madguru.com
 
  3 Weeks Ago
Line 75 has some code missing:
button.setStyleSheet("background-color: rgb(128,128,128); color: rgb(0,0,0") <-- At the end it should be )")


Why do you get the maya window as parent? Just wondering. There's no need to do that.

Good work!
 
  3 Weeks Ago
Thanks for the correction darkgaze . Corrected in the github file. Luckily, it only caused the color to be incorrect on the button letters. Thanks for letting me know. As for the maya window parent part, I simply included it as it was a part of one of several sources I used to figure this out and cobble together a working template. Good to know it is not absolutely needed. I hope you found the code useful. Part of sharing that is so great, is to get feedback and learn from others, so thank you.

Adnan
 
  3 Weeks Ago
You're welcome, :-)

Anything that can be a window itself (QDialog, QWindow and QWidget) if they don't have a parent, the maya window will be its parent by default.

It will appear as another window together grouped with the maya window, but if you don't want it to appear as a separated window but a toolbox inside Maya, you can use toolbox=true flag for native UI and I remember there was a similar way inside Qt, I don't remember it right now.

CHeers
 
  3 Weeks Ago
Thanks again! This is useful info.
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 04:08 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.