Duduf Tweener for Maya
DuTween is a Tween Machine for Autodesk Maya working with all versions of Maya, in either Python 2 or Python 3. It is very simple and focuses on ease of use and performance.
-
Copy
DuTween.py
to a plug-ins folder in Maya. It can be in the installation folder of Maya for all users, or simply in themaya
subdirectory of your documents.
e.g. on Windows:C:\users\yourName\documents\maya\plug-ins
. -
Restart Maya if it was running.
-
Enable the plugin via
Windows ► Settings/Preferences ► Plug-in Manager
.
You can also simply open and run the script without installation if you prefer. Just open the script in the script editor and run it.
Tweening is available via a Maya command which you can add to any shelf, or assign a shorcut. You can also simply open and run the script without installation.
An icon dutween.png
is provided to be used in shelves if you wish.
The command is dutween
.
When used without parameters, it shows a simple user interface with a slider and a value to tween the selected objects. If some attributes are selected in the attribute editor, only these attributes are tweened. To improve performance, don't add too many keyframes: the less keyframes there are, the quicker it will be.
# Python
import maya.cmds as cmds
cmds.dutween()
// Mel
dutween
You can also use some parameters to automatically add a keyframe without showing the interface, for example to use it in your own scripts, or to add buttons with predefined values in a shelf.
ratio
orr
: a value in the range[0.0, 1.0]
. Sets the tweening ratio.
# Python
import maya.cmds as cmds
cmds.dutween(r=0.75)
// Mel
dutween -r 0.75