x


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 ;-)

more ▼

asked Jul 22 '11 at 03:01 PM

BigBulle gravatar image

BigBulle
202 9 12 21

(comments are locked)
10|3000 characters needed characters left

1 answer: sort newest

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.

more ▼

answered May 16 at 05:11 PM

gilley033 gravatar image

gilley033
86 1 1 2

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1521
x22
x2

asked: Jul 22 '11 at 03:01 PM

Seen: 553 times

Last Updated: May 16 at 05:11 PM