Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by BigBulle · Jul 22, 2011 at 03:01 PM · terrainsplatmapregisterundo

Undo changes made on terrain's splatmap

Hello,

I have a script that changes automatically the splatmap of a terrain. I would like to be able to undo the changes made by this script through the Unity undo system.

Here is one of the code I've tried:

 Undo.RegisterUndo(myTerrain.terrainData, "Automatic Paint - " + myTerrain.name);
 ChangeMySplatMapData(myTerrain);

Does anyone know how to make it work? (I really would like to avoid Undo.RegisterSceneUndo because my scene is really heavy)

Thanks ;-)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by ModLunar · Jul 16, 2017 at 03:17 AM

I ran into a similar issue with trying to record undo on my terrain's TerrainData before modifying the heights. For my issue, I found that the Undo.RegisterCompleteObjectUndo function worked, so maybe try that?

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MxBoud · Jun 19, 2018 at 04:32 PM 0
Share

Thank's. This worked for me.

avatar image ThePilgrim · Jun 29, 2018 at 01:10 PM 0
Share

This worked for me too, thanks!

         Undo.RegisterCompleteObjectUndo(terrain.terrainData, "$$anonymous$$odify Terrain");
 
avatar image
0

Answer by gilley033 · May 16, 2013 at 05:11 PM

Still looking for an answer on this one. Registering the terrain data should work since the splat map, like the height map, is part of the terrain data; but it doesn't. Has to be a bug.

In the meantime, I guess you have to just implement your own solution. Save the splat map before changing it and create a button that reloads the saved map when you press it.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image gilley033 · Nov 24, 2013 at 05:20 AM 0
Share

Undoing changes to the alphamap still isn't fixed with the new Undo system. It's obvious there is a way, or else Unity wouldn't be able to allow you to undo texture painting. Anyone have a clue?

avatar image hoekkii · Dec 26, 2014 at 06:24 PM 0
Share

I have this problem to... What I did, is creating my own undo, where you can save terrain splatmap (float[,,]) on the stack, and load when pressing a button

avatar image
0

Answer by THE2FUN · Sep 25, 2021 at 09:39 PM

You can fix : https://www.youtube.com/watch?v=bxocsAmweC0&ab_channel=THE2FUN

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Copying sections of terrain textures 0 Answers

Having issues with terrain splat 0 Answers

Terrain Splatmap problem in Edit Mode 1 Answer

How are trees and detail meshes placed on the terrain? 0 Answers

Base map problem when loading terrains from asset bundles in build. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges