Unity Issue Tracker - InvalidCastException errors are thrown when inspecting a MeshRenderer.Material Reference Curve in the Curve Editor
Fixed
UUM-10003
InvalidCastException errors are thrown when inspecting a MeshRenderer.Material Reference Curve in the Curve Editor
Unity: Mecanim Animation
Fixed
2023.1.X
2022.2.X
2022.2.0a6 onwards
There is already a fix by https://github.cds.internal.unity3d.com/unity/unity/pull/12600 currently being merged to trunk
How to reproduce:
1. Open the user's attached project
2. Open scene Scenes/SampleScene
3. In the Hierarchy, select "Cube"
4. Go to the Animation window (Window -> Animation -> Animation)
5. Select the property "MeshRenderer.Material Reference[0]" under the New Animation clip
6. Select the Curves tab next to Dopesheet
7. Observe the Console
Expected result: no exceptions are thrown
Actual result: "InvalidCastException: Specified cast is not valid" errors are thrown, along with ArgumentException