How to get a referenced node imported last.

import maya.cmds as mc;

beforeReferenceNodes= mc.ls(type="reference");

filePath= "C:\\Users\\user\\Documents\\maya\\projects\\referenceTest\\scenes\\referencingMayaFile.mb";

mc.file(filePath,reference=True);

afterReferenceNodes= mc.ls(type="reference");

importedReferenceNodes= list(set(afterReferenceNodes)-set(beforeReferenceNodes));

Comments

Popular posts from this blog

HIK: Getting current character and current source.