From: Greg Ercolano <erco@(email surpressed)>
Subject: [Q+A] Maya: automating rewriting of network pathnames in Maya [using dirmap]
   Date: Fri, 09 Jun 2006 20:09:47 -0400
Msg# 1312
View Complete Thread (1 article) | All Threads
Last Next
Q> Is there a way to have Maya automatically rewrite drive map paths
Q> (like X:/foo/bar) into the UNC equivalents (eg. //server/volume/foo/bar)?
Q>
Q> We've got many legacy maya scene files (.mb) where the TDs
Q> had specified absolute pathnames with drive maps
Q> before we realized the benefits of UNC paths ( <http://support.microsoft.com/kb/180362/en-us> )
Q>
Q> We know the rush scripts can't really modify the .mb files because
Q> they're binary, but maybe Maya has a technique to automate pathname
Q> conversions?

    I haven't tested this, but this might be a workable solution:

A>>    There is a mel command called dirmap that allows you to remap paths.
A>>    This can go in a startup file and reset paths:
A>>
A>>	dirmap -en true;  //enable directory mapping
A>>	dirmap -m "X:/some/mapped/drive"  "//UNC/some/mapped/drive";  //X: now mapped to UNC
A>>

    ..thanks to Bill Heiden for that solution.

    This kinda sounds great, actually.

    I imagine if you hack that into your maya startup files
    (e.g. initialStartup.mel or scripts/startup/userSetup.mel),
    Maya will automatically convert the pathnames for you, without
    users having to be concerned about the changes.

    Quite possibly this is an even more general solution for
    managing rewriting pathnames, eg. if your file server goes down,
    and you need to redirect all your pathnames to another file server.

Last Next