PyQt5 maya 2018 tutorials/information

908 views
Skip to first unread message

daniel...@gmail.com

unread,
Mar 5, 2018, 4:03:46 AM3/5/18
to Python Programming for Autodesk Maya
Does anyone here know some good tutorials/info about PyQt for maya 2017/2018. The only tutorials I find are several years old. I'm struggling to find information.

Justin Israel

unread,
Mar 5, 2018, 4:06:15 AM3/5/18
to python_in...@googlegroups.com


On Mon, Mar 5, 2018, 10:03 PM <daniel...@gmail.com> wrote:
Does anyone here know some good tutorials/info about PyQt for maya 2017/2018. The only tutorials I find are several years old. I'm struggling to find information.

Aside from a few api changes in Qt5, not too much has changed in the core information. The older tutorials still hold up well. At least that's what people are telling me on my YouTube training vids. 
Have you found the older tutorials to be difficult to follow in the newest Maya releases? 


--
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/d9200442-ff49-419f-9c73-2fc867111d3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marcus Ottosson

unread,
Mar 5, 2018, 4:43:08 AM3/5/18
to python_in...@googlegroups.com
Like Justin said, anything for Qt4 (Maya 2016 and below) is applicable to Qt5 (Maya 2017 and above) as well.

Then there are newer features, exclusive to Qt5, like QML for which there's the QML Book and YouTube series like the one by VoidRealm. Along with maybe a handful of open source examples, such as Cool Retro Term, Phoenix and LiriOS, and some commercial examples like Melodics, the Ableton Push's on-device GUI. And of course my own Pyblish :)

On 5 March 2018 at 09:05, Justin Israel <justin...@gmail.com> wrote:


On Mon, Mar 5, 2018, 10:03 PM <daniel...@gmail.com> wrote:
Does anyone here know some good tutorials/info about PyQt for maya 2017/2018. The only tutorials I find are several years old. I'm struggling to find information.

Aside from a few api changes in Qt5, not too much has changed in the core information. The older tutorials still hold up well. At least that's what people are telling me on my YouTube training vids. 
Have you found the older tutorials to be difficult to follow in the newest Maya releases? 

--
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+unsub...@googlegroups.com.

--
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+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2CuBdF41EWrXLDwz1uVGPXqLjV1g2C4cGd_280xTOS1w%40mail.gmail.com.

Joe Weidenbach

unread,
Mar 5, 2018, 6:12:45 AM3/5/18
to python_in...@googlegroups.com
I think the most challenging bit of the bulk of the tutorials being for Qt4 is that the code no longer 'just works' when you run it. The API's are pretty much the same, but the widget-based functionality now comes from the qtwidgets module instead of qtgui. It makes perfect sense for someone versed in qt, but I've had a heck of a time with it with my students, even after demonstrating a full PySide to PySide2 conversion. The fact that the tutorials use qtgui causes a stumbling block for newer coders, who might be learning python at the same time as PySide.

Explaining this to an experienced python developer is pretty painless, even if they're new to Qt, because they're not struggling with the concepts of modules which expose functionality. From my years of teaching, that was always the hardest concept to help students grasp. It's quite a leap to go from writing scripts in the script editor that do a thing to writing a library that can then be called, and 'import mylib' comes across in many cases as a bit of magic early on.

So no, I don't think the tutorials themselves are the issue (I know so many people that have benefited from Justin's YouTube series). I think it's more the lack of content for "here's how to get started in PySide2, here's what's going on, and if you want to know more, here's these other references. Keep in mind they use the old Qt4 model, so you'll need to be mindful of what classes they use and map those to the new modules". Similar to Justin's introduction to the PySide docs, but with an emphasis on Qt5/PySide2 and how to find which module a given class is part of. On that note, last I checked, the docs weren't there yet for PySide2, which is yet another challenge to new learners.

I also think (and I've been guilty of this) that a lot of instructors have moved to using pyside more than the old maya ui commands. This is great for getting folks versed in the UI tech they'd be using in-industry, but PySide with its multiple modules assumes an understanding of the more basic principles of Python that might not have developed yet for those learning it.

I could be wrong, but that's my impression from working with students.
On Mon, 5 Mar 2018 at 10:43 PM, Marcus Ottosson <konstr...@gmail.com> wrote:
Like Justin said, anything for Qt4 (Maya 2016 and below) is applicable to Qt5 (Maya 2017 and above) as well.

Then there are newer features, exclusive to Qt5, like QML for which there's the QML Book and YouTube series like the one by VoidRealm. Along with maybe a handful of open source examples, such as Cool Retro Term, Phoenix and LiriOS, and some commercial examples like Melodics, the Ableton Push's on-device GUI. And of course my own Pyblish :)
On 5 March 2018 at 09:05, Justin Israel <justin...@gmail.com> wrote:


On Mon, Mar 5, 2018, 10:03 PM <daniel...@gmail.com> wrote:
Does anyone here know some good tutorials/info about PyQt for maya 2017/2018. The only tutorials I find are several years old. I'm struggling to find information.

Aside from a few api changes in Qt5, not too much has changed in the core information. The older tutorials still hold up well. At least that's what people are telling me on my YouTube training vids. 
Have you found the older tutorials to be difficult to follow in the newest Maya releases? 

--
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.

--
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.

--
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/CAFRtmOCv3drWjsVOf64foq5t1JRtToBL1hJXSDftsU%2BN7PEL4g%40mail.gmail.com.

Marcus Ottosson

unread,
Mar 5, 2018, 6:51:46 AM3/5/18
to python_in...@googlegroups.com

@joe that’s a good point. Simply swapping QtGui for QtWidgets isn’t enough to cover all cases either, as not everything was moved.


On 5 March 2018 at 11:12, Joe Weidenbach <scd...@gmail.com> wrote:
I think the most challenging bit of the bulk of the tutorials being for Qt4 is that the code no longer 'just works' when you run it. The API's are pretty much the same, but the widget-based functionality now comes from the qtwidgets module instead of qtgui. It makes perfect sense for someone versed in qt, but I've had a heck of a time with it with my students, even after demonstrating a full PySide to PySide2 conversion. The fact that the tutorials use qtgui causes a stumbling block for newer coders, who might be learning python at the same time as PySide.

Explaining this to an experienced python developer is pretty painless, even if they're new to Qt, because they're not struggling with the concepts of modules which expose functionality. From my years of teaching, that was always the hardest concept to help students grasp. It's quite a leap to go from writing scripts in the script editor that do a thing to writing a library that can then be called, and 'import mylib' comes across in many cases as a bit of magic early on.

So no, I don't think the tutorials themselves are the issue (I know so many people that have benefited from Justin's YouTube series). I think it's more the lack of content for "here's how to get started in PySide2, here's what's going on, and if you want to know more, here's these other references. Keep in mind they use the old Qt4 model, so you'll need to be mindful of what classes they use and map those to the new modules". Similar to Justin's introduction to the PySide docs, but with an emphasis on Qt5/PySide2 and how to find which module a given class is part of. On that note, last I checked, the docs weren't there yet for PySide2, which is yet another challenge to new learners.

I also think (and I've been guilty of this) that a lot of instructors have moved to using pyside more than the old maya ui commands. This is great for getting folks versed in the UI tech they'd be using in-industry, but PySide with its multiple modules assumes an understanding of the more basic principles of Python that might not have developed yet for those learning it.

I could be wrong, but that's my impression from working with students.
On Mon, 5 Mar 2018 at 10:43 PM, Marcus Ottosson <konstr...@gmail.com> wrote:
Like Justin said, anything for Qt4 (Maya 2016 and below) is applicable to Qt5 (Maya 2017 and above) as well.

Then there are newer features, exclusive to Qt5, like QML for which there's the QML Book and YouTube series like the one by VoidRealm. Along with maybe a handful of open source examples, such as Cool Retro Term, Phoenix and LiriOS, and some commercial examples like Melodics, the Ableton Push's on-device GUI. And of course my own Pyblish :)
On 5 March 2018 at 09:05, Justin Israel <justin...@gmail.com> wrote:


On Mon, Mar 5, 2018, 10:03 PM <daniel...@gmail.com> wrote:
Does anyone here know some good tutorials/info about PyQt for maya 2017/2018. The only tutorials I find are several years old. I'm struggling to find information.

Aside from a few api changes in Qt5, not too much has changed in the core information. The older tutorials still hold up well. At least that's what people are telling me on my YouTube training vids. 
Have you found the older tutorials to be difficult to follow in the newest Maya releases? 

--
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+unsub...@googlegroups.com.

--
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+unsub...@googlegroups.com.

--
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+unsub...@googlegroups.com.

--
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+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da66kSPHeaeTPEO6dmgsvmxurriL-2aOZSMLeK%3DR1tVdHQ%40mail.gmail.com.

Justin Israel

unread,
Mar 5, 2018, 1:22:25 PM3/5/18
to python_in...@googlegroups.com


On Tue, Mar 6, 2018, 12:51 AM Marcus Ottosson <konstr...@gmail.com> wrote:

@joe that’s a good point. Simply swapping QtGui for QtWidgets isn’t enough to cover all cases either, as not everything was moved.


So then maybe the best approach is to not look for "Maya 2017/2018 PySide tutorials". Rather, just looking for introduction to pyside2 would be best. After one gets an intro, they can refer to older Maya specific tutorials. 


On 5 March 2018 at 11:12, Joe Weidenbach <scd...@gmail.com> wrote:
I think the most challenging bit of the bulk of the tutorials being for Qt4 is that the code no longer 'just works' when you run it. The API's are pretty much the same, but the widget-based functionality now comes from the qtwidgets module instead of qtgui. It makes perfect sense for someone versed in qt, but I've had a heck of a time with it with my students, even after demonstrating a full PySide to PySide2 conversion. The fact that the tutorials use qtgui causes a stumbling block for newer coders, who might be learning python at the same time as PySide.

Explaining this to an experienced python developer is pretty painless, even if they're new to Qt, because they're not struggling with the concepts of modules which expose functionality. From my years of teaching, that was always the hardest concept to help students grasp. It's quite a leap to go from writing scripts in the script editor that do a thing to writing a library that can then be called, and 'import mylib' comes across in many cases as a bit of magic early on.

So no, I don't think the tutorials themselves are the issue (I know so many people that have benefited from Justin's YouTube series). I think it's more the lack of content for "here's how to get started in PySide2, here's what's going on, and if you want to know more, here's these other references. Keep in mind they use the old Qt4 model, so you'll need to be mindful of what classes they use and map those to the new modules". Similar to Justin's introduction to the PySide docs, but with an emphasis on Qt5/PySide2 and how to find which module a given class is part of. On that note, last I checked, the docs weren't there yet for PySide2, which is yet another challenge to new learners.

I also think (and I've been guilty of this) that a lot of instructors have moved to using pyside more than the old maya ui commands. This is great for getting folks versed in the UI tech they'd be using in-industry, but PySide with its multiple modules assumes an understanding of the more basic principles of Python that might not have developed yet for those learning it.

I could be wrong, but that's my impression from working with students.
On Mon, 5 Mar 2018 at 10:43 PM, Marcus Ottosson <konstr...@gmail.com> wrote:
Like Justin said, anything for Qt4 (Maya 2016 and below) is applicable to Qt5 (Maya 2017 and above) as well.

Then there are newer features, exclusive to Qt5, like QML for which there's the QML Book and YouTube series like the one by VoidRealm. Along with maybe a handful of open source examples, such as Cool Retro Term, Phoenix and LiriOS, and some commercial examples like Melodics, the Ableton Push's on-device GUI. And of course my own Pyblish :)
On 5 March 2018 at 09:05, Justin Israel <justin...@gmail.com> wrote:


On Mon, Mar 5, 2018, 10:03 PM <daniel...@gmail.com> wrote:
Does anyone here know some good tutorials/info about PyQt for maya 2017/2018. The only tutorials I find are several years old. I'm struggling to find information.

Aside from a few api changes in Qt5, not too much has changed in the core information. The older tutorials still hold up well. At least that's what people are telling me on my YouTube training vids. 
Have you found the older tutorials to be difficult to follow in the newest Maya releases? 

--
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.

--
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.

--
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.

--
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.

--
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/CAFRtmOD-%2B8GQCXNJx-Vwog47yQM1ssoEja1abACykos1KvoH-A%40mail.gmail.com.

daniel...@gmail.com

unread,
Mar 6, 2018, 12:05:21 AM3/6/18
to Python Programming for Autodesk Maya
Op maandag 5 maart 2018 01:03:46 UTC-8 schreef daniel...@gmail.com:
> Does anyone here know some good tutorials/info about PyQt for maya 2017/2018. The only tutorials I find are several years old. I'm struggling to find information.

Thank you so much for all the info. As an artist who knows python and wants to learn Qt5 and Pyside2 it all seems a little confusing. I'll google introduction to pyside2 and see what I can find. Justin, do you think your "PyQt4 UI Development for Maya" is still a good start for PyQt5 and Pyside2? I really liked both of your "Python For Maya Artists" tutorials a few years ago.

Marcus Ottosson

unread,
Mar 6, 2018, 1:44:08 AM3/6/18
to python_in...@googlegroups.com

I think so.

The most common error you should find is..

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'QtGui' has no attribute 'QPushButton'

Where QPushButton is some widget you are trying to instantiate. When that happens, try replacing QtGui with QtWidgets.

Then, to gain a better understanding of where a widget is before getting an error, you can look it up.

  1. Go to the Qt Class List
  2. Find your widget, e.g. QPushButton
  3. See which module it belongs to, e.g. QT += widgets, which in Python speak is QtWidgets

Inline images 1

Hope it helps!


--
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+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/32972c5c-8af6-452f-a568-3e798254d3e7%40googlegroups.com.

Justin Israel

unread,
Mar 6, 2018, 4:50:09 AM3/6/18
to python_in...@googlegroups.com
Yep, I would follow the tips Marcus provided. There are only a few differences to be aware of, and once you know them you should be able to apply any Qt tutorial. 

On Tue, Mar 6, 2018, 7:44 PM Marcus Ottosson <konstr...@gmail.com> wrote:

I think so.

The most common error you should find is..

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'QtGui' has no attribute 'QPushButton'

Where QPushButton is some widget you are trying to instantiate. When that happens, try replacing QtGui with QtWidgets.

Then, to gain a better understanding of where a widget is before getting an error, you can look it up.

  1. Go to the Qt Class List
  2. Find your widget, e.g. QPushButton
  3. See which module it belongs to, e.g. QT += widgets, which in Python speak is QtWidgets

Inline images 1

Hope it helps!

On 6 March 2018 at 05:05, <daniel...@gmail.com> wrote:
Op maandag 5 maart 2018 01:03:46 UTC-8 schreef daniel...@gmail.com:
> Does anyone here know some good tutorials/info about PyQt for maya 2017/2018. The only tutorials I find are several years old. I'm struggling to find information.

Thank you so much for all the info. As an artist who knows python and wants to learn Qt5 and Pyside2 it all seems a little confusing. I'll google introduction to pyside2 and see what I can find. Justin, do you think your "PyQt4 UI Development for Maya" is still a good start for PyQt5 and Pyside2? I really liked both of your "Python For Maya Artists" tutorials a few years ago.

--
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.

--
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/CAFRtmOBSkCeXhe4yjwP6jqsD_oLAn_97Sukc6SwR75kFmPtJDA%40mail.gmail.com.

AK Eric

unread,
Mar 6, 2018, 2:31:01 PM3/6/18
to Python Programming for Autodesk Maya
I recently had to port all our stuff to support both PySide & PySide2, ugh.  Since this thread is along those lines, this is the solution I came up with at the top of my modules since we have multiple versions of Maya running:

Simple example import section:
import maya.cmds as mc
MAYA_VER = int(mc.about(version=True))
if MAYA_VER <= 2016:
    from PySide.QtGui import QWidget, QMainWindow, QDialog, QAbstractButton, QIcon
    from shiboken import wrapInstance
    import pysideuic
else:
    from PySide2.QtGui import QIcon
    from PySide2.QtWidgets import QWidget, QMainWindow, QDialog, QAbstractButton
    from shiboken2 import wrapInstance
    import pyside2uic as pysideuic

To make my life easier (similar to what Marcus said above) trying to figure out where the classes moved, I'd have these three tabs open:

So I'd select some class name, like 'QIcon', then do a search on each page looking for it:  That would quickly tell me which new qt5 module it lived in for those style imports.
Boy I can't wait util qt6! ;)

Marcus Ottosson

unread,
Mar 6, 2018, 3:36:17 PM3/6/18
to python_in...@googlegroups.com
Came to think of a more recent tutorial for Maya and PySide2 by a really good pipeline enginner over at Sony Imageworks, Dhruv Govil.

https://www.udemy.com/python-for-maya/

florian...@gmail.com

unread,
Mar 8, 2018, 3:06:17 AM3/8/18
to Python Programming for Autodesk Maya
I can also recommend that tutorial series.

Florian
Reply all
Reply to author
Forward
0 new messages