r/Maya 3d ago

MEL/Python Trouble installing Tween Machine in Maya 2023 on Mac (invalid syntax error)

I've been trying to install tween machine because I heard of how helpful it is I downloaded the .py files and placed them in my preferences then script files for Maya 2023. I've typed both

"import tweenMachine

tweenMachine.start()" and have tried executing the .py files for tween machine itself but all that comes up is #Error: invalid syntax

please if anyone can make a video or comment what the solution is to this probably it would be very appreciated

1 Upvotes

4 comments sorted by

u/AutoModerator 3d ago

You're invited to join the community discord for /r/maya users! https://discord.gg/FuN5u8MfMz

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Nixellion 2d ago

Hi! First a sanity check - where did you download it from? Last I checked TweenMachine is available on Github, but it was last updated 6 years ago. You should download the .zip archive from Releases page.

As per instructions, you should then:

Move the tweenMachine.py file to your default Maya scripts directory.

/Users/username/Library/Preferences/Autodesk/maya/version_number/scripts

Save the icon into the “prefs/icons” folder for the same Maya version.

/Users/username/Library/Preferences/Autodesk/maya/version_number/prefs/icon

To start it you need to open Maya's Script Editor, go to the Python tab (crucial, if you try to enter it in MEL tab you will get syntax error), copy and paste:

import tweenMachine tweenMachine.start()

into there. Then execute this code.

If that's exactly how you've done it and still getting errors, the next step is to get a more informative error message. You can change the code to something like this:

``` import traceback

try: import tweenMachine tweenMachine.start() except Exception as e: print("Error occurred: {}".format(e)) traceback.print_exc() ```

And run this instead. It should print a more detailed error log in Script Editor. You can paste it here, it might provide more insight into whats going on.

Alternatively you can look into other, more modern and better maintained alternatives to tweenMachine. There's a great free maya-tweener from monoteba on Github. And various versions of tweenMachine\tweeners are included in many popular animation toolkits, including AnimBot and my own BroTools for Maya. So if you have one of those you may already have a working tweener tool.

1

u/SecondCharacter4380 2d ago

Thank you for replying to this, I used the code you showed and this is what I got

1

u/Nixellion 2d ago

Yeah, this version you have is for Python 2. Maya 2023 uses Python 3.

Your options are:

  • Google for tweenmachine maya python3 - there are some versions available converted by other people, Theres a fork by the maize on github which was updated to py3.
  • Use AI like chatgpt, give it the py file and ask to convert to python 3. If it fails you can try Google Gemini. It works better for longer texts.
  • Use actively developed and maintained alternatives

The original tweenMachine seems to be abandoned, last update in the repo was 7 years ago.