Go to: Return value. Related commands. Flags. Examples.
reference
[-filename string]
[-longName toggle]
[-shortName toggle]
[-isNodeReferenced toggle]
[-node string]
[-dagPath toggle]
[-connectionsBroken toggle]
[-connectionsMade toggle]
[-referenceNode string]
[-editCommand string]
reference is undoable, queryable, and NOT editable .
string[] For query execution.
connectionsBroken, connectionsMade, dagPath, editCommand, filename, isNodeReferenced, longName, node, referenceNode, shortName
// List all the nodes that come referenced file "myReferencedFile.ma" // reference -f "myReferencedFile.ma" -q -node; // Find out which file a given referenced node comes from. // reference -q -f "nurbsSphere1"; // Find out if "nurbsSphere1" comes from a referenced file // reference -q -inr "nurbsSphere1"; // Some practical examples of getting information about a referenced file. // // Create an animated cone // cone; setKeyframe -at t -t 1 -t 10 -v 0; setKeyframe -at t -t 5 -v 10; // Save it under the name "animatedCone.ma" // file -rename "animatedCone.ma"; file -f -type "mayaAscii" -save; // Create a new file that will reference "animatedCone.ma" // file -f -new; file -reference "animatedCone.ma"; // Objects in the "animatedCone.ma" file now have the "animatedCone_" // prefix on their names. // // Modify the translate attributes after "animatedCone.ma" was imported // as a reference. // select "animatedCone_nurbsCone1"; move 5 5 5; // Disconnect an attribute // disconnectAttr "animatedCone_nurbsCone1_translateY.output" "animatedCone_nurbsCone1.ty"; // Make a new node and connect it to the referenced cone. // sphere; connectAttr "nurbsSphere1.rx" "animatedCone_nurbsCone1.rx"; // INFO: Which nodes came from a given referenced file. // reference -f animatedCone.ma -q -n; // Result: // animatedCone_nurbsCone1 // animatedCone_nurbsConeShape1 // animatedCone_lightLinker1 // animatedCone_layerManager // animatedCone_defaultLayer // animatedCone_renderLayerManager // animatedCone_defaultRenderLayer // animatedCone_makeNurbCone1 // animatedCone_nurbsCone1_translateX // animatedCone_nurbsCone1_translateY // animatedCone_nurbsCone1_translateZ // animatedCone_uiConfigurationScriptNode // animatedCone_animationScriptNode // INFO: Which file does a given referenced node come from? // reference -q -f animatedCone_nurbsCone1; // Result: animatedCone.ma // // INFO: Which attributes have changed on a referenced node since // the referenced file was opened? // listAttr -changedSinceFileOpen animatedCone_nurbsCone1; // Result: // translate // INFO: Return the connections broken on a node // reference -q -connectionsBroken animatedCone_nurbsCone1; // Result: // animatedCone_nurbsCone1_translateY.output // animatedCone_nurbsCone1.translateY // INFO: Return the connections broken in the entire referenced file. // (In this case, the result is the same as the example above.) // reference -f "animatedCone.ma" -q -connectionsBroken; // Result: // animatedCone_nurbsCone1_translateY.output // animatedCone_nurbsCone1.translateY // INFO: Return the input (destination) connections made on a ref node // reference -q -connectionsMade animatedCone_nurbsCone1; // Result: // nurbsSphere1.rotateX // animatedCone_nurbsCone1.rotateX // INFO: Return the list of the node names from the reference file // associated with the reference node "refNodeName" // reference -rfn "refNodeName" -q -node; // INFO: Find out if refNodeName is a valid reference node name. // reference -rfn "refNodeName" -q; // Result: // refNodeName // INFO: Return the name of the reference file associated with the reference // node "refNodeName", if any. // reference -rfn "refNodeName" -q -filename; // Result: // "myReferencedFile.ma" // INFO: Find all the setAttr edits on the reference node // reference -ec "setAttr" -rfn "refNodeName" -q; // Result: // string array with setAttr commands applied to nodes from the given reference