Title Image

PySide2 for Maya (Vol. 2)

Level:
Advanced
Software:
Maya (2017+)
Language:
Python
Duration:
3 hours 59 minutes
Instructor:
Chris Zurbrigg

Become a Patron!

Overview

Further develop your Qt skills by exploring some of the more interesting, challenging and advanced functionality available when using PySide2 in Maya.
* This is a Patreon series. Project files and videos marked with a Patreon logo are Total Access exclusives.

Videos

20 Videos (3 hours 59 minutes)

00 - Introduction

A high level overview of what is upcoming in the second volume of the PySide2 for Maya series.

01 - QDialog vs. QWidget

A look at the differences between the QDialog and QWidget classes and how to create a window derived from QWidget.

02 - Adding Images (Part 1)

The next couple of lessons demonstrate two different methods for adding images to a Qt user interface. The first approach, covered in this video, takes advantage of the QDialog widget.

03 - Adding Images (Part 2)

Continuing on from the previous lesson, learn how to create a custom image widget that overrides the paintEvent method and uses the QPainter class to draw the final image.

04 - Traversing Directories

In this lesson, learn how to recursively traverse a directory and its subdirectories, using only Qt classes, to map the file hierarchy and create a custom file explorer dialog.

05 - Show in Folder (Part 1)

A popular feature found in many UIs that involve external files (scene files, textures, etc...) is the ability to open Explorer (or Finder) at the file’s location and selecting that file. Building on the previous example, this functionality will be explored, in detail, over the next two lessons.

06 - Show in Folder (Part 2)

To complete the Show in Folder example, the QDesktopServices and QProcess classes are leveraged to display Explorer/Finder using both an OS independent approach and separate OS dependent code paths that offer extra functionality.

07 - Custom Color Button (Part 1)

Over the next two lessons, learn to create a custom color button similar to the color swatch found in Maya’s colorSliderGrp control. This button displays a solid color, representing the active color, and clicking it brings up a color select dialog to change the color.

08 - Custom Color Button (Part 2)

In this lesson, the remaining functionality is added to the CustomColorButton class. This includes displaying the active color, implementing the left-click behavior and emitting a colorChanged signal whenever the color is modified.

09 - Embedding Maya Controls (Part 1)

Maya's native UI controls provide a great deal of functionality, and often a customized visual appearance, that is not directly available when constructing UIs with Qt.

For those who would like to include similar functionality in a Qt UI, it is often assumed that the only option is to recreate the controls as a custom Qt widget. Fortunately, this is not the case and in this mini-series I will demonstrate how a native Maya control can be embedded directly in a Qt UI.

10 - Embedding Maya Controls (Part 2)

Starting with the Custom Color Button example, I walk through the steps to replace the color buttons and color select dialog with Maya's native colorSliderGrp control.

11 - Embedding Maya Controls (Part 3)

With the colorSliderGrp control added to the UI, the next steps are to add accessor methods to query and edit the current color of the colorSliderGrp and add a callback on the control to emit a signal whenever the color changes.

12 - Embedding Maya Controls (Part 4)

In this final lesson of this mini-series, I investigate the cause of an error encountered near the end of the last lesson. Although the embedded control works for this example, it has some limitations that are exposed by this error, and subsequently fixed in this video, to provide a more robust and reusable widget.

13 - Light Panel Example (Part 1)

An overview of the Light Panel mini-project. This detailed example constructs a list of lights, with editable attributes, using custom widgets and introduces the QScrollArea widget. Additionally, Maya scriptJobs are covered in detail and used to keep the UI in sync when changes are made in the scene -- updating the UI when lights are added or deleted, and when a light's name or attributes change.

14 - Light Panel Example (Part 2)

Starting with a base dialog, in this lesson, a list of of custom LightItem widgets is constructed, one for each light in the current scene.

15 - Light Panel Example (Part 3)

Addressing two of the limitations in the the current UI, in this lesson, a vertical scrollbar is added to the light list and a method for clearing the lights from the list is implemented.

16 - Light Panel Example (Part 4)

The next step in building the Light Panel UI involves setting up all the widgets in the LightItem class and initializing their values to match the corresponding light attributes in the scene.

17 - Light Panel Example (Part 5)

In this lesson, functionality is added to the LightItem class that will update the light’s attribute values when changes are made to the individual widgets.

18 - Maya Script Jobs

A comprehensive look at Script Jobs in Maya, the types of events available for creating callbacks and some practical examples.

19 - Light Panel Example (Part 6)

In this lesson, code is added to manage the script jobs that will refresh the Light Panel’s UI whenever a new light is added to the scene or an undo operation occurs removing a light from the scene.

Additional Videos Coming Soon...