Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Terrain Rotate Terrain Stamp Brush

Discussion in 'World Building' started by Rowlan, Apr 12, 2019.

  1. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,859
    Is it possible yet to rotate the terrain stamp brush? If so, how? I just tried 2019.1.0f1 and couldn't find an option.

    Thank you!
     
  2. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,859
    Never mind, I just checked the code. It's prepared, but not possible yet. I modified the code so that it works. In case anyone needs it, let me know and I'll put it on github.

    Suggestion though: Currently the shift key is used to invert the stamp. This is a hardly used feature and if anyone uses it, one may as well use the mouse to click the checkbox. I rather suggest - unless anyone else has a better idea - to use

    * ctrl for stamp height change
    * ctrl + shift for rotation change

    Would be as flexible as this (click for animation):

    rot.gif

    Of couse question remains what to use for the brush size and opacity changes :)
     
    AmandaF likes this.
  3. EdgelessCorner

    EdgelessCorner

    Joined:
    Oct 17, 2018
    Posts:
    3
    Nice! I was going to try getting that to work. I'm interested in how you got it to work.
     
    wyattt_ likes this.
  4. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,859
    You need to use your own brush settings, you can't set them in the edit context.

    Basically get rid of the brush size and opacity sliders:

    Code (CSharp):
    1. editContext.ShowBrushesGUI(0, BrushGUIEditFlags.Select);
    and use your own in the Inspector and use those values here:

    Code (CSharp):
    1. BrushTransform brushXform = TerrainPaintUtility.CalculateBrushTransform(terrain, editContext.raycastHit.textureCoord, <your-brush-size>, <your-brush-rotation>);
    I'm not aware as to why they guys at Unity didn't implement rotation yet, the code is there and seems to work, the value is set ot hardcoded 0.

    You can see here how it looks like, also a github reference to the code I'm using. Just check the recent diff:

    https://forum.unity.com/threads/free-path-paint-tool-open-source-github.630832/#post-4425130
     
    AmandaF and wyattt_ like this.
  5. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,859
    I put it on github in case anyone has use for it:

    https://github.com/Roland09/StampToolExtended

    Looks like this:

    example-1.gif
     
  6. apan-bin

    apan-bin

    Joined:
    May 15, 2015
    Posts:
    29
    Thank you!
     
  7. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    368
    We missed the cutoff for getting the rest of our rotation changes in. We've got it set up in our new Terrain Tools package that should be coming out soon. We are using custom brush settings
     
  8. AmandaF

    AmandaF

    Joined:
    Dec 4, 2015
    Posts:
    3
    So much joy in this thread.
     
    Rowlan likes this.
  9. RatBytes

    RatBytes

    Joined:
    Nov 10, 2018
    Posts:
    43
  10. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    368
    Heya. It should be in the current package release. Which versions of the terrain tools package and Unity Editor are you using?
     
  11. Alahmnat

    Alahmnat

    Joined:
    Feb 1, 2008
    Posts:
    13
    I'm using 2020.1.5f1 and there still isn't a way to rotate the brush. The terrain tools appear to be built into the editor instead of available as a separate package (nothing comes up when I search for "terrain" in the Unity Registry, only when I show "Built-in" packages) so I don't know what the version number is for those tools.
     
  12. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    368
    You'll have to enable Preview Packages in Package Manager to see the Terrain Tools package in 2020+. Should be under Project Settings > Package Manager > Advanced Settings > Enable Preview Packages. The built-in tools do not have brush rotation exposed but the tools in the package will along with hotkeys to quickly change brush parameters
     
    Alahmnat and Rowlan like this.
  13. Alahmnat

    Alahmnat

    Joined:
    Feb 1, 2008
    Posts:
    13
    Aha! That's where it went. Thank you!
     
  14. andrevicentegoncalves

    andrevicentegoncalves

    Joined:
    Feb 28, 2020
    Posts:
    2
  15. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,859
    I replied to the same question here.
     
    Last edited: Nov 26, 2020
  16. joebopie

    joebopie

    Joined:
    Jul 7, 2020
    Posts:
    1
    I cant belive after 5 years somthing that was already "done" still isnt standard especialy when its such a nessasry part of terrain creation.
     
  17. Lobotomiac

    Lobotomiac

    Joined:
    Mar 20, 2021
    Posts:
    1
    You can use the shortcut D while moving your mouse to rotate your brush ( I'm using terrain tools on Unity 2020.03.0f1 )
     
  18. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    321
    Can we please get the 3D preview option available in this gitHub repo?
    https://github.com/Roland09/StampToolExtended
     
unityunity