Assigning an object to a SerializedProperty

Hi, I have a SerializedProperty in an editor class that is holding an AnimationClip and I would like to assign a new AnimationClip to it. I can’t figure out how to do this as casting is throwing an error(Cannot implicitly convert type ‘UnityEngine.animationClip’ to ‘UnityEditor.SerializedProperty’) . I know its editable but I haven’t been able to figure this out. Thanks in advance.

Figured out my own answer from the Intro to Editor Scripting video at Unite 2011

you can use

clip = animation.FindPropertyRelative(“animClip”).objectReferenceValue;
or animation.FindPropertyRelative(“animClip”).objectReferenceValue = clip;