[Plugin] Triangle Terrain Editor

Hi!

I’ve made this plugin to make custom triangle terrain fast and frictionless.

If you’ve ever tried making triangle terrain using a different plugin, you’ve probably ran into issues like:

  • having to manually manage nodes
  • having to manually flip triangles
  • terrain not being editable anymore once you close the plugin
  • undoing / redoing not working

These are problems you shouldn’t have to think about in the first place.
And it is exactly what this plugin aims to solve.

It takes care of snapping, node management and triangle connections so you can focus on actually making the terrain instead of having to manage all these things.

Note!
This plugin is relatively new. It has not yet been battle tested.
Expects bugs and imperfections


Below is a full overview of all tools, features, and settings.
You can use it as a navigation guide to quickly jump to anything you’re interested in.

Tools & Features

Settings

General

Appearance

Triangle
Color / Material

Other

Other


Tools & Features

Add Tool

Settings associated with this tool

The Add Tool is the primary tool you’ll be using most of the time, so it’s designed to be as intuitive as possible.

Simply click three points to create a triangle.
The plugin will automatically snap to nearby nodes, create new ones when needed, and seamlessly connect triangles.

Add_Tool_Showcase

Just like the Paint Tool, you can hold down Shift to open a color picker.
Click an existing triangle to automatically select its color and material.

Note
Due to limitations in Roblox Studio, this feature only works when the main viewport is in focus.

Add_Tool_ColorPicker_Showcase

Subdivide

Hovering over an existing triangle will highlight it for subdivision (shown in blue).
Click to confirm and subdivide the triangle.

Add_Tool_Subdivision_Showcase

Auto Triangulation

One of the most powerful features of the plugin.

Move your cursor near existing triangles, and the tool will automatically suggest connections to nearby triangles.

Auto_Triangulation_Showcase_1Auto_Triangulation_Showcase_2


Delete Tool

Settings associated with this tool

The Delete Tool lets you quickly remove unwanted triangles.

Hold down the mouse button to start selecting triangles. Letting go deletes the triangles!

Delete_Tool_Showcase

Just like the Paint Tool, you can hold down Ctrl and scroll to quickly change the brush size.

Note
Due to limitations in Roblox Studio, this feature only works when the main viewport is in focus.

Delete_Tool_Showcase_2


Move Tool

Settings associated with this tool

The Move Tool allows you to reshape your terrain by repositioning existing nodes.

Select a node and drag it to a new position. Any connected triangles will automatically follow!

Move_Tool_Showcase

Proportional Editing

A very powerful feature for creating smooth terrain.

When enabled, moving a node will also influence nearby nodes based on a falloff curve.

If you’re familiar with Blender, this works the same way as proportional editing there.
You can hold down Ctrl and scroll while editing to quickly adjust the radius.

Proportional_Editing_Showcase_1
Proportional_Editing_Showcase_2


Paint Tool

Settings associated with this tool

The Paint Tool allows you to change the appearance of the terrain.

Brush_Tool_Showcase_1

Just like the Delete Tool, you can hold down Ctrl and scroll to quickly change the brush size.

Note
Due to limitations in Roblox Studio, this feature only works when the main viewport is in focus.

Brush_Tool_Showcase_2

Just like the Add Tool, you can hold down Shift to open a color picker.
Click an existing triangle to automatically select its color and material.

Note
Due to limitations in Roblox Studio, this feature only works when the main viewport is in focus.

Brush_Tool_Showcase_3


Merge Tool

Settings associated with this tool

The Merge Tool allows you to merge 2 nodes into 1.
Simply click the 2 nodes you want to merge and the triangles will automatically align.

Merge_Showcase


Settings

Snap Distance

The distance (in studs) at which the cursor snaps to nearby nodes.

Snap_Distance_Showcase


Brush Size

Controls the size of the brush used for painting and deleting.

You can quickly adjust the brush size by holding Ctrl and scrolling.

Note
Due to limitations in Roblox Studio, this feature only works when the main viewport is in focus.


Triangle Type

image
This setting allows you to choose whether you want the terrain to be made out of WedgeParts or a single face MeshPart.

Both options produce visually similar results, but the MeshPart option uses fewer triangles, making it more efficient.

Using a MeshPart also opens the door to further optimise your terrain by combining it into 1 big MeshPart. How you can do that is explained here.


Double Sided

(this setting is only visible when Triangle Type is set to use MeshParts)

This setting toggles whether or not the DoubleSided property of the MeshPart is true or false


Thickness

(this setting is only visible when Triangle Type is set to use WedgeParts)

This setting determines the thickness (in studs) of the WedgeParts.


Auto Triangulation

Toggles whether or not Auto Triangulation is enabled.


Max Edge Length

(this setting is only visible when Auto Triangulation is enabled)

Defines the maximum distance (in studs) at which nearby nodes are considered for the Auto Triangulation feature.

When your cursor is within this distance of existing nodes, the Auto Triangulation feature will suggest forming edges to them.


Min Corner Angle

(this setting is only visible when Auto Triangulation is enabled)

Defines the minimum allowed angle (in degrees) for triangles generated by Auto Triangulation.

If any angle of a proposed triangle is smaller than this value, the triangle will be rejected and not created.

Invalid triangles are still previewed, but highlighted in red instead of green to indicate they do not meet the angle requirement.

Below you can see an example of when the angle (indicated in blue) is less than the Min Corner Angle setting.


Proportional Editing

Toggles whether or not Proportional Editing is enabled.


Proportional Editing Radius

(this setting is only visible when Proportional Editing is enabled)

Defines the radius (in studs) around the selected node that will be affected by proportional editing.

Nodes within this radius are influenced based on their distance from the center.
The radius is visualised by the blue sphere.

You can quickly adjust the radius by holding Ctrl and scrolling while editing.

Note
Due to limitations in Roblox Studio, this feature only works when the main viewport is in focus.

Proportional_Editing_Showcase_2


Proportional Editing Falloff Curve

(this setting is only visible when Proportional Editing is enabled)

Determines how strongly nearby nodes are affected based on their distance from the selected node.
Different falloff curves control how the influence fades out.


Material Settings

Use Terrain Color

Toggles whether the plugin uses Roblox terrain colors or a custom color configured with the color picker.

  • Enabled → Uses terrain material colors
  • Disabled → Uses your selected custom color

Use Default Terrain Color

(this setting is only visible when Use Terrain Color is enabled)

Determines which terrain colors are used.


Terrain Color

(this setting is only visible when Use Terrain Color is disabled)

When Use Terrain Color is disabled, the color of the triangles will be determined by this color picker


Match Neighbors

When enabled, newly created triangles will automatically match the material and color of adjacent triangles.

Auto_Material_Showcase_1
Auto_Material_Showcase_2


Material

The material used for creating or painting triangles.


Combining Terrain

As your terrain grows, it can quickly turn into hundreds or even thousands of separate instances.
Especially knowing that each triangle is made out of 3 instances!
(2 parts for the triangle and a model)

image

We can improve this!
To improve it you will need a 3D modeling software. I’m sure almost any 3D modeling software can do this however i will explain it using Blender 5.1 (the most recent version as of writing this)
You don’t need prior experience in blender because i will go through this step by step!

I’m not going to explain how to download blender, there are plenty of tutorials for that out there.

before hopping into blender we first have to export our terrain.

Note
To properly apply this optimization you need to make sure that your terrain is made using MeshPart’s, Not Wedgeparts.

image


Exporting from Studio

Unfortunately the plugin doesn’t yet have a feature to easily export specific triangles. Therefor we have to do it manually.

If you want to export all of your terrain it’s very simple.
In the explorer, simply right click the terrain folder → Save / Export → Export Selection
Now you can store it anywhere on your computer. Just make sure you can find it later!
I would suggest making a new folder and exporting it in there because the terrain will exist out of multiple files.

If you only want to export certain parts of your terrain it’s a little more tedious.

By default all triangles have their Locked property set to true. This prevents you from accidentally editing the terrain. However this is working against us now.

So if we want to select individual triangles we first have to ‘unlock’ the triangles. This can be done manually or by pasting the following code snippet in the command bar

local triangleFolder = workspace.Terrain:FindFirstChild("TriangleTerrain")

if not triangleFolder then
	warn("No triange folder found")
end

for _, trianglePart in triangleFolder:QueryDescendants("[Locked = true]") do
	trianglePart.Locked = false
end

To lock the triangles again you can paste the following code snippet in the command bar

local triangleFolder = workspace.Terrain:FindFirstChild("TriangleTerrain")

if not triangleFolder then
	warn("No triange folder found")
end

for _, trianglePart in triangleFolder:QueryDescendants("[Locked = false]") do
	trianglePart.Locked = true
end

Ok now the triangles are ‘unlocked’ we can now simply use the the Roblox select tool to select the triangles and export it like shown before.

image

Great, our terrain is exported!
It should look something like this (when you’re on windows 11)


Importing in Blender

Next up we open Blender!
(I know most things can be done using shortcuts however for simplicity reasons i will try to use as little shortcuts as possible.)

it should look like this.

First we need to delete the default Cube, Camera and Light.
To do that simply select them in the top right → right click → Delete

perfect! Now we have a blank slate to work with.
Time to import the terrain.
In the top left corner, go to File → Import → Wavefront (.obj)

Navigate to where you saved your terrain.
You should see 2 files. One ending in .mtl and one ending in .obj.
We are only interested in the .obj file!
Click it and then click Import Wavefront OBJ

You might not see it right away. This is because the position of the terrain was also exported. So the terrain might not be at the origin. It might also not be visible because the view distance is not far enough.

How do i increase view distance?

To increase the view distance you can click the little arrow in the top right.

Then go to View and change the End parameter from 1000 to something like 10000.
Now you can see a lot further!

I had to zoom out a bit for my terrain to appear.

To position it at the origin you can click the terrain to select it → right click → Set Origin → Geometry to Origin
It will now be position at the origin.

At last we can delete the assigned material from our terrain. We don’t need it. We will reassign a material and color when we import it back in Roblox Studio

To do that simply select the material → right click → Delete

Perfect! Now we’re finally ready to delete the unnecessary triangles and vertices!


Vertex Optimization

There are 2 ‘issues’ with our terrain that we will improve using blender.
Currently our terrain is still made out of individual triangles. They are not connected. You can see that when you move away a triangle, adjacent triangles don’t move with it.
In other words, each triangle has it’s own vertices instead of the vertices being shared.

To fix this we can merge the vertices. For that we first need to go into edit mode.

First click the terrain to make sure it’s selected. After that, switch to edit mode in the top left corner

You should now see all the vertices and edges outlined.

Next up we need to set our Select Mode to Vertex. Again in the top left corner

Now press A on your keyboard to select all vertices.
Then go to Mesh → Merge → By Distance

At the bottom a menu will appear, open it.
Here we can change the minimum distance vertices need to be away from each other to be merged.
If the number is too big we will merge the wrong vertices. If this number is too low then some vertices that we want merged won’t be merged. I found 1 m to be perfect.

Click anywhere to confirm it and they will be merged.
We’re already half way done.
Which bring me to the second ‘issue’ the terrain has.


Triangle Optimization

Each ‘terrain triangle’ is made out of 2 right angled triangles.
We can again merge those 2 right angled triangles into 1 triangle.

While still in edit mode we now have to change our Selection Mode to Face.

Press A to select all the triangles.
But now instead of merging we go to
Mesh → Clean Up → Limited Disolve

Again a little menu will appear at the bottom, open it.

Here we can play around at what angle they will be dissolved.
For our application an angle of 0.1° is perfect.
You should see it update in real time. So you can play around with it if you want!

You can go into wireframe mode to better see the triangles. If you see that some triangles just won’t dissolve properly no matter how high you set the Max Angle. This happens because the vertices were not properly merged. Repeat the Vertex Optimization step but with a higher Merge Distance

How do i go into wireframe mode?

To go into wireframe mode. You can toggle it in the top right corner

Now click anywhere else to confirm it.

perfect! Our terrain is now done.


Shade Smooth/Flat

One last thing however. Because we merged the vertices, Blender will automatically blend / smooth the shading.

If we want to keep the same appearance that we had before we have to shade it flat again.
This is totally optional if you prefer it smooth you can leave it as it is now.

To shade it flat we first have to go back into Object Mode.

Once we’re in object mode, click the terrain to select it → right click → Shade Flat

Here you can see a before and after.


Exporting from Blender

To export our terrain from blender, in the top left go to
File → Export → Wavefront (.obj)

A menu will pop up. You don’t have to change anything.
Just choose the location and name and click Export Wavefront OBJ

We’re now done with Blender!


Importing in Studio

In the home tab click Import. And select your exported file

Configure how want want it imported. I only ticked Anchored and unticked Set Pivot to Scene Origin.
And clicked Import.

Just reassign it’s color and material and you’re all done!


Comparison

regular optimised
instance count 702 1
triangle count 468 234
vertex count 1404 130
wireframe difference

This optimization is not reversable though. Meaning you can no longer edit the terrain.


What’s Next?

I’m definitely not done with this plugin! There are still a lot of things i want to add however because i’ve been working on it for quite a while i’m taking a break for now to get everyone’s feedback. So any suggestions are more than welcome. I’m convinced that together we can make this an awesome plugin.

Roadmap

  • [Move Tool] Make it snap to a grid.
  • [Delete Tool] Add a delete all button. (for now you can just delete the triangle folder inside of workspace.Terrain it achieves the same thing)
  • Make it so the Move and Add tool snap to nearby parts
  • Add a proper way to export terrain more easily.
  • Add a tool to import heightmaps or generate a large flat grid that you can sculpt
  • improve performance on large terrain.
  • get rid of the triangle folder and make the plugin automatically detect any triangle in workspace giving the user freedom on where they store their terrain.
  • add a button to lock / unlock all terrain.
  • add a button to convert all triangles from WedgeParts to use MeshParts and vise versa.
  • add a way to convert meshparts into terrain triangles.
  • add a button to change the thickness of wedgeparts or toggle the DoubleSided property of the meshparts all at once.

Credits


If you have read this far or if you have skipped to the end. doesn’t really matter.
I want to thank you for taking the time to read this post!

The plugin was initially going to be paid but i decided to make it free anyways. If you do want to support my work, i have a few passion projects on my Roblox profile. Some of them have a donation board. It would be cool if you could check them out. If you do plan on donating, just know i get a message on my phone when someone donates. So i will definitely see it! :slight_smile:

If you made something with this plugin. Please share it with me! I would love to see it!


22 Likes

You’ve done amazing work. I haven’t had the chance to use this plugin yet, but it looks incredible!

This looks amazing and if it stays consistently updated will be massively useful to triangle terrain users.

I was wondering if there is a snap to part option that I missed (see video for example) Watch Discord_XdrOxV5QK1.mp4 | Streamable

There currently isn’t. However it has definitely crossed my mind!
I’ve added it to the Roadmap.
Thanks for reminding me and the feedback!

1 Like