Extra Terrain Tools [Plugin] - Rotate, Copy, Paste, and Transfer terrain from one place/game to another easily!


Rotate, Copy, Paste, and Transfer terrain from one place/game to another easily!


Introduction:

Hello developers! Recently, I’ve found myself working in different places to divide my work. I’ve noticed that there’s no easy way to take terrain from one place and put it into another, and that there are no buttons for copying and pasting in the same place as well (I am aware that you can use Control C + Control V, but there are no buttons, only key-shortcuts).

The only ways to achieve that were to:

  1. Use the command bar with the Terrain API. It was an unpleasant process, in which my studio crashed multiple times (due to the corners Vector3s not being set correctly, resulting in negative SizeInCells, which shouldn’t even be possible…)
  2. Use the excellent “Terrain Save and Load” plugin by sleitnick, or modify its Terrain API ModuleScript. I’ve found that I didn’t want to overwrite my entire Terrain in one place just to paste a small portion (in my case, an island) from the other place into it.

All of the above is why I’ve decided to make this plugin for myself and for everyone to use.
If you find any bugs or have feedback, please let me know in this thread!


⛰️How to Use⛰️:

Under the plugins section, you should see the following button to toggle the plugin widget:
image

  1. :blue_square:Region Selection::blue_square:
More Details...

image
Using the Region Selection button, you can select your terrain region easily. Simply press the button, and click on where you’d like the selection box to appear (in the studio viewport).

Once you click on the viewport, a small selection box will appear:


You can switch between the scale (resize) and the move handles by pressing R:
Changing Handles

You can scale both sides at the same time by holding Left Shift while dragging the handles
Dragging Both Sides

Press the deselect button or use the [Esc] key to deselect:
image

  1. :counterclockwise_arrows_button: Rotating Selection (By 90 degrees) :counterclockwise_arrows_button:
More Details...

To use this feature, make sure you first select a region.
After selecting a region, use the Rotate Left and Rotate Right buttons to rotate the region.

image

NOTE: It works best with the selection has a ratio of 1:1 between X and Z axes!

  1. :link:Copying your Selection::link:
More Details...

To copy the region you selected, just press the Copy Selection button of the plugin:
image

(You can also use Control + C if you have nothing selected in your explorer)

The button’s title will change to “Copied!” if copied successfully, or “Nothing Selected” if you’ve selected nothing.

5.:mountain: Inserting the Region Instance :mountain: (Optional: only do that if you wish to paste the terrain in a different place)

More Details...

To paste your region into a different place, you can use the Insert Region Instance feature:

Once pressed, you will find a TerrainRegion in the workspace: (automatically selected after you press the button). Copy that into the desired place.

6.1. :clipboard:Pasting your selection :clipboard: (In a different place/experience):

More Details...

After you copy the TerrainRegion instance into the other place, select it in the Explorer window.
image

Then, press Paste Selected Region (in the plugin’s menu), or press Control V if you have nothing else in your clipboard:
image

You should now be able to select where to paste your selection. Like the Region Selection feature, you have to first click on where you’d like the region selection box to appear.

(At any point you can cancel this by right-clicking the paste button, pressing the [Esc] key, or pressing the deselect button)

It should be orange now and set to the size of the region you selected. (You cannot resize your selection during the pasting step.). Move it to where you’d like to paste it.
Pasting Terrain

When you’re done, press the Paste button again to confirm.

5.2. :clipboard:Pasting your selection :clipboard: (In the same place/experience):

More Details...

After selecting your region and copying it, you can now paste your selection within the same place by clicking the Paste button in the plugin.
You should now be able to select where to paste your selection. Like the Region Selection feature, you have to first click on where you’d like the region selection box to appear.

(At any point you can cancel this by right-clicking the paste button, pressing the [Esc] key, or pressing the deselect button)

It should be orange now and set to the size of the region you selected. (You cannot resize your selection during the pasting step.). Move it to where you’d like to paste it.

Pasting Terrain In the Same Place
When you’re done, press the Paste button again to confirm.

  1. EXTRA: :leaf_fluttering_in_wind:Pasting air with your selection :leaf_fluttering_in_wind:
More Details...

If you don’t want air to be pasted along with your selection, tick off the following checkbox:

One reason you might not want to paste it with your selection is that it replaces other materials with air (Such as water, or anything else you might not want to replace while pasting your selection)

  1. EXTRA: :link:Undo Feature​:link: (Control + Z)
More Details...

If you find yourself having pasted a region in the wrong position, or having forgotten to tick off/on the “Paste Empty Cells (air)” checkbox, or even scaled/moved the selection box wrongly, worry not! I added a feature where you can undo any actions that you’ve done by mistake. To undo something, just use the studio’s undo arrows (in the top left), or press Control Z.

  1. EXTRA: :red_circle:How to break/bug the plugin :red_circle: (In other words, what not to do):
More Details...

I’ve tried to make the plugin as easy to use as possible, but there are several things you shouldn’t do with it (or do at your own risk, you might encounter bugs lol):

Firstly, don’t mess with the TerrainToolsSelectionBox, which includes:

  1. Don’t delete it and the SelectionBox under it.
  2. Don’t move it or resize it using studio’s tools, only the handles provided with the plugin.
  3. Don’t rotate it at all, it might cause inaccurate copying.
  4. Don’t move it from the workspace to a different location.
  5. Don’t change its properties using the properties panel.

image
Secondly, I haven’t thoroughly tested the “Redo” feature yet. That means that for now, I wouldn’t recommend using it (Control Y).

Video Tutorials:

  1. How to copy and paste terrain within the same place:
  1. How to transfer terrain from one game to another:
  1. How to rotate terrain regions (by 90 degrees)

Source Code

If you would like to see how the plugin works, I've documented my entire code with comments to explain exactly what I've done and why.

Visit the link here in Pastebin: Extra Terrain Tools by LightningLion58 - Pastebin.com

Bugs and Feedback:

If you have any suggestions or find any bugs, feel free to reply, and I will attempt to fix them as soon as possible!

Lastly,

This plugin is completely free and available for anyone to use.

I hope you’ve found this helpful, have a wonderful day/night :slightly_smiling_face:!
Thank you for reading!

14 Likes

This is great! It’s allowing me to collaborate with a co-dev, where he builds terrain in a small, convenient place, and then I paste it in this way. The alternative, sharing TeamCreate access, would be risky because any misclick might damage the global terrain system, which is just a giant unary blob of data, and which I might not notice until much later (and fiddling around with loading old place versions and trying to patch up areas which were damaged is very hard)

It would be cool if a functionality like this were part of the default tools. It does feel like I should be able to select a terrain region, right-click “copy”, then switch to another studio instance and paste it in, easily move it, etc.

Thanks for creating this!

1 Like

This is a great plugin, exactly what I’ve been looking for for ages - but is there a way to copy both models/parts with the terrain so they stay in their correct relative position? I’m moving models with terrain into different places and it’s difficult to realign the models with the terrain they were on. I’m also looking to use this as part of a map loader

5 Likes

Hello everyone, I’ve recieved reports of the plugin malfunctioning and that the selection stopped working completely.

I updated the plugin and it’s hopefully fixed now. Please let me know if it is still happening.

Hello everyone!
I’ve received requests asking to add a rotation feature to the plugin.
I’ve now added 2 buttons to the plugin: Rotate Right and Rotate Left.

Make sure you have a selection before clicking them.
Note: It works best when the selection is a square (on the X and Z axis)!

Let me know if you find any bugs with the plugin or with this feature in this thread!

1 Like

hey i cant paste the terrain in the position i want, the paste region button isn’t working like in the video i cant preview and move where i want it

for some reason it just refuses to work in this one place file

Hey, thanks for letting me know.
I’ll take a look at it when I can and will update this thread once I’ve fixed the issue.

Are there any errors in the output when you try to paste?

There were no errors unfortunately

For some reason it refuses to work on this one place file im working on, probably because its so old (since 2019)

Every where else the plugin works flawlessly. I for my case I just did a workaround by working on the terrain on a fresh place and then pasting the whole thing back into the original.

i used this plugin then had a dream that Roblox had actually added c&p terrain and i wasted my time using this

also, this happened to me in a fresh place file

Hey,
Sorry to hear that the plugin didn’t work.
I’ve been quite busy and haven’t quite had the time to work on fixing it.

I’ll try to get to it as soon as I can.

Hello! I been wanting for a feature where you can copy paste terrain along side models/parts, and this is my bare bones implementation of it. Maybe OP can take inspiration and implement something similar?

1 Like

This looks good. I ended up creating a command bar script for copying terrain between 2 parts, then using one of them as a reference for the model, but I’ll probably be using this plugin now!

1 Like