Showing posts with label PyMEL. Show all posts
Showing posts with label PyMEL. Show all posts

2023-11-11

prSelectionUi 2023.0 update with Python 3.0 support


A few months ago I released an update (2023.0) for prSelectionUi that supports Python 3 (Maya >2022.x). It also still works with older Maya versions (Python 2.0).

You can get it here: https://pazrot.gumroad.com/l/prselectionui

It still requires PyMEL to be installed, which sadly has become more difficult with the PyMEL installation switching to pip. I think that installation change was a bad call and I regret using PyMEL. The time I saved was not worth the time lost for the users, and I might now have to rewrite the script with maya.cmds anyways.

2017-03-03

2012-12-12

prSelectionUi updates


prSelectionUi - Animation UI (Maya) from Parzival Roethlein on Vimeo.

I recently updated the prSelectionUi quite a bit. The Vimeo video got updated as well, but since there have been new script updates, it does not show all new features. You can find the download link in the Vimeo description.

There is some background information in my old blogpost:
https://pazrot3d.blogspot.com/2012/03/prselectionui.html

2012-04-13

prSelectionUi - dynamic Maya Python UI

(The script got updated in December 2012, so there are some inaccuracies in this post now)


prSelectionUi - Animation UI (Maya)


This post is about my prSelectionUi.py Maya script, which was written in PyMEL. It is made to manage selections and poses. This can be useful during animation. The main problem were the dynamic UI elements and how to save/load the information in Maya

This script might also be a decent example on how to write PyMEL UI code? I am not sure, since I have not seen any other PyMEL UI scripts. I just used some features from the PyMEL documentation and the posting of one of the PyMEL authors, which is mentioned at the end of this post.

I have made selection UIs before, but they had to be made for each project. This UI is flexible and should work for any project. To save the rigger time, but also allow the animator to create the selections they want on the fly. The attached video shows all the functionality and there is also the open-source download link in the Vimeo video description.

The idea came from an animator friend (Harry Fast), who was not happy with the existing freely available selection scripts. So he asked me to create a new one. It is written in PyMEL and stores all information in Maya sets. That way you can create selections in the rig-file and the script can read those sets in the animation-shot (with referenced rig file). Also the animator can always create their own selections and import/export the sets between scenes.

The code can be summarized as six classes (UI, Tab, TabElement, Pose (TabElement), Selection (TabElement), Member), which inherit from Maya UI elements (window, formlayout, menuItem). There are maya-sets for tabs, selections and poses. The member information is stored in the selection-set attributes. The set types are identified with custom attributes. That way the scene-name of the set is not important. Also it is no problem if there are name clashes. If the set is from a reference file, the attributes can be edited in the shot. (If the animator is not happy with the default order/colors). Because all elements are dynamic I did not split the UI from the functionality. But I don't have a lot of UI programming experience, so I don't know the normal way. In the past I only created UIs the Maya/MEL way. But I am happy with the current classes, because it was easy to add new features and modify the existing ones.
The basic idea to inherit from PyMEL UI elements was from this post of Ofer Koren: https://www.mail-archive.com/python_inside_maya@googlegroups.com/msg01015.html

Here is a simple UML generated from the code using PyNSource - UML tool for Python. (It does not show that UI, Tab, TabElement and Member inherit from Maya UI elements.)