File Reference Basic

This document is about how to create and remove file referencing in Maya.

Say there is a file named bhdt.mb like above. New a file and run:

file -r -ns "cc" -typ "mayaBinary"  "bhdt.mb";

Will bring a bunch of Read-Only nodes that referred to what’s inside bhdt.mb

“cc” is the namespace, so everything in this reference will be named as “cc:*”

Can create more references to the same file by:

file -r -ns "dd" -typ "mayaBinary"  "bhdt.mb";
file -r -ns "ee" -typ "mayaBinary"  "bhdt.mb";
file -r -ns "ff" -typ "mayaBinary"  "bhdt.mb";
file -r -ns "gg" -typ "mayaBinary"  "bhdt.mb";

Each with its own namespace.

Put one of them under a group, then try to delete group1. This will fail because it has Read-Only children. To remove the reference, select the group1, and run:

file -rr "bhdt.mb";

dd:glb and everything under it will disappear. After the reference is gone, group1 can be deleted.


file -r command actually returns the file name it referred to. Those names are unique. In case there are multiple references to a same file, second reference will return “bhdt.mb{1}”, and third is “bhdt.mb{2}”, and so on. These names are useful to determine individual reference when calling file -rr command.


Leave a comment

Filed under MEL

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s