forked from lookbothways/vfxTools
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrunAnyFile.py
More file actions
30 lines (22 loc) · 721 Bytes
/
Copy pathrunAnyFile.py
File metadata and controls
30 lines (22 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#bakes and exports a locator (or object selected)
#Run any python file
import maya.cmds as cmds
import sys
import os
def psource(module):
file = os.path.basename( module )
dir = os.path.dirname( module )
toks = file.split( '.' )
modname = toks[0]
if( os.path.exists( dir ) ):
paths = sys.path
pathfound = 0
for path in paths:
if(dir == path):
pathfound = 1
if pathfound == 0:
sys.path.append( dir )
exec ('import ' + modname) in globals()
exec( 'reload( ' + modname + ' )' ) in globals()
return modname
psource("/mnt/projects/revolt/publish/scripts/pipelineShelf/locatorFBXExport.py")