Sprite editor 'apply' button occasionally reverts instead.

,

It is extremely frustrating for the ‘Apply’ button to revert changes in the Sprite Editor, especially when working on a complex rigged sprite.

I noticed that the following error came up the last time it happened.(Presumably the other times, too, but I didn’t notice then.)

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <695d1cc93cca45069c528c15c9fdd749>:0)
UnityEditor.U2D.Animation.MeshCache.GetWeight (System.Int32 index) (at Library/PackageCache/com.unity.2d.animation@5.0.4/Editor/SkinningModule/SkinningCache/MeshCache.cs:87)
UnityEditor.U2D.Animation.SpriteMeshDataController.GetMultiEditChannelData (UnityEditor.U2D.Animation.ISelection`1[T] selection, System.Int32 channel, System.Boolean& enabled, System.Int32& boneIndex, System.Single& weight, System.Boolean& isEnabledMixed, System.Boolean& isBoneIndexMixed, System.Boolean& isWeightMixed) (at Library/PackageCache/com.unity.2d.animation@5.0.4/Editor/SkinningModule/SpriteMeshData/SpriteMeshDataController.cs:419)
UnityEditor.U2D.Animation.WeightInspector.ChannelsGUI () (at Library/PackageCache/com.unity.2d.animation@5.0.4/Editor/SkinningModule/IMGUI/WeightInspector.cs:58)
UnityEditor.U2D.Animation.WeightInspector.OnInspectorGUI () (at Library/PackageCache/com.unity.2d.animation@5.0.4/Editor/SkinningModule/IMGUI/WeightInspector.cs:40)
UnityEditor.U2D.Animation.WeightInspectorIMGUIPanel.OnGUI () (at Library/PackageCache/com.unity.2d.animation@5.0.4/Editor/SkinningModule/UI/WeightInspectorIMGUIPanel.cs:41)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <6aef74cd6e9c4a708ea4a51c97de39d4>:0)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

Hi @PBKitty , could you let me know what Unity Editor version you’re using and whether you have the 2D Template Project packages installed? Could you also let me know if you have submitted a bug report via the Editor, as a reference.

I am on 2021.1.2f1, and I am not sure whether I have the template package installed; the project was originally created on 2019.x and I believe that I originally used the 2d template that was available at that time.

I have not yet submitted a bug report.

This is an example of it happening; I happened to catch it in action while recording. (at 26 seconds in)

I’ve seen this happen every once in a long while on previous sprite rigs in the same project, but on the character I am working on now it has happened repeatedly.

Thank you for the update and the video. I’ll check with the dev regarding the issue, but do note that you would likely need to send the Project file to us to help us investigate the issue thoroughly.

cc: @Ted_Wikman Might wanna take a look at this.

Thanks for the ping!
Like Sam said, please submit a bug report which includes the steps to reproduce the issue, so that we can take a closer look. Once submitted, do let us know the bug id so we can more quickly identify it on our end.

Thanks!

Part of what makes it frustrating is that it isn’t easy to reproduce- it will go just long enough to lull you into a false sense of security and then -bam- it breaks. I’ll try to figure out a way to trigger it- I was lucky on the video that it happened to happen while recording that time.

Thanks!