Documentation/Articles/Overview of Mesh Editor
From NeoAxis Engine Wiki
| Language: | Status: | Approved |
Contents |
Overview
Mesh Editor is a part of Resource Editor and allows you to:
- view *.mesh files
- assign a material to the mesh
- move, rotate and resize the model
- view and generate LOD (Level of Detail) meshes
- view UV channels and calculate tangent vectors
- view the model's skeleton and animation
Options
To access configuration options, select Options from the toolbar, or through Tools->Options.
There are four parameters under General rollout:
| Property name | Description |
|---|---|
| Background Color | Allows you to set a color displayed in the working window's background. You can either enter the RGBA (Red Green Blue Alpha) values (each in range 0-255) or use a color picker.
Note - background color is only visible when skybox is off. |
| Show Axes | Set to True if you want to see axes gizmo, which is helpful to determine directions in space. |
| Show Grid | Set to True to see a grid. Helpful to determine model scale. |
| Sky Box | Use this option to load a different skybox, which is displayed in the background. |
Editing Mesh Properties
To start editing a mesh, right click on .mesh resource type in Resource window and select Edit. This will enable you to change some properties in the Properties window on the right hand side of the screen, and move, rotate or scale the object. A green border around the working window will appear, and it will change color to yellow once you have made changes to the mesh.
Moving, Rotating, Scaling
If you need to change the position, angle or size of your object, you can use Mesh Editor built-in tools to do that.
Press the Move button to open Mesh Move dialog box. Change the three values according to your needs, keeping in mind that 1 unit corresponds to one grid tile. Press OK to confirm your changes or Cancel to discard them.
To rotate the object, press the Rotate button, which opens the Mesh Rotate dialog box. You can choose the axis around which you want to do the rotation, and set the angle. -90 and +90 buttons add the value to the angle. Maximum value is 359.99 degrees.
To scale the object, press the Scale button. This will open the Mesh Scale dialog box, where you can change the width, length or height of your mesh. 1 means 100%, so if you need to shrink height by half, you have to enter 0.5 in the last field. Likewise, to double the width of the mesh, enter 2 in the first field.
All those transformations can be applied to mesh only or mesh and skeleton (if the mesh has one). Simply check the Apply to skeleton box before clicking OK button to do that.
Assigning Material
To assign a material to the selected mesh, go to Submeshes rollout in Properties window and find the MaterialName parameter. Click on the browse icon to open Choose Resource dialog window.
You will see a list of recources that contain .highMaterial files. (For information about editing materials refer to Overview of Material Editor) Select the desired material by double-clicking on it or pressing OK button. If the mesh uses a material with Normal Mapping, it might be necessary to calculate tangent vectors. The editor will inform you about that. To calculate tangent vectors, press the Channels button. Mesh Vertex Channels window will open. Press Generate button in Tangent vectors section.
Assigning Skeleton
You can assign a skeleton to your mesh (or change the one already assigned to a different one). This can be done by clicking the browse icon in the SkeletonName parameter under General rollout. A Choose Resource window will appear, allowing you to select a .skeleton file. Double click on the chosen skeleton or press OK button to assign it to the mesh.
You can view the skeleton by checking the Show skeleton box on the bottom of Properties window. Once this is active, you will see a set of bones drawn over your model, and by hovering your mouse cursor over a bone you'll be able to see its name.
Note that if a skeleton was not ment for the mesh (i.e. a tank skeleton for a zombie mesh), the model is very likely to be distorted during animation. Always make sure you use the right skeleton, properly bound to the mesh.
Animations can be viewed by selecting a defined animation in Animations rollout in Properties window. If an object is not animated, you will only see 'None' on the list.
Setting LOD
Level of Detail or LOD, is very useful for maintaining a good framerate. Usually, if an object is far away from the camera, there is no need to display it in full detail. In general, the further the object, the less detail is visible. Properties window allows you to view LOD meshes that are assigned to your object, along with their values. Switch between them by selecting a LOD from the LODs rollout You can define different detail levels for your mesh and set the distance from which the object is switched to its less-detailed version. There are two ways to do this:
- automatic - the Mesh Editor will generate the simplified mesh for you,
- manual - you select the simplified mesh from the list of your objects.
Automatic
Computer - generated Level of Detail has a big advantage - it saves the time. You won't have to spend additional resources on preparing simplified models. But it is also less accurate and you have little control over the mesh that is generated. To generate additional LODs, press the Generate button on the Properties window. Generate LODs dialog box will appear.
You can choose how many levels you want to generate, what will be the distance threshold and the reduction percentage for each level. For example, your mesh has 882 faces. If you set Count to 3, distance to 20 and reduction to 40%, you will receive three additional meshes. So you will have four meshes for the same object, each loaded after a different distance threshold is reached. This is how they look:
Manual
If you prefer to use simplified meshes that you created yourself, you can do this by using ManualLODs Collection Editor:
Press the Add button to add a member. In its properties you'll be able to set the value of threshold distance (FromDepth) and select a mesh for that distance.
You can add as many Members as required. Use Up/Down arrows to change their order, or press the Remove button to delete selected Member. Note that you cannot use the same mesh that you currently add LOD to.
UV Channels
UV Channels allow you to see the UV mapping of your mesh (or a Submesh, if your object consist of more than one mesh).
UV Unwrap is needed only for static lighting calculation (lightmaps). You can find more about UV Unwrap in Terms.
Mesh Editor doesn't allow you to edit the existing UV unwrap, but a new unwrapped texture coordinates channel can be generated by the Editor's tool. Currently it is still in development and might not work desired, therefore it is advised to use it only for tests. To access it, press the Channels button on the Properties window. It is a good idea to use a 3d modeling tool such as 3dsMax for calculating UV Unwrap channel.
Here you can also:
- delete a channel,
- assign a channel as unwrap texture coordinates channel,
- generate/delete tangent vectors channel,
- compress a channel which removes duplicated vertices.
Saving changes
Once you have made your modifications, you might want to press the Save button on the toolbar to keep the changes (keyboard shortcut is Ctrl+S). If you change your mind and want to discard the changes, hit Esc and select No in the dialog window that will pop up. You can also save your changes here by selecting Yes or return to editing by pressing Cancel button.






