Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Editor errors on first open of terrain tools - see screenshot

Discussion in 'World Building' started by Mjello, Mar 23, 2022.

  1. Mjello

    Mjello

    Joined:
    Mar 26, 2018
    Posts:
    35
    Hi

    Recently I have been getting a lot of errors the first time I select the terrain tools in the editor.
    Once all tools have been selected there are no more errors until i deselect the terrain and open it gain.

    See the attached image.

    It happened after updating the editor from 2021.2.11f1 to 2021.2.16f1.

    Anyone have any idea on how to fix this? It would be greatly appreciated as configuring my project again from scratch is a pain. Offcourse I can rollback to 11f1 but 16f1 fixes some other errors.

    It seems to be a project thing. Removing Terrain tools and using the builtin functions have no errors.

    Creating a new empty project with a new terrain does not have this error.

    It also creates some filterstack files in the application persistent folder. Id be happy to upload them if you think it can help.

    ########### Error log ############# - the first 3

    Retrieving array element that was out of bounds
    UnityEditor.TerrainTools.FilterStackView:ElementHeightCB (int)
    UnityEditorInternal.ReorderableList:CacheIfNeeded ()
    UnityEditorInternal.ReorderableList:GetListElementHeight ()
    UnityEditorInternal.ReorderableList:DoLayoutList ()
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.TerrainTools.FilterStackView.GetFilterAtIndex (System.Int32 index) (at Library/PackageCache/com.unity.terrain-tools@4.0.3/Editor/TerrainTools/FilterStack/FilterStackView.cs:413)
    UnityEditor.TerrainTools.FilterStackView.ElementHeightCB (System.Int32 index) (at Library/PackageCache/com.unity.terrain-tools@4.0.3/Editor/TerrainTools/FilterStack/FilterStackView.cs:221)
    UnityEditorInternal.ReorderableList.CacheIfNeeded () (at <ed149e892fca4713a3001773d054b5ca>:0)
    UnityEditorInternal.ReorderableList.GetListElementHeight () (at <ed149e892fca4713a3001773d054b5ca>:0)
    UnityEditorInternal.ReorderableList.DoLayoutList () (at <ed149e892fca4713a3001773d054b5ca>:0)
    UnityEditor.TerrainTools.FilterStackView.OnGUI () (at Library/PackageCache/com.unity.terrain-tools@4.0.3/Editor/TerrainTools/FilterStack/FilterStackView.cs:111)
    UnityEditor.TerrainTools.BaseBrushUIGroup.OnInspectorGUI (UnityEngine.Terrain terrain, UnityEditor.TerrainTools.IOnInspectorGUI editContext, UnityEditor.TerrainTools.BrushGUIEditFlags brushFlags) (at Library/PackageCache/com.unity.terrain-tools@4.0.3/Editor/TerrainTools/BrushControllers/BaseBrushUIGroup.cs:454)
    UnityEditor.TerrainTools.PaintHeightTool.OnInspectorGUI (UnityEngine.Terrain terrain, UnityEditor.TerrainTools.IOnInspectorGUI editContext) (at Library/PackageCache/com.unity.terrain-tools@4.0.3/Editor/TerrainTools/PaintHeightTool.cs:75)
    UnityEditor.TerrainInspector.ShowPaint () (at <ed149e892fca4713a3001773d054b5ca>:0)
    UnityEditor.TerrainInspector.OnInspectorGUI () (at <ed149e892fca4713a3001773d054b5ca>:0)
    UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <182296579622473385aae82a7777a7d5>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

    ArgumentException: Getting control 1's position in a group with only 1 controls when doing repaint
    Aborting
    UnityEngine.GUILayoutGroup.GetNext () (at <b2402a089b6342f69ac2b0aa0047472d>:0)
    UnityEngine.GUILayoutUtility.DoGetRect (System.Single minWidth, System.Single maxWidth, System.Single minHeight, System.Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <b2402a089b6342f69ac2b0aa0047472d>:0)
    UnityEngine.GUILayoutUtility.GetRect (System.Single width, System.Single height, UnityEngine.GUILayoutOption[] options) (at <b2402a089b6342f69ac2b0aa0047472d>:0)
    UnityEditorInternal.ReorderableList.DoLayoutList () (at <ed149e892fca4713a3001773d054b5ca>:0)
    UnityEditor.TerrainTools.FilterStackView.OnGUI () (at Library/PackageCache/com.unity.terrain-tools@4.0.3/Editor/TerrainTools/FilterStack/FilterStackView.cs:111)
    UnityEditor.TerrainTools.BaseBrushUIGroup.OnInspectorGUI (UnityEngine.Terrain terrain, UnityEditor.TerrainTools.IOnInspectorGUI editContext, UnityEditor.TerrainTools.BrushGUIEditFlags brushFlags) (at Library/PackageCache/com.unity.terrain-tools@4.0.3/Editor/TerrainTools/BrushControllers/BaseBrushUIGroup.cs:454)
    UnityEditor.TerrainTools.PaintHeightTool.OnInspectorGUI (UnityEngine.Terrain terrain, UnityEditor.TerrainTools.IOnInspectorGUI editContext) (at Library/PackageCache/com.unity.terrain-tools@4.0.3/Editor/TerrainTools/PaintHeightTool.cs:75)
    UnityEditor.TerrainInspector.ShowPaint () (at <ed149e892fca4713a3001773d054b5ca>:0)
    UnityEditor.TerrainInspector.OnInspecto
     

    Attached Files:

  2. MrAkroMenToS

    MrAkroMenToS

    Joined:
    Nov 16, 2013
    Posts:
    41
  3. Mjello

    Mjello

    Joined:
    Mar 26, 2018
    Posts:
    35
  4. marvelescent_unity

    marvelescent_unity

    Joined:
    Mar 1, 2022
    Posts:
    7
    Same issues, and was able to stop the errors, but still not able to sculpt. Most say read only, and if it doesn't it still doesn't draw.
     
  5. BigBrotherLee

    BigBrotherLee

    Joined:
    Oct 31, 2016
    Posts:
    11
    But i have no any filter, the error also appear
     
  6. MartinLenahan

    MartinLenahan

    Joined:
    Mar 16, 2017
    Posts:
    1
    Fix seems to work for me.. seems to be an issue with the Masking system. I susspect the issue maybe related to the UI as it mucks up whenever I select an edit option without a filter and it outputs to error.

    Just to confirm fix for any having issues. You need to add a mask type to every edit option.. should be 19. Shink the Terrain inspectors foldout and re-expanding it if the ui screws up, then add ony of the filter types and disable it. Once every edit option is done you shouldnt get any errors.
     
  7. firesightstudios

    firesightstudios

    Joined:
    Mar 29, 2022
    Posts:
    56
    This is still present in 2020.3.32f1 and 2020.3.33f1
     
  8. pzaw

    pzaw

    Joined:
    Apr 26, 2022
    Posts:
    1
    I've just had the same issue with 2020.3.33f1 LTS. Not entirely sure, but importing the Standard Assets pack seems to have caused it as I was able to use before that TerrainTools 3.0.2 for about an hour without errors. Afterwards this would occur any time I had TerrainTools installed regardless of its version. After some investigation:

    2020.3.33f1 LTS - this occurs with TerrainTools 3.0.2 regardless whether I have the Standard Assets pack, none of the fixes/workarounds in the thread posted above seem to be working,

    2021.2.17f1 - occurs as soon as I install TerrainTools 3.0.2 regardless whether I have the Standard Assets pack, the brush mask workaround seems to have fixed the issue,

    2021.3.4f1 - appears fixed with TerrainTools 4.0.3 regardless whether I have the Standard Assets pack.

    It should be noted that previously affected projects got fixed after restarting each in 2021.3.4f1 and importing TerrainTools 4.0.3 (3.0.2 disappeared from the package manager after and was not available anymore).
     
  9. jasonkaler

    jasonkaler

    Joined:
    Feb 14, 2011
    Posts:
    242
    I'm having the same issues in unity 2021.3.2f1 with terrain tools 4.0.3
    sometimes the above workaround helps but mostly I can not use any of the tools
     
  10. SadisticLotus

    SadisticLotus

    Joined:
    Oct 8, 2019
    Posts:
    25
    Same issue with 2021.3.12f1
     
  11. sbswarupbasu

    sbswarupbasu

    Joined:
    Dec 9, 2023
    Posts:
    1
    Terrain Tools 5.0.4
    unity 2022.3.18f1
    when changing brush getting Screenshot 2024-01-30 162514.png error :
    Saving has no effect. Your class 'UnityEditor.TerrainTools.SmoothHeightTool' is missing the FilePathAttribute. Use this attribute to specify where to save your ScriptableSingleton.
    Only call Save() and use this attribute if you want your state to survive between sessions of Unity.
    UnityEngine.GUIUtility : processEvent (int,intptr,bool&)