Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Rotate Terrain Stamp Brush

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

  1. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,097
    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:
    4,097
    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:
    4,097
    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:
    4,097
    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:
    423
    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. ScorphiusMultiplayer

    ScorphiusMultiplayer

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

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    423
    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:
    65
    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:
    423
    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
     
  13. Alahmnat

    Alahmnat

    Joined:
    Feb 1, 2008
    Posts:
    65
    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:
    4,097
    I replied to the same question here.
     
    Last edited: Nov 26, 2020
  16. joebopie

    joebopie

    Joined:
    Jul 7, 2020
    Posts:
    4
    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:
    931
    Can we please get the 3D preview option available in this gitHub repo?
    https://github.com/Roland09/StampToolExtended
     
  19. JeannotL

    JeannotL

    Joined:
    Feb 8, 2016
    Posts:
    2
    This is an awesome time savor! Thank you for creating this! Makes it so much easier to create specific terrains without having to import a gazillion brushes just for different orientation!
     
  20. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,097
    You can already do that in the latest version of the terrain tools using the A/S/D keys. Unfortunately the keybind didn't make it yet into the sceneview help display, so those keybinds are rather useless for everyone.
     
  21. JeannotL

    JeannotL

    Joined:
    Feb 8, 2016
    Posts:
    2
    I am using the latest version of unity and it doesn't work at all for me in the standard terrain tools! But this does work wonderfully and with a nice preview!