View Full Version : Call Bonus Tools function in Python?

10-25-2011, 06:28 PM
This might be a noob question, but I'm still relatively new to scripting in Maya and can't figure it out. How can I call a Bonus Tools function in a Python script? In MEL, the command is:

bonesOnCurve 3 0 0;

Thank you!

10-25-2011, 07:06 PM
Ok, so the solution I found was:

import maya.mel as mel
mel.eval("bonesOnCurve 3 0 0;")

I'm not sure if that is the "proper" way to do it though, seems like sort of a cheat. :shrug:

11-08-2011, 06:08 AM
Why a cheat? If it's a mel script then you need mel.eval to execute it inside python. What did you expect?

11-08-2011, 06:18 AM
If you are making tools to make your work easier, go for it, and don't look back.
Someone trying to make tools to publish for others to use might find that calling code from The Bonus Tools to be that much more work explaining any installation issues to their users, although I have seen it done.

<* Wes *>

CGTalk Moderation
11-08-2011, 06:18 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.