Python Script Plugin- Shelf Tools

Python Script Plugin- Shelf Tools

bradaschreiber
Enthusiast Enthusiast
3,226 Views
2 Replies
Message 1 of 3

Python Script Plugin- Shelf Tools

bradaschreiber
Enthusiast
Enthusiast

I have a Python Script Plugin that I am testing. Once I load it in through Script Editor, and save as a Shelf Tool it functions well. However, once I close and reopen Maya I am unable to access the code via the Shelf Tool, I get this message-# Error: Invalid Code Fragment: Found no executable Python code.

 

It seems that the Shelf Tool does not store the location of the .py file- how can I save the filepath into the Shelf Tool command so that the Tool is readily available without relaunching through Script Editor.

 

Thank you.

0 Likes
Accepted solutions (1)
3,227 Views
2 Replies
Replies (2)
Message 2 of 3

kollig
Advocate
Advocate
Accepted solution

You have to place the python file in your scripts folder. The shelf command has to import it before you can use it.

A more detail description can be found here: http://cgartistry.com/running-python-scripts-in-maya/

 

 

Message 3 of 3

bradaschreiber
Enthusiast
Enthusiast

Thanks so much!

0 Likes