You might want to consider simply using an environment variable in the path,
and always use forward slashes (linux style; they'll work on windows too):
$PROJECT_ROOT/project/scene/B.ma
Then on the windows machine set PROJECT_ROOT to "Z:"
("set PROJECT_ROOT=Z:"), and on the linux machines have it set to "/linux".
(Obviously setting up the environment variable would be done in some logon
script, at the IT level...).
Maya will automatically resolve these variables and find the correct path.
It will also maintain the environment variable when saving the referencing
file (A.ma).
- Ofer
www.mrbroken.com
On Thu, Feb 3, 2011 at 11:18 AM, Panupat <[email protected]> wrote:
> Currently on a project that my client needs the reference file path to
> remain in linux format. For example
>
> A.ma , referencing objects from --> //linux/project/scene/B.ma
> B.ma , referencing objects from --> //linux/project/scene/C.ma
>
> Most of our Maya license here however are on Windows. I can run a
> Python script that convert all the paths windows paths and save the
> file. For example
>
> Z:\project\scene\B.ma
>
> However I'm trying to figure out a way to do this without converting
> or altering the original file.... I'll try to explain my idea.
>
> - Run the script to open the file.
> - The script checks for the linux formatted reference path, and all
> child path down the hierarchy.
> - Maps the path to an appropriate windows formatted paths *without*
> altering the original files.
> - So when the animators "save" the file, the paths are still in their
> original linux formatted path.
>
> Is this possible to achieve this with Python script? Or will I need a
> fully-compiled plug in to get this to work?
>
> Greatly appreciate any suggestions.
>
> --
> http://groups.google.com/group/python_inside_maya
>
--
http://groups.google.com/group/python_inside_maya