bool atomImport::replaceNameAndFindPlug(const MString& origName,
										atomNodeNameReplacer& replacer,
										MPlug& replacedPlug)
{
	bool rtn = false;
	
	// get the node name
	//
	MStringArray nameParts;
	origName.split('.', nameParts);

	// Perform any necessary replacement
	//
	MString tmpName(nameParts[0]);
	// TODO: type & hierarchy info -- does the replacer store enough info
	// to help us find that out since in the case of export edits we don't
	// have that info for sources
	//
	if (replacer.findNode(atomNodeNameReplacer::eDag,tmpName,0,0)) {
		MString newName(tmpName);
		newName += (".");

		// add the attribute name(s) back on again
		//
		unsigned int ii;
		MString attrName;
		for (ii = 1; ii < nameParts.length(); ++ii) {
			if (ii > 1) {
				attrName += (".");
			}
			attrName += nameParts[ii];
		}
		newName += attrName;

		MSelectionList tmpList;
		if (MS::kSuccess == tmpList.add(newName)) {
			tmpList.getPlug(0,replacedPlug);
			rtn = !replacedPlug.isNull();
			if (!rtn) {
				// test for the special case of the pivot component
				//
				MDagPath path;
				MObject component;
				if (MS::kSuccess == tmpList.getDagPath(0,path,component) &&
					component.apiType() == MFn::kPivotComponent)
				{
					MObject node;
					tmpList.getDependNode(0,node);
					MFnDependencyNode fnNode(node);
					replacedPlug = fnNode.findPlug(attrName,false);
					rtn = !replacedPlug.isNull();
				}
			}
		}
	}
	return rtn;
}