Skip to content

Instantly share code, notes, and snippets.

@robomojo
Created September 6, 2013 03:57
Show Gist options
  • Save robomojo/6459361 to your computer and use it in GitHub Desktop.
Save robomojo/6459361 to your computer and use it in GitHub Desktop.
for maya, import scripts module from the directory of the currently opened maya file.
import sys
import os
(filepath,filename) = os.path.split(maya.cmds.file(q=True,l=True)[0])
if 'scripts.py' in os.listdir(filepath):
if filepath not in sys.path: sys.path.append(filepath)
import scripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment