Maya Tools is a small toolset used to communicate with Maya from directly inside Keyframe Pro.
The sync functionality provided by Maya Tools allows the current time in Keyframe Pro to control Maya's timeline. In combination with the Maya to Keyframe Pro script, a two-way timeline sync can be established.
Before Keyframe Pro can communicate with Maya a commandPort must be opened by Maya.
The following Python snippet can be used to open a commandPort in Maya. This script can be executed in Maya's script editor, as a shelf button or automatically when Maya launches as part of userSetup.py:
import maya.cmds as cmds cmds.commandPort(name=":20180")
Note: The default port used by Keyframe Pro is 20180 however this can be changed in the Preferences.
Opening the commandPort on Maya Startup
- In the Maya scripts directory create a file named "userSetup.py" (if it doesn't exist)
- Open the file in a text editor
- Add the Python code snippet provided above
- Restart Maya
Clicking the Sync button establishes a connection with Maya. If the connection is successful, the Sync button will turn blue and changes to Keyframe Pro's current time will be reflected in Maya.
The Console will display an error message if the connections fails. The connection will fail if Maya is closed, a commandPort is not opened by Maya or one of the applications is blocked by a firewall.
- A fixed number of frames added to, or subtracted from, the current frame passed to Maya.
- From Range Start
- Use Maya's range start as a relative offset.
- Multiply the current frame by this value before sending it to Maya.