Closed jurjjc closed 3 weeks ago
I'm not able to duplicate this. Can you post the error and the call stack?
IndexOutOfRangeException: Index was outside the bounds of the array.
UMA.Editors.UMAMaterialInspector.IsChannelValid (System.Int32 channel) (at Assets/UMA/Core/Editor/Scripts/UMAMaterialInspector.cs:224)
UMA.Editors.UMAMaterialInspector.DrawChannelList (UnityEditor.SerializedProperty list, UMA.UMAMaterial+MaterialType materialType) (at Assets/UMA/Core/Editor/Scripts/UMAMaterialInspector.cs:261)
UMA.Editors.UMAMaterialInspector.OnInspectorGUI () (at Assets/UMA/Core/Editor/Scripts/UMAMaterialInspector.cs:158)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.
This appears to be a case where the object has not yet been updated by the SerializedProperty, and the channel was expanded before the object was updated. I forced the SerializedObject to ApplyModifiedProperties before drawing the channel list, and then checked the array bounds before accessing the channels. Checked into Feature-13 branch, will be in next RC or Release.
Feature-13
Describe the bug When decreasing the "Texture Channels" by 1 and then increasing it by 1 in UMA Material, an IndexOutOfRangeException occurs.
Environment (please complete the following information):
To Reproduce Steps to reproduce the behavior:
Expected behavior Modifying the "Texture Channels" value should not cause any errors.
Screenshots
Additional context