Question

I am trying to use a MEL script to load ANIMATION.MA file that references CHARACTER_RIG.MA. The CHARACTER_RIG.MA and ANIMATION.MA files are produced by someone else and supplied to me. The ANIMATION.MA is looking for
N:/Project/Maya//char/character/CHARACTER_RIG.MA

If I open ANIMATION.MA from Maya, or use the equivalent MEL command I always get prompted with:

"Reference File Not Found"
Reference File Not Found: N:/Project/Maya//char/character/CHARACTER_RIG.MA.
[Abort File Read] [Skip] [Browse...] [Retry]

If I tap browse, and select the CHARACTER_RIG.MA then it opens perfectly. I can see it created a reference in the Reference Editor that has the Unresolved Path (N:/...) , the Resolved Path (/my/path) and the namespace and the namespaceRN.

My question is, how do I do the equivalent of the "Browse..." from MEL? I tried pre-creating a reference, but it doesn't let me set the unresolved path, so when I load the ANIMATION.MA it keeps prompting in MAYA.

file -f -options "v=0"  -typ "mayaAscii" -o "/Source/project/assets/anims/ANIMATION.MA"
Was it helpful?

Solution 2

I ended up finding several solutions:

  1. Rename the RIG.MA file to match the filename in ANIM.MA (they were different in my case) and put it in one of the search or project folders that MAYA uses and it will automatically find it.

or

  1. Programatically through code (or manually) edit the ANIM.MA file to remap the file/folder of the RIG.MA to where you want to load it from. Note: You also need to remap any other files, such as textures. I did this with perl -pi -e 's/\Qold-path\E/\Qnew-path\E/g' ANIMATION.MA

HTH someone else.

OTHER TIPS

If you know the directory where the file is, then you can use the dirmap command. The command dirmap allows you to remap directory structures if your disk configuration changes. So in this case it would look like:

dirmap -en true;
dirmap -m "N:/Project/Maya//char/character" "/my/path";

Possibly more manageable if you have lots of mappings to do especially when moving form a windows machine to a *nix one. However it is much more useful to define your project structure because then things just work when you move, tough this may not be the best of choice for shared assets.

Quick and easy, File, Project, Set and select the folder where meshes or whatever it is.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top