/// <summary> /// Clones the user data. /// </summary> /// <param name="source">The source data.</param> protected override void OnDuplicate(UserData source) { // http://mcneel.myjetbrains.com/youtrack/issue/FL-5923 // 17 August 2015 John Morse // Need to copy the sour transform otherwise when you transform an object // more than once you only get the last transform. // This was the problem // 1) Put a point in a dictionary // 2) Attach the dictionary to an objects attributes // 3) Move the object once, the new object transform will be equal to the // move transform // 4) Move the object a second time, the new object transform was getting // set to identity then the move transform was getting applied, when // you apply the Transform to the point in your dictionary you only got // the last move. // Transform = source.Transform; var dict = source as UserDictionary; if (dict != null) { m_dictionary = dict.m_dictionary.Clone(); m_dictionary.SetParentUserData(this); } }
/// <summary> /// Clones the user data. /// </summary> /// <param name="source">The source data.</param> protected override void OnDuplicate(UserData source) { UserDictionary dict = source as UserDictionary; if (dict != null) { m_dictionary = dict.m_dictionary.Clone(); m_dictionary.SetParentUserData(this); } }