Any way to find original prefab name by script?

If I put a prefab into a scene, and rename it, is there an API I can call on that GameObject to tell me the 'original prefab' name?

From andeeee on the Unity Forum:

"You can do this from an editor script using EditorUtility.GetPrefabParent"

This is what I needed. The manual reads like it would give me the name of the parent in the Hierarchy (game object in the scene), rather than the Asset itself, but it's what I needed. Thanks andeeee

you can add a variable to it that stores the original prefab and then you'd just make a function that returns that variable. e.g.

var original : GameObject;

function GetPrefab(){
   return original;
}

Drag the original prefab onto the 'original' slot in the inspector.

I think I have something that should work. The idea is to set the name of the mesh when it's imported, such that you can reconstruct the object itself when you need it. Put this script in Editor folder, Reimport the prefabs in question, that will set their mesh's names accordingly. Then you can access those mesh names when you go to export them. (Please, Unity team, make this easier please!)

class MyModelPostprocessor : AssetPostprocessor
{
    void OnPostprocessModel (GameObject g)
    {
    Apply (g.name, g.transform);
    }

    // rename each imported mesh to indicate it's transform's name  
    void Apply (string parName, Transform transform)
    {
        MeshFilter mf = transform.GetComponent(typeof(MeshFilter)) as MeshFilter;
        if (mf)
        {
            Mesh m = mf.sharedMesh;
            if (m)
            {
                Debug.Log ("renaming to "+parName+"_Mesh");
                m.name = parName + "_Mesh";
            }
        }

        // Recurse
        foreach (Transform child in transform)
            Apply(parName+"_"+child.name, child);
    }
}