Playable drawer get ExposedReference position

Hello,
I’m trying to modify the TransformTween playable. I would like the clip duration to be automatically modified depending on the distance between de start location and the end location.
I added these lines at the end of TransformTweenDrawer.cs

TransformTweenClip clip = property.serializedObject.targetObject as TransformTweenClip; 
SerializedObject editorGUI = new SerializedObject(Selection.activeObject);
SerializedProperty duration = editorGUI.FindProperty("m_Clip.m_Duration");
 // duration.doubleValue = 3f;
duration.doubleValue= Vector3.Distance(clip.startLocation.position, clip.endLocation.position);
editorGUI.ApplyModifiedProperties();

I get an error ‘ExposedReference’ does not contain a definition for ‘position’…
I think it’s because startLocation and endLocation are ExposedReference but I have no idea how to handle them.
Thank for your help

The playable director contains the table for looking up the transforms.
e.g.
var transformA = playableDirector.GetReferenceValue(clip.startLocation.exposedName, out valid) as Transform;

If you need the current PlayableDirector in the editor window, you can use TimelineEditor.inspectedDirector;