First post of the new year, and I bring you a couple of tips about how to defer loading references.
Consider the reference hierarchy illustrated below. In this example, when "fileC.ma" is reloaded, Maya will also load "fileB.ma" and "fileA.ma".
Let's say you want to reload the top-level reference - "fileC.ma" - and defer the loading of "fileB.ma". You can do this by using the file command and including the flag -loadReferenceDepth "topOnly", like this:
file -loadReferenceDepth "topOnly" -loadReference "cRN" "fileC.ma";
This will load "fileC.ma", but defer the loading of the nested reference: "fileB.ma"
Now, even through "fileB" is not the top-level reference, you can also apply the same flag to defer the loading of "fileA.ma":
file -loadReferenceDepth "topOnly" -loadReference "c:bRN" "fileB.ma";
This will load "fileB.ma" but defer the loading of its nested reference "fileA.ma".
Tip two is just as good.
Maya will allow you to replace a reference but, again loads the reference by default. You can avoid this happening if you specify the flag -loadReferenceDepth "none".
Let's say you want to swap "fileC.ma" for "fileD.ma" but do not want Maya to load the reference:
file -loadReferenceDepth "none" -loadReference "cRN" "fileD.ma";
It's as easy as that !