Simple way to edit multiple terrain at once.

As you know, Terrain component doesn’t allow multi edit on inspector.
So, I’m editing them by a simple script temporarily. Because I have to handle 200+ terrains.
I wonder that is there any way to edit all terrains at once except script.

using UnityEngine;
using UnityEditor;

public class MultiTerrainEdit
    {
        [MenuItem("Tool/Multi terrain edit")]
        private static void SetDrawInstanced()
        {
            UnityEngine.Terrain[] terrains = Selection.activeGameObject.GetComponentsInChildren<UnityEngine.Terrain>();
            foreach (var terrain in terrains)
            {
                terrain.drawInstanced = true;
            }

            Debug.Log($"Done. {terrains.length} items.");
        }
    }

Thanks.

1 Like

Changes were just made to 2019.2 for multi-editing Terrain components. Don’t know if those changes will get backported.

Otherwise, you’ll have to do what you’ve done via script for all the values you’d like to change.

Thanks for confirming.

Hello from 2022,
It is still true right ? Or am I missing something ? But I can’t find how to edit multiple terrain at once…

Heya! I think I was actually incorrect when I originally said multi-editing was available. It is but only through the Terrain Tools package, which you can download via Package Manager. Once downloaded, you can use the Terrain Toolbox window which should allow you to set the settings on the Terrains in your scene in batch.

7 Likes