How to run a Python script in Maya. (It is quite suitable)
Maya doesn't execute the script when I D & D it. You can write it directly in the editor and execute it, You can't use it with relative paths or scripts you want to use. Make a note because I will soon forget the solution in such a case.
import pymel.core as pm
import sys
p = r"<Full path of the folder containing the script>"
if not p in sys.path: sys.path.append(p)
import <script name>
reload(<Script name>)
test=<Script name.name of the class()>
<Script name.Method name()>
If you want to open the window If you create a method for it, it will appear just by calling it.
Recommended Posts