Search Unity

Simple way to edit multiple terrain at once.

Discussion in 'World Building' started by pahctek, Feb 25, 2019.

  1. pahctek

    pahctek

    Joined:
    Feb 11, 2019
    Posts:
    13
    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.

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3.  
    4. public class MultiTerrainEdit
    5.     {
    6.         [MenuItem("Tool/Multi terrain edit")]
    7.         private static void SetDrawInstanced()
    8.         {
    9.             UnityEngine.Terrain[] terrains = Selection.activeGameObject.GetComponentsInChildren<UnityEngine.Terrain>();
    10.             foreach (var terrain in terrains)
    11.             {
    12.                 terrain.drawInstanced = true;
    13.             }
    14.  
    15.             Debug.Log($"Done. {terrains.length} items.");
    16.         }
    17.     }

    Thanks.
     
    Rowlan likes this.
  2. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Changes were just made to 2019.2 for multi-editing Terrain components. Don't know if those changes will get backported.
     
  3. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Otherwise, you'll have to do what you've done via script for all the values you'd like to change.
     
  4. pahctek

    pahctek

    Joined:
    Feb 11, 2019
    Posts:
    13
    Thanks for confirming.
     
  5. AnKOu

    AnKOu

    Joined:
    Aug 30, 2013
    Posts:
    123
    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...
     
  6. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    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.