def setup(): print '[mmmaya.dirmap] Setting up dirmaps:' to_map = [ # Original (pre-Linux) Windows to Linux. ('K:/', '/Volumes/CGroot'), ('Y:/', '/Volumes/PD01'), ('Z:/', '/Volumes/AnimationProjects'), # Old and new (2016-07-04) Miao Miao. ('//10.10.1.3/AnimationProjects', '/Volumes/AnimationProjects'), ('//10.10.1.5/AnimationProjects', '/Volumes/AnimationProjects'), # Modern (Shed projects) Windows to Linux. ('U:/', '/Volumes/CGroot'), # SitG: Mike's home to studio. ('/Volumes/heap/sitg/work', '/Volumes/sitg'), # Current. ] # File from remote users should normalize back. for name in 'CGroot', 'CGartifacts': to_map.extend(( ('/Volumes/{}.offline'.format(name), '/Volumes/{}'.format(name)), ('/Volumes/offline/{}'.format(name), '/Volumes/{}'.format(name)), ('/Volumes/{}.online'.format(name), '/Volumes/{}'.format(name)), )) for src, dst in to_map: print '[mmmaya.dirmap] Mapping %s to %s' % (src, dst) cmds.dirmap(m=(src, dst)) cmds.dirmap(enable=True)
def go_neutral(): for map_ in (to_online, to_offline): for src in sorted(map_): dst = cmds.dirmap(getMappedDirectory=src) if dst: print 'Unmapping {} -> {}'.format(src, dst) cmds.dirmap(unmapDirectory=src)
def install_dirmap(map_): for src, dst in sorted(map_.iteritems()): print 'Mapping', src, '->', dst existing = cmds.dirmap(getMappedDirectory=src) if existing and existing != dst: print ' was', existing cmds.dirmap(unmapDirectory=src) cmds.dirmap(mapDirectory=(src, dst))
def mmmaya_windows_dirmap(): print '[mmmaya.windows] Setting up dirmaps: for CGroot -> K and AnimationProjects -> Z' for src, dst in [ # Linux to Windows. ('/Volumes/CGroot', 'K:/'), ('/Volumes/AnimationProjects', 'Z:/'), # Miao Miao moved on July 4th. ('//10.10.1.5/AnimationProjects', '//10.10.1.3/AnimationProjects'), ]: print '[mmmaya.windows] Mapping %s to %s' % (src, dst) cmds.dirmap(m=(src, dst)) cmds.dirmap(enable=True)
def __main__(mapDict): print 'dirMap' dirMap(mapDict) # add '/' at the end print cmds.dirmap( cd='d:/mhxy//sourceimages/' ) print cmds.dirmap( cd='d:/mhxy/sourceimages/' ) print cmds.dirmap( cd='/sourceimages/' )
def __main__(mapDict): print 'dirMap' dirMap(mapDict) # add '/' at the end print cmds.dirmap(cd='d:/mhxy//sourceimages/') print cmds.dirmap(cd='d:/mhxy/sourceimages/') print cmds.dirmap(cd='/sourceimages/')
def remapFileTexture(verbose=False): allFileNodes = cmds.ls(et="file") for each in allFileNodes: fileTx = "%s.fileTextureName" % (each) attrFileTx = cmds.getAttr(fileTx) try: mp = cmds.dirmap(cd=(attrFileTx)) if not os.path.exists(mp): remapped = pathCorrector.pathCorrector(mp, verbose=verbose) if mp != remapped: cmds.setAttr(fileTx, remapped, type="string") if verbose: msg_fileTx = "%s --> %s"%(mp, remapped) print("[remapFileTexture] %s" % (msg_fileTx)) except Exception as e: print("[Err remapFileTexture] %s %s %s" % (fileTx, attrFileTx, e))
print "could not connect to SG Server" print "THIS IS RUNNING A USERSETUP.PY FILE" try: import vxmaya_setup import vxmaya_file import vxmaya_core except: pass mel.eval("evalDeferred dsMenu;") #mel.eval("evalDeferred overwriteProc;") if sys.platform == "win32": cmds.dirmap( en=True ) cmds.dirmap( m=('/dsPipe/', '//vfx-data-server/dsPipe/') ) import dsCommon.dsCommonInit as comInit comInit.copyMayaPresets() comInit.copyVrayScripts() else: cmds.dirmap( en=True ) cmds.dirmap( m=('//vfx-data-server/dsPipe/','/dsPipe/') ) cmds.dirmap( m=('P:/','/dsPipe/') ) import dsCommon.dsCommonInit as comInit comInit.copyMayaPresets() #comInit.copyVrayScripts()
import maya.cmds as cmds cmds.dirmap(en=True) cmds.dirmap(m=('D:', 'Z:/uploads/D0509995D061/D')) print('Mapping successfully')
def dirMap(mapDict): cmds.dirmap( en=True ) for k,v in mapDict.iteritems() : cmds.dirmap( m=(k, v) )
import rrt LOG = rrt.get_log() LOG.info("Starting %s" % rrt.get_version()) from rrt.hpc import env ENV = env() from maya import cmds posix = lambda s: s.replace('\\', '/') proj = posix(ENV['PROJECT']) node_proj = posix(ENV['NODE_PROJECT']) map_pairs = [ (node_proj, proj), ] for name in os.listdir(ENV['PROJECT']): full = os.path.join(ENV['PROJECT'], name) if os.path.isdir(full): map_pairs.append(('//'+name, posix(full))) map_pairs.append((node_proj+'/'+name, posix(full))) map_pairs.append((node_proj+'//'+name, posix(full))) LOG.debug("Dirmaps:") for m in map_pairs: LOG.debug(m) cmds.dirmap(mapDirectory=m) cmds.dirmap(enable=True)
def dirMap(mapDict): cmds.dirmap(en=True) for k, v in mapDict.iteritems(): cmds.dirmap(m=(k, v))