Resolving file references via c++ api

Resolving file references via c++ api

Anonymous
Not applicable
916 Views
3 Replies
Message 1 of 4

Resolving file references via c++ api

Anonymous
Not applicable

I'm working with a legacy model pipeline that uses the Maya 2013 C++ libraries to process a large batch (hundreds) of models. Some of these models have file references that are absolute and incorrect for the machine the batch is running on. And given the existing workflow of the pipeline, these file references are essentially immutable. I've been looking for a way to remap these file references to match the directory structure of the batch machine, but all of my attempts have proven fruitless.

 

I've specifically tried all variations (different reference modes, wantUnresolvedNames=true, etc.) of MFileIO::open(), MFileIO::getReferences(), and MFileIO::getFiles(). If the referenced file is at the expected path then these calls return the expected references, but if the referenced file is missing then I get nothing.

 

Is there a right way to do this? Is this the right part of the pipeline to be doing this sort of thing?

0 Likes
917 Views
3 Replies
Replies (3)
Message 2 of 4

cheng_xi_li
Autodesk Support
Autodesk Support

Hi dculyba,

 

I am not sure if could be done with C++ API.

 

But you can get unresolved referenced path and alter them with filePathEditor and file -lr to reload them later in MEL.

 

Yours,

Li

0 Likes
Message 3 of 4

Anonymous
Not applicable

I'm trying to master the work with the filePathEditor function in PyMEL 1.0.8 according to the documentation

But I was faced with the fact that not all flags are correctly received inside the Script Editor.

 

Since this function is inherited from the MEL, I also tried to use it via the MEL Script Editor. But I had the same problems again. Whether I incorrectly apply them, or whether these flags don`t work in the mode described on the function page.

I mean following flags:
-unresolved
-attributeOnly

Could you tell me what's the problem?
Screenshot attached:

Maya2016_MEL_FPE_invalid_flags+comm.png

P.S. By the way, in the description of the FilePathEditor class in the file .../maya2016/devkit/other/pymel/extras/completion/py/pymel/core/system.py these flags are absent. Maybe they are simply not supported?

0 Likes
Message 4 of 4

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

It could be a flag added in Maya 2016 Extension 2. Document for Maya 2016 online contains 2016 Extension 2 content. 

 

I tried both Maya 2016 and Maya 2016 Extension 2, it seems working fine in Maya 2016 Extension 2.

 

Yours,

Li

0 Likes