query referenced mayaBinary files


hi eveyone,

Does anyone out there know the proper command to query all referenced mb files in a scene.

file -q -l -type "mayaBinary" 

still returns ALL referenced files.

Thanks in advance.


thats a good question, the query command doesn’t work if you give it a type to query even with:

file -q -r -type “mayaBinary”;

it doesn’t want to do it

so here is what I did. This will do the same thing just a work around. this will only print out the maya binary files that are referenced. if you want the entire file list including the current scene, then you can change the -r flag to the -l flag

 string $fileList[];
$fileList = `file -q -r`;
for($file in $fileList){
	  string $fileExt = `match "[^\.]*$" $file`;
	 if(tolower($fileExt) == "mb"){
			print ($file + " is a maya binary 

so do what you want inside the if statement for that maya binary

if anyone else has a better plan, i’d like to know as well

Goodl luck!


Thanks Scott,

That should work nicely. It’s unfortunate however that the -type flag doesn’t want to behave.


This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.