Showing posts with label UI. Show all posts
Showing posts with label UI. 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.

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-10-07

My default Maya settings

Here are some Maya settings I prefer over the default ones. Maybe there is something useful for someone else. It's all MEL code, so it can be copied in the script editor.
//

// Switch file browsing to OS native browser
// Reason: _Slow_, missing features, bugs 
//  (delete shortcut to folder will delete folder, ...)
// Menu: Window > Settings/Preferences > Settings > Files/Projects
optionVar -iv FileDialogStyle 1;
 
// To show file extensions in filter settings
optionVar -iv FileDialogHideExtension false;

// Increase undo queue size
// Window > Settings/Preferences > Preferences > Settings > Undo
undoInfo -length 150;

// Disable mouse scroll wheel in viewport (will still work in menus, etc)
// Reason: Undo gets broken if you scroll the mouse, while the mouse-wheel is pressed.
// Menu: Windows > Settings/Preferences > Preferences > Interface > Devices > Mouse scroll wheel
mouse -enableScrollWheel false;
 
// hotBox transparency to 0%
// Reason: It is easier / faster to read
// Menu: Right quarter in hotbox: Hotbox controls > Set transparency
hotBox -tr 0;
 
// Grey background color, like the default in older Maya versions
// Menu: Windows > Settings/Preferences > Color Settings
// Default shortcut: alt+b
displayRGBColor "background" 0.631 0.631 0.631;
// displayRGBColor -q "background";// Get current background color:
 
// Hide UI elements 
// Reason: Increase viewport space. 
// Menu: Display > UI Elements > ... 
// Or right click on a double dotted line on the edge of a visible UI element (status bar, timeline, ...) 
// Or hotBox, left-click in empty space in the right quarter. 
ToggleModelEditorBars;// Every option can be reached with two clicks 
toggleUIComponentVisibility "Tool Box";// Using default shortcutsQWERZY... instead. And top quarter of hotbox for camera setups 
//toggleUIComponentVisibility "Range Slider";// I rarely change it 
toggleUIComponentVisibility "Help Line";// Not usefull after using Maya for years 
//toggleUIComponentVisibility "Status Line";
toggleUIComponentVisibility "Shelf"; 
 
// Disable the interactive Polygon / NURBS creation. 
// Reason: To save clicks / time. I get to the desired shape faster using modeling tools. 
// Menu: Create / NURBS Primitives / Interactive Creation 
/*// only works after menu has been opened 
optionVar -intValue createNurbsPrimitiveAsTool 0;// nurbs 
menuItem -e -cb 0 toggleCreateNurbsPrimitivesAsToolItem; // nurbs 
optionVar -intValue createPolyPrimitiveAsTool 0;// poly 
menuItem -e -cb 0 toggleCreatePolyPrimitivesAsToolItem;// poly 
*/
// Playback range of 100 frames. 
// Reason: More frames for deformation test animations. Still easy to identify each frame 
playbackOptions -min 1 -max 100; 
// This is also a "New Scene" option, so to fix it there: 
optionVar -fv playbackMinDefault 1; 
optionVar -fv playbackMaxDefault 100; 
optionVar -fv playbackMinRangeDefault 1; 
optionVar -fv playbackMaxRangeDefault 100; 
 
// Hotbox show one type only (animation, ...)  
// Reason: I use the hotbox for most operations, so I want it to be small to be able to click faster. 
hotBox -ao; setMenuMode animationMenuSet;// updateHotboxOptionVarSettings(); 
 
// Remove viewcube  
// Reason: Save space, it does not help me. 
viewManip -visible off; optionVar -iv viewCubeShowCube 0; 
 
// More precise channel box attribute sliding 
channelBoxSettings hyperbolic true; 
 
// More precise channel box display 
global string $gChannelBoxName; 
channelBox -e -precision 4 $gChannelBoxName; 
 
// Heads-up display 
// Display > Heads Up Display > Poly Count 
setPolyCountVisibility 1; 
// Display > Heads Up Display > Frame Rate 
setFrameRateVisibility 1; 
 
// Linear animation curves (for test animations / skinning) 
keyTangent -global -itt linear; keyTangent -global -ott linear; 

// Reduce camera animation time
// Window > Settings/Preferences > Preferences > Settings > Camera > Animate Camera Transitions > Total Time
optionVar -fv "totalAnimateRollTime" 0.1;

// command line: hold focus
// Preferences > Interface > Interface > Command Line [] Hold focus
optionVar -iv commandLineHoldFocus true; commandLine -e -holdFocus true $gCommandLine;
 
// Save preferences 
SavePreferences; 
saveToolSettings; 
 
// -----------------------------------------
// MANUAL SETTINGS / TEST
// -----------------------------------------
// Disable "Automatic Orient Joints" in Move tool 
// The following command does not work, because it will not get stored to the default move tool context. 
// string $myMoveContext = `manipMoveContext`; 
// manipMoveContext -e -orientJointEnabled 0 $myMoveContext; 
 
// Hypershade: Hide left and top areas, so only work area is left. Also change material display from icon to list, so materials/textures do not get loaded when opening hypershade 
// Note: Hypershade settings do not seem to get stored (except position and window size, maybe write in usersetup file)?... 
 
// In Paint skin weights tool disable "Display > XRay Joints" because when leaving tool xray joint stays active and I rarely use it in the first place 
 
// Show > Isolate Select > Auto Load New Objects 
// string $eachPanel; 
// for ($eachPanel in `get all panels`){ 
// isoSelectAutoAddNewObjs $eachPanel true; } 
//
// -----------------------------------------
// 2014
// -----------------------------------------
// ignore version
optionVar -intValue fileIgnoreVersion true;
// incremental save
// edge flow 1.0 everywhere
// 
//

Some Maya related Windows settings I like to change::
  • Computer > Properties > Advanced System settings > Advanced > Performance > Visual Effects > Adjust for best performance
  • Mouse: Increase speed, disable "precision" (mouse accelleration)
  • Taskbar: Small icons, do not combine icons/tabs

Result will look like this on Windows 7

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