Eugen Sares, Stefan Kubicek
Ritalin – simpler camera navigation in Maya’s viewports
Ritalin is a Python script for Maya that improves camera navigation by automatically setting the camera’s tumble pivot to the center of your current selection whenever the selection changes or the selected objects are transformed. This happens all automatic, you don’t need to do anything else but work as you normally do, except that you don’t need to constantly take care of focusing your camera manually (normally by pressing F).
Motivation
When you have a background in 3dsMax, Softimage or Lightwave, you might miss certain convenience features like automatic centering the cameras interest on the current selection, that allows you to tumble the camera around the center of the current selection without having to press the F key (or Z in 3dsMax) and then dolly in and out again to fit whatever you’ve been working on properly on screen. Autodesk seems to have planned such a feature for Maya too, but never got around to implementing it in a truly usable way. In any view click View->Camera Tools->Tumble Tool (the little config box to the right of it actually). And there it is: A check box labeled „Tumble on object“. That sounds nice, but unfortunately it only works for those objects directly under the mouse pointer (which makes it hard to control when objects overlap), and fails on many common object types, like joints or lights.
Another feature you might miss is that Maya does not remember the selected components on an object when changing selection filters, e.g. from edges to vertices. With such a feature, vertices, which were were selected before changing to the edge selection filter, will be reselected for the user automatically when he switches back to selecting vertices. Very intuitive to use, easy to understand, non-intrusive, and a real time saver for people who want to (or have to) work non-linearly on many things more or less at the same time. Fortunately, almost all programs have adopted this paradigm, except Maya.
Enter Ritalin, a Python script that will automatically set your camera’s tumble pivots when the selection changes in the scene, and even when your selection is transformed. It also stores selected components on polygonal meshes when switching between component types. Some special case handling has been added for your convenience that centers the tumble pivots on the currently active deformer (e.g. joint) when painting skin weights on a mesh, which is a huge time saver when painting hard to see or detailed areas like a character’s fingers, where a considerable amount of time is usually spent on adjusting the camera in such a way that it tumbles without constantly loosing the paintable area out of sight, and where pressing F on your keyboard usually doesn’t help because it will center on the selected mesh that is currently being painted on, instead of the active deformer.
Features
- Centers the cameras tumble pivot on your current selection automatically
- When painting skin weights, will automatically tumble the camera around the currently active deformer for which skin weights are being painted – good for painting and navigating around small or hard to see areas and joints/deformers.
- Entirely non-intrusive. Enable Ritalin from the pull-down menu and your camera will behave like in 3dsMax and maya. No extra buttons required, no strings attached.
- Remembers/reselects vertex, edge and polygon component selections on poly objects when switching between component selection types and/or from component to object selection.
- Component selections are even remembered and correctly restored when the objects topology is changed (e.g. edges added or removed).
Feature Videos
Automatic camera tumbling
(without sound)
Auto-Remembering component selections
Installation
- Download Ritalin suitable for your version of Maya from http://code.google.com/p/keyvis-dev/downloads/list
- Unpack and copy the files to your user scripts directory.
Under WindowsXP this folder is normally normally located at
C:\Documents and Settings\-YourUserName-\My Documents\maya\2009-x64\scripts
Under Windows 7 (and I think Vista too) the path usually is
C:\Users\-YourUserName-\Documents\maya\2011-x64\scripts
Your actual path depends on your user name and Maya version you want to install this for, so it will most likely look slightly different compared to above examples. - If this folder already contains a userSetup.py, just copy the contents from the userSetup.py that comes with Ritalin and paste it at the end of your already existent useSetup.py file. Change the file path according to your user name, user scripts folder location and Maya version. Save it.
The mechanism is that Maya always runs any script code in the userSetup.py file automatically when it starts. We’re simply using this mechanism to load Ritalin on startup. - (Re)start Maya. A Ritalin menu should appear in the main menu bar. You can disable or re-enable Ritalin there. There’s also an option to disable skin weight painting integration separately.
Deinstallation
Just delete the files from your user scripts folder.
In case you have modified your userSetup.py file, comment out, or remove, the line you copied into it too.
Technical Information
The archive contains a modified version of a mel file that ships with Maya – artAttrSkinCallback.mel.
It is important that the Ritalin’ed version of it gets sourced after Maya has sourced the original file from its native …\scripts\others folder for the code change to take effect.
Note: The modified file only enables paint skin weights tool panel integration, and only some lines were added at the end of the global artSkinSelectInfluence procedure.
If you are using a modified version of this file in your own pipeline you might want to add the extra lines to the same function in your version of the file instead of replacing the whole file. In case this is not practical, simply not copy the file at all, you will simply have to live without paint skin weights tool panel integration (clicking on a deformer in the paint tool panel will not center the camera’s tumble pivot on it automatically). However, you will still be able to use Ritalin when right-clicking over a deformer in th viewport and choosing „Paint Weights“ from the context menu to set the tumble pivots. Anything else will work normally.
Uninstall:
Just delete the files from your user scripts folder.
In case you have modified your userSetup.py file, comment out, or remove, the line you copied into it too.
Future development and improvements
Any suggestions? Drop us an email.
Bugs and limitations
To report bugs please visit http://code.google.com/p/keyvis-dev/issues/list
Ritalin is open source and can be checked out from google code via Subversion. If you have scripting and/or C++ coding experience, please feel free to contribute to the project by adding features or fixing bugs.