Search Issue Tracker
Fixed in 2021.2.X
Fixed in 2020.3.X, 2021.1.X
Votes
0
Found in
2021.1.0a9
Issue ID
1317450
Regression
Yes
Texture Importer Inspector throws errors when a built-in texture inspector is overwritten in C#
When a custom inspector targetting Texture2D, Cubemap or Texture3D is present in the project, the texture importer inspector of these assets throws errors when they are displayed in the inspector window.
Stacktrace of the error:
InvalidCastException: Specified cast is not valid.
UnityEditor.TextureImporterInspector.get_textureInspector () (at <280242b5f32c446482b2e1fcdf7e6d80>:0)
UnityEditor.TextureImporterInspector.DrawPreview (UnityEngine.Rect previewArea) (at <280242b5f32c446482b2e1fcdf7e6d80>:0)
UnityEditor.PropertyEditor.DrawPreviewAndLabels () (at <280242b5f32c446482b2e1fcdf7e6d80>:0)
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 <b50b24924f4d442fb2face92883f4dc2>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Here's an example of custom editor that causes the error:
```
[CustomEditor(typeof(Texture2D), false)]
class MixtureInspectorTexture2D : MixtureEditor
{
public override bool HasPreviewGUI() => true;
}
```
Repro steps:
- Download the repro project
- Select the texture A in the Assets folder
- Observe errors in the console, like in the attached gif.
Note that the issue doesn't repro on 2020.2. Tested on Unity 2021.1 and 2021.2.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts with meta files from previous Editor versions
- Input.mousePosition returns (NaN, NaN, 0.00) when Scene view is opened
aricjoshua
Nov 24, 2021 04:46
There has been no patch for the UNITY LTS VERSION in 5 months. https://b2b.partcommunity.com/community/groups/topic/view/group_id/1747/topic_id/13747/post_id/35683
unity_8p6oRXXqiWbRTQ
Jul 24, 2021 08:06
THis is not fixed at all, getting this error in 2020.3.13f1
nehvaleem
Jul 22, 2021 08:50
Come on, guys. LTS having the lowest priority. Bug reported in February. Still. Not. Fixed.
Could you explain what the LTS means then? Because I am surely misinterpreting this.
gonenb_unity
Jul 19, 2021 10:11
Not fixed, please reopen
iamarugin
Jul 17, 2021 08:51
5 months have passed and still no fix for the UNITY LTS VERSION.
io-games
Jul 13, 2021 06:37
Sorry, for prev comment. It's because Substance.Editor.TextureInspector can not cast
io-games
Jul 13, 2021 06:31
Not usable editor for art team at all.
2021.1.13f1
Hyperg
Jul 12, 2021 08:20
This issue is currently present in 2020.3.12f1 and 2020.3.13f1 and the art team cannot basically use the editor in its current state. Please bump up the importance of this issue before applying the "LTS" status to these builds...
daneobyrd
Jun 23, 2021 17:13
I am continuing to get this error even in 2020.3.12. Not being able to view textures in the inspector is becoming a real annoyance and should be a priority.
futurlab_peterh
Jun 07, 2021 15:16
This issue got introduced somewhere between 2020.3.5f1 and 2020.3.9f1.
On our project we're able to repro it on 2020.3.9f1, but not after downgrading back to 2020.3.4f1.