Created
March 21, 2018 19:02
-
-
Save lclibardi/4610390cd764f8bb644808b346995902 to your computer and use it in GitHub Desktop.
Recursively import all nested references in a Maya scene.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IMPORT ONLY TOP LEVEL REFERENCES | |
string $references[] = `ls -type "reference"`; | |
for ( $r in $references) | |
{ | |
string $ref = `referenceQuery -filename $r`; | |
file -importReference $ref; | |
} | |
// RECURSIVELY IMPORT ALL REFERENCES | |
{ | |
string $topLevelReferences[] = `file -q -r`; | |
do { | |
string $topLevelReferences[] = `file -q -r`; | |
for ($ref in $topLevelReferences){ | |
file -importReference $ref; | |
} | |
} | |
while (size(`file -q -r`) > 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment