Importing All Referenced Files
I was working on an export script yesterday in which I needed to import all referenced files in a Maya scene via python (usually you can just use the reference editor). After being unable to find a one-line way to do it in the Maya docs, I did a quick Google search and saw that a lot of people had this same issue.
This is how I solved it:
|
1 2 3 4 |
allReferences= cmds.ls (rf = True)
for referenceNode in allReferences:
referencedFile = cmds.referenceQuery (referenceNode, f = True)
cmds.file (referencedFile, ir = True) |