Tutorial for Mesh Edit v0.4

Introduction

MeshEdit is a modelling tool for Unity that lets you create and texture 3D meshes entirely inside the scene!
MeshEdit lets you: All entirely inside Unity!
To help you get started, this tutorial will showcase the various features of the tool and show you how to use them to create beautiful assets for your game.

Including the MeshEdit UnityPackage

  1. Unzip the MeshEdit.zip file and move the file "MeshEdit.unitypackage" to a convenient place.
  2. Open the Unity project you'd like to use MeshEdit with, then use the menu on the top row and click "Assets>Import Package>Custom Package..."
  3. Using the "Import package" interface, open the "MeshEdit.unitypackage" from where you saved it.
MeshEdit is now ready-to-go, nice!

The MeshEdit Window

The MeshEdit Window when no mesh is selected
Now that you've added MeshEdit to your project you'll find some new options in the menu at the top of the screen and in the Heirarchy view.
The majority of MeshEdit's functions are found inside the MeshEdit Window, which can be opened through the menu under "Window>MeshEdit."
Once the menu has been opened, place it somewhere you find convenient. The interface shown will change once you create a new MeshEdit object or if you select an existing one in the scene.

Creating your first mesh

A new mesh can be created by pressing the "Create Custom Mesh" button in the MeshEdit Window. If the window is closed or out of reach you can also create a new mesh through the menu under "GameObject>MeshEdit>Create Custom Mesh."
Once created, your new mesh will be sitting in the middle of the scene view.
A new mesh in the scene view
Whenever a MeshEdit object is selected, new options will appear inside the MeshEdit Window (if the MeshEdit window isn't open at this point you can open it with using the button in the top-left of the scene view). The new window has a series of "modes" that you can switch between using the drop-down menu at the very top of the window. Each of these modes lets you edit a different aspect of your model:

The Default mode

The Default edit mode
The default edit mode! There's nothing much to see here, the default mode gives you all the standard controls of a Unity Gameobject without letting MeshEdit get in the way.

The Mesh Edit mode

The Mesh Edit mode
Vert normals on a smooth mesh, split by a sharp edge (in red)
Here's where the fun happens! This is one of the MeshEdit's main modes. From here you have complete control over your model, you can transform, extrude, delete and cut faces, you can create primitives and you can fully edit the UV map on your model. For a guide to using the UV editor, check out the section on it here.

Selecting parts of the mesh

Selecting verts/faces with the Right Mouse Button
Before you can transform the mesh, you need to select the area you want to modify. For more ways to select parts of your mesh you have the following options:

Modifying the mesh

Selecting a face (RMB), moving it (G), scaling it (S), rotating it (R) and extruding it (E)
While you have any verts/faces selected, you can modify them using shortcuts on you keyboard. MeshEdit works mostly through the keyboard and has no buttons in the MeshEdit window to replace these functions.
First, select a group of vertices, then hit any of the following keys on your keyboard:
  • Hit G to move the selected vertices and faces with the mouse.
  • Hit R to rotate the selected verts/faces.
  • Hit S to scale the selected verts/faces.
  • Hit E to extrude the selected verts/faces.
While you're in the middle of a transformation you can use the following keys to make your changes more precise:
  • X, Y or Z to constrain your transformation to a single axis
  • Shift+X, Y or Z constrains your transformation to only the other two axes
  • Holding CTRL/CMD will snap your changes to the nearest unit
  • Holding Shift+CTRL/CMD will snap your changes to a finer degree
Applying a loop-cut to a mesh that's been made transparent with Z
Now that you know the basics you can start to edit your mesh a bit more:
  • Loop Cuts can be made by pressing Shift+R and moving your mouse around the mesh to find the right spot to cut. While finding where to cut the mesh you can use the scroll wheel to increase/decrease the number of cuts you want to make. Once you've found the right spot click with LMB to make the cut. To exit loop-cut mode without making any cuts, click RMB.
  • Delete selected faces by hitting Del in face-select mode.
  • Dissolve the selected vertices by hitting Del in vert-select mode. This will attempt to dissolve the selected verts into the mesh, any verts that cannot be dissolved will be deleted.
  • Flip Faces by hitting F in face-select mode. This will change the direction of the face normal.
  • Create Faces by hitting F in vert-select mode. Since you can only create quads with MeshEdit, exactly four vertices must be selected first but you can also create a face when only two or three verts are selected if there is a free space for a face to be added.
  • Resaddle all selected faces by pressing D. This will rearrange the triangles in a face so that they fold in the opposite direction. This is useful for making fine edits to a mesh and for making sure textures and vertex colours display correctly on a certain face.
For the full list of ways to edit a mesh, see the Shortcuts section at the end of this tutorial.

The Tile Edit mode

The Tile Edit mode is where all the texturing magic happens! Here you can select which tilesets your model will use and paint tiles directly onto your model's faces.
To use the Tile Edit mode you'll either need a texture that's has some tiles laid out,m or a tileset created in MeshEdit's tileset builder (for info on creating a MeshEdit tileset, follow the steps in the Creating a tileset section).

Painting with tiles

The Tile Edit mode
First you have to select a texture to pull your tiles from. If you've created a preset tileset you can use the dropdown interface to select it, otherwise keep the dropdown on "Use a Texture" mode and enter the appropriate settings using the Tiles Width, Tile Height and Spacing which will define the dimensions of each tile and the number of pixels between each tile on the texture.
From here you can select the tile you want to paint with in the tile-picker. Once a tile is selected click any face on your model with the "Left Mouse Button" and the tile will be applied to the face. Tiles always apply themselves upright relative to your view but you can change this with the Q and E keys, which will rotate the angle of the tile by 90 degrees in either direction. The black arrow in the MeshEdit window shows the current tile direction.
To speed up the process of tiling a mesh, you can use W, A, S and D to change the selected tile to the adjacent tile on your tileset.

More UV control

A model textured using a small UV map inside a single tile
Below the tile-picker you'll find a nifty little interface where the tile you selected has been blown up to full size. Click & drag any edge or corner of this square to change the UV-shape you'll paint the mesh with. This is extremely helpful when you want to UV small details or weird shapes.
  • Reset restores the UV shape to it's default size.
  • Use custom UVs toggles whether the tile painter uses the custom UV shape when applying a tile to the mesh.
  • Snap to Pixels will ensure that the UV shape always aligns to the pixels on the tileset.
  • Move UVs rotates the points of your UV shape 90 degrees in either direction, but the UVs remain upright.
If you've painted a face with a custom UV-shape and need to use that same shape again later, you can click the face with "Alt+LMB" to copy the UV-shape it was painted with.

Materials

The material picker on a model with three materials
As well as texture tiles, a model can have multiple materials applied to it through the Tile Edit interface.
The selected material will be applied to a face on the model when a new tile is painted onto it. If you'd like to change the material of a face without changing its texture, select the material you want on your face, then click the face with Shift+LMB and the material will be changed without affecting the model's UVs.
The selected material can be changed by clicking on any of the available materials in the material picker. You can also use "+ Add Material" to add a new material to the selection, and "- Delete Material" to delete the currently selected material.

Imported meshes

If you imported your mesh from an .obj file, this interface will not appear. This is because the UV coordinates created using tilesets are calculated differently than they are in other modelling programs. To convert the imported model's UVs, you just need to hit the "Convert to Tileset" button, but beware! You won't be able to get the original UV map back!

The Vertex Colour mode

A basic mesh with coloured faces and vertices
The Vertex Colouring mode lets you set the vertex colours of your mesh. You can also paint entire faces instead of vertices without the colour blending into the neighbouring areas.
  • Paint Mode decides whether you're painting the verts or the faces of your mesh. You can toggle this with "CTRL/CMD+Tab."
  • Paint Colour is the colour you paint with.
  • The area below the paint colour is the paint history. This shows the last 20 unique colours that you used. Clicking any of the colours in this palette will set it as the current paint colour.
Use the colour picker to choose the colour you want to paint with. Then, using the left mouse button you can apply that colour to any verts or faces covered by the circular brush around the mouse. For more control you can use the scroll wheel to increase/decrease the size of the brush.
Using face and vert painting to add more detail to a model
If you want to get more interesting results using vertex colours, you can modify the shader that your model uses. The examples shown here use a shader with the standard, additive-blend colour mode.

The UV Editor

The UV Editor, found in the window during Mesh Edit mode
The UV Editor lets you manually edit and unwrap the UVs on your mesh. To open the editor, switch to Mesh Edit mode and open the lowest foldout menu labelled "UV Editor."
The main UV interface contains the following options:
  • [ ] Centers and zooms the UV View to its default position.
  • Texture shows the currently selected texture. This does not affect the texture or the material of your mesh, it only gives you a background to work on top of. To change the textures on your mesh see the section on the Tile Edit Mode, or change the texture manually through Unity's material inspector.
  • Mark seam marks all the selected edges on the mesh as seams. When unwrapping, the mesh will be split along any edges marked as seams. To erase a seam, select the edge on the mesh and hit "Mark seam" again to remove the seam.
  • Unwrap selection will take all the selected faces on your mesh and unwrap their UVs into an editable shape in the UV Editor. You can also unwrap by pressing U while editing the mesh in the scene view.
UV Settings:
  • Pin will take all the UVs selected in the UV View and pin them to their position. Pinned UVs will always stay in their pinned position when unwrapping, but UV islands with pinned vertices will not be considered when packing a set of unwrapped UVs.
  • Unpin will remove pins on all selected UVs.
  • Only show selected faces will only show UVs in the UV View if the face they belong to has been selected on the mesh. Leaving this unchecked will show all the UVs on the mesh.
  • Snap UVs to pixel will cause all UVs to snap to the nearest pixel on the chosen texture during transformations. This option cannot be used if no texture is available to snap to.
  • Export UV Map will save your current UV map as a .png file that can be painted over. The dimensions of the texture saved can be changed using the Width and Height settings below the button.

The UV View

The UV View showing an unwrapped mesh
The UV View shows the meshes' UV map. Use this view to edit your UVs like you would your mesh in the Mesh Edit mode. You can change between UV selection and UV-face selection by changing the selection mode at the top of the Mesh Edit section.
  • Select a UV with LMB and use Shift+LMB to select additional UVs.
  • Transform your selected UVs by hitting G to move the selection, R to rotate and S to scale. Use RMB while transforming to commit your change, or LMB to revert them.
  • To snap your changes the nearest degree, hold Shift or Shift+CTRL/CMD for a finer snap. You can also set your transform to follow the X or Y axis by hitting X or Y respectively.
  • Press A to select all UVs in the view, press A again to deselect all UVs.
  • Hold Alt and select an edge or a face with LMB to select a loop of UVs.

Creating a tileset

Tilesets are a combination of multiple textures that have been smashed together into a single alias for your model. In previous versions of MeshEdit, pre-defined tilesets had to be created before any tile editing could be done on your mesh. This is no longer the case, now any texture can be loaded into Tile Editor dynamically but the option to create a predefined tileset can still be helpful if you have multiple textures you want to pack together, or if you want to extrude the edges of your tiles to prevent texture issues.

Before you start

The tileset folder, place all the textures for your tileset here
To create a tileset, you'll need at least one texture. The Tileset window will take these textures and compile them into a single texture page but first, your textures need to be formatted in a specific way.
Fortunately, MeshEdit contains a custom importer that will do this for you, as long as your textures have been placed in the correct folder. Make sure that when you bring your textures into Unity, that you put them in the "Assets/MeshEdit/Tilesets/Tileset Assets/" folder.
Textures that aren't in this folder can't be read by the tileset creator, unless you've specifically set their "isReadable" property to "true."

The "Tilesets" window

The "Tilesets" window
Now that you have your textures in the right folder, you're all set to create a new tileset:
  1. Open the window by clicking on "Windows>Tilesets" in the menu
  2. To create a new tileset, hit the "+ New Tileset" button
  3. Fill in all the boxes to define your tileset:
    • File Name is the name of the tileset, make sure it's unique to the other tilesets before you apply any changes!
    • Tile Width and Tile Height refer to the size of each tile. This should be the size of the tiles in the textures you're giving to the tileset.
    • Tile Spacing defines the amount of outline you want to add to each tile in the tileset, this helps get rid of visual issues on the textured Mesh.
    • Textures is the list of 2D textures used to make the tileset.
    • Page Size (the little label at the bottom of the window) shows the final size of your tileset. This is also the size of the final, compiled texture that your model will use. This value cannot be changed without adding/removing textures from your tileset.
  4. Apply changes. No changes are saved until you hit this button! This will save your new tileset and make it available to use in MeshEdit's "Tile Edit" mode. If you ever edit a texture that's used by your tileset, just hit "Re-Apply" changes to update the tileset, otherwise your changes won't show up.
Once the changes have been applied, the tileset manager will combine all your assets into a single texture that can be found in "Assets/MeshEdit/Tilesets/TexturePages/." This texture will be applied to your models automatically when you use MeshEdit's tile editor.
And that's all there is to it! All the tilesets you've created will appear in the drop-down menu of MeshEdit's "Tile Edit" mode. Once you get bored of a tileset, you can just delete it using the "-Delete Tileset" button, but be careful! There's no saving the UV data on a model if the tileset is still being used somewhere in your game.

List of shortcuts

Shortcuts used in all edit modes

Tab
Shift+Tab
Numpad 7
Numpad 1
Numpad 3
Numpad 5
Switches to the next edit mode
Switches to the previous edit mode
Shows the model from above, hit it again to view the model from the opposite side
Shows the model from the front, hit it again to view the model from the opposite side
Shows the model from the side, hit it again to view the model from the opposite side
Toggles between perspective and orthographic view

Shortcuts used in Mesh Edit mode

hello
RMB
Shift+RMB
CTRL/CMD+Tab
Alt+RMB
Alt+Shift+RMB
A
L
C
Z
Shift+R
hello
G
R
S
E
U
hello
LMB
RMB
X, Y, Z
CTRL/CMD
Shift+CTRL/CMD
hello
LMB
MMB
RMB
Scroll
hello
LMB
RMB
Scroll
hello
Del
F
hello
Del
F
D
hello
CTRL/CMD+C
CTRL/CMD+V
CTRL/CMD+X
Selection
Selects the nearest vert/face
Adds the nearest vert/face to the selection
Toggles the selection mode between vertex select and face select
Selects a vert or face loop
Adds a vert/face loop to the selection
Selects/Deselects all verts/faces
Selects a section of unbroken faces on the mesh, starting from the first face under the mouse
Activates circle-selection
Toggles whether the mesh is transparent or opaque
Activates loop-cut mode
Modify the selection
Moves the selected verts
Rotates the selected verts around their center
Scales the selected verts
Extrudes the selection
Unwraps the UVs of the selection
While Moving/Rotating/Scaling a selection
Commits the change to the model
Cancels the transformation
Sets the axis that the current transform follows
Snaps the current transform to the nearest value
Finely snaps the current transform to the nearest value
Circle-Selection mode
Selects all verts/faces in the selection area
Deselects all verts/faces in the selection area
Exits circle-selection mode
Changes the size of the circle-selection area
Loop-Cut mode
Cuts the mesh
Cancels loop-cut
Changes the number of cuts
Vert-Select mode
Attempts to dissolve the selected verts into the mesh and deletes all verts that can't be dissolved
Attempts to create a face between the selected verts, works best when four vertices are selected
Face-Select mode
Deletes the selected faces
Flips the direction of the selected faces
Changes the saddling direction of the selected faces
Other
Copies all selected faces to the clipboard
Pastes faces from the clipboard onto your mesh
Deletes the selected faces and adds their data to the clipboard

Shortcuts used in Tile Edit mode

LMB
CTRL+LMB
ALT+LMB
W, A, S, D
Q, E
Paints the selected quad with the selected tile and UV information
Retrieves the UV shape that was used to texture the selected quad and copies it to the UV editor
Finds the approximate shape of the selected quad and copies it to the UV editor
Changes the selected tile
Changes the orientation of a tile when applied to a face

Shortcuts used in Vertex Colouring mode

LMB
MMB
Shift+Scroll
CTRL/CMD+Tab
Paints the selected vert/face
Erases the colour on the selected vert/face
Change the size of the paintbrush
Toggles the paint mode between vertex and face painting

Issues and limitations

MeshEdit is a limited modelling tool, it's designed to let you work quickly so there are some features that it does not have. The two main limitations of MeshEdit are:
  1. You can only create quads. You can control the orientation of triangles inside a quad by resaddling it, but there is no way to create a single triangle or a poly.
  2. Some operations will run slowly when your models grow too large. Models over 1000 faces may cause lag when some intensive operations are used.

Upgrading from v0.3

Version 0.4 for MeshEdit features some large changes that will conflict with any earlier versions of MeshEdit, if you are trying to install MeshEdit v0.4 on an existing project with MeshEdit v0.3 installed, this guide will help keep your work in tact during the upgrade.
The first major change is that v0.4 has all files consolidated into a single folder under "Assets/MeshEdit/." Older versions have separate parts scattered througout the Unity project they were imported to. Please make sure all of the following files and folders are deleted before importing the new MeshEdit package. If you have created tilesets in MeshEdit, make sure that the contents of "Resources/Tilests/" and "Editor/EditorResources/Tilesets/" are copied to a safe location before deleting.
  1. "Editor/EditorResources/"
  2. "Editor/MeshEdit/"
  3. "Resources/Tilesets/Constructed"
  4. "Scripts/MeshEdit.cs"
  5. "Scripts/Tileset.cs"
Once deleted, install the unitypackage for MeshEdit v0.4 and copy the saved tileset information to the new folders as they correspond:
  1. "Editor/EditorResources/Tilests/" -> "MeshEdit/Tilesets/TilesetInfo"
  2. "Resources/Tilesets/Constructed/" -> "MeshEdit/Tilesets/TexturePages"
  3. Files inside "Resources/Tilesets/" -> "MeshEdit/Tilesets/Tileset Assets"
MeshEdit v0.4 should now be ready to go! The next time you select a MeshEdit object created in version 0.3, a series of warnings should appear in the console. These warnings show that the new data that didn't exist in v0.3 is being created for the model to fit version 0.4.
While editing a model from v0.3, the texture may disappear from your model. This can be fixed by switching to Tile Edit mode and selecting the tileset that was last used on the model.

Thanks for Reading!

Thanks for taking the time to read the guide and for supporting the tool! I hope Mesh Edit will help you with whatever amazing projects you're working on.
If you find a bug or think of an incredible new feature you'd like to see, feel free to leave me a message on Twitter, or email me at "rollojamie@gmail.com." And if you make anything neat with the tool, I'd love to see it!
All the best - Jamie