Hi, I'm having a problem I can't solve. I'm hoping someone can help me out.
I'd like to have a fbx file be imported to the users Maya scene using my Python script, however I am having difficulty figuring out how to make this work. I think a subdirectory in the scripts folder must be needed to store the script and fbx in, but I'm not sure how. Trying to access a subfolder like this
import /customCharacterScript/customCharacterScript
reload(/customCharacterScript/customCharacterScript)
does not work. I hope someone can give me some tips. Thanks a ton
Replies
import and reload are python commands which work with modules and packages. the way of addressing them is with the dot syntax:
where the first part is a package (a directory containing the modules and a special file named __init__.py) and the second part is the module.
Look at modules and packages.
In order to let Maya find them, you need to add the path to the package to the sys.path. Something like:
Look at Python in Maya.
Otherwise you can edit the Maya.env file and add your path to the PYTHONPATH variable.
Maya.env can be found in: C:\Users\<user>\Documents\maya\<maya_version>
Something like:
Look at Setting environment variables using Maya.env and File path variables.
Cheers