Search Unity

Skinning Editor Copy Paste Error

Discussion in 'Animation' started by daysandmoons1, Aug 17, 2021.

  1. daysandmoons1

    daysandmoons1

    Joined:
    Jan 15, 2021
    Posts:
    1
    Hi!

    I want to copy bones to other PSB. But I encountered the following error.
    These PSBs are mostly same, but some are different.
    ex) file 2(to paste) has more element than file 1(to copy).

    When I looked it up, people said that I had to upgrade the version, but I want to know if there is another solution.(I use 2019.4.21f)

    Thank for Helping!

    Code (CSharp):
    1. ArgumentException: An item with the same key has already been added. Key: Head
    2. System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    3. System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    4. UnityEditor.U2D.Animation.CopyTool+NewBonesStore.MapAllExistingBones () (at Library/PackageCache/com.unity.2d.animation@3.2.6/Editor/SkinningModule/CopyTool.cs:44)
    5. UnityEditor.U2D.Animation.CopyTool.OnPasteActivated (System.Boolean bone, System.Boolean mesh, System.Boolean flipX, System.Boolean flipY) (at Library/PackageCache/com.unity.2d.animation@3.2.6/Editor/SkinningModule/CopyTool.cs:328)
    6. UnityEditor.U2D.Animation.CopyToolView.OnPasteActivated (System.Boolean bone, System.Boolean mesh, System.Boolean flipX, System.Boolean flipY) (at Library/PackageCache/com.unity.2d.animation@3.2.6/Editor/SkinningModule/CopyTool.cs:658)
    7. UnityEditor.U2D.Animation.PastePanel.OnPasteActivated () (at Library/PackageCache/com.unity.2d.animation@3.2.6/Editor/SkinningModule/UI/PastePanel.cs:66)
    8. UnityEngine.UIElements.Clickable.Invoke (UnityEngine.UIElements.EventBase evt) (at <a30d64cf198846a786f143decb66f563>:0)
    9. UnityEngine.UIElements.Clickable.OnMouseUp (UnityEngine.UIElements.MouseUpEvent evt) (at <a30d64cf198846a786f143decb66f563>:0)
    10. UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at <a30d64cf198846a786f143decb66f563>:0)
    11. UnityEngine.UIElements.EventCallbackRegistry.InvokeCallbacks (UnityEngine.UIElements.EventBase evt) (at <a30d64cf198846a786f143decb66f563>:0)
    12. UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <a30d64cf198846a786f143decb66f563>:0)
    13. UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <a30d64cf198846a786f143decb66f563>:0)
    14. UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <a30d64cf198846a786f143decb66f563>:0)
    15. UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <a30d64cf198846a786f143decb66f563>:0)
    16. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <a30d64cf198846a786f143decb66f563>:0)
    17. UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <a30d64cf198846a786f143decb66f563>:0)
    18. UnityEngine.UIElements.EventDispatcher.OpenGate () (at <a30d64cf198846a786f143decb66f563>:0)
    19. UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <a30d64cf198846a786f143decb66f563>:0)
    20. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <a30d64cf198846a786f143decb66f563>:0)
    21. UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <a30d64cf198846a786f143decb66f563>:0)
    22. UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <a30d64cf198846a786f143decb66f563>:0)
    23. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <a30d64cf198846a786f143decb66f563>:0)
    24. UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <a30d64cf198846a786f143decb66f563>:0)
    25. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <07cfa953d94b44e4bb3a488bef79100a>:0)
     
  2. Unrighteouss

    Unrighteouss

    Joined:
    Apr 24, 2018
    Posts:
    599
    Hey,

    I actually ran into this issue the other day and submitted a bug report. Apparently, Unity was already aware of the issue.

    Issue link: https://issuetracker.unity3d.com/is...eption-error-is-thrown-when-pasting-bone-data

    Unfortunately, I never found a solution. It seems like the individual PSB files are bugged, so creating bones in new files and then copying those bones to other new files should still work.

    I was using a version of 2020.3 at the time, so I doubt upgrading will do anything.
     
  3. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Hello,
    Thanks for highlighting this issue (and thanks @Unrighteouss for submitting the bug report!).
    I checked the ticket, and it seems to be an active issue in Unity 2019.4 -> Unity 2021.2. It was just confirmed by QA and is being handed over to us devs in the 2D team. We'll take a look at this issue in the coming days. If we find any good workaround while looking into the issue, we'll post an update here.
     
    Unrighteouss likes this.