Difference between revisions of "Simple edit object tutorial for EECH"

From EECH Central
Jump to: navigation, search
m (Editing the UV mapping of the texture)
 
(Added some common key commands)
 
Line 90: Line 90:
  
 
* Many objects have different levels of detail and collision and shadow objects.  You probably want to change them as well if you do any significant changes to a model.
 
* Many objects have different levels of detail and collision and shadow objects.  You probably want to change them as well if you do any significant changes to a model.
 +
 +
 +
== Common keyboard shortcuts ==
 +
 +
Space bar - switches between selection modes: point, line, polygon. I tend to stay on polygon
 +
 +
/ - deselect current selection
 +
 +
- (as in minus key) - hide selection: this is useful to remove surfaces that you don't need to see, or if a surface is behind another.
 +
 +
\ - unhide all
 +
 +
Shift \ ( | pipe) - hide inverted: this shows what's been hidden, and hides what's visible. So switches hidden.
 +
 +
] - select all connected polygons
 +
 +
Shift a - fit selected polygon
 +
 +
Ctrl a - fit all
 +
 +
" (quote mark: Shift 2 on UK keyboards) - invert selected. So selects everything not selected, and deselects what you selected. This can be useful to quickly hide everything. Select a surface you want to work on, invert everything, and hit the hide key.
 +
 +
In the perspective viewport
 +
 +
Alt and L mouse - rotate around view: this rotates around a centre point of your current view, not the current selection
 +
 +
Ctrl Alt and L mouse - zoom in / out
 +
 +
Shift Alt and L mouse - Move view about
 +
 +
 +
Modify tab
 +
----------
 +
 +
t - move the selection
 +
 +
y - rotate the selection
 +
 +
h - stretch selection
 +
 +
Shift h - size selection
 +
 +
 +
You can also hold Ctrl before using a modifier, and constrain the movement to one direction.
 +
 +
You can select a modify mode, then hit n to bring up the numeric panel, and change something using values instead of moving the mouse.
 +
 +
If you're in a modify mode, hitting Space bar will get you out of it.
 +
 +
 +
Texture related
 +
---------------
 +
 +
q - Change surface: used to assign or create a surface
 +
 +
F5 - surface editor (this is probably where you'll need to look up some tutorials)
 +
 +
In the bottom right, you'll see 5 letters W, T, M, C, S. T is textures. If you select that, then the dropdown shows all the existing UV maps.
 +
 +
Each viewport has some dropdowns at the top that can be used to change a view. If you set one of the viewports to UV, then select a UV map from the dropdown in the bottom right of the screen, then the UV map will be shown in the viewport. You can also show the image for the UW map, so you can see how the textures are mapped.
 +
 +
 +
Other stuff
 +
-----------
 +
 +
i - information on the current selection: can be useful to find the surface that is assigned to the selection
 +
 +
w - statistics: you can use this to select different surfaces by their characteristics. For example, all polygons with a certain surface
 +
 +
At the top right, next to the name of the model there is a number, then some boxes, split diagonally. These are the layers. Everything is usually loaded into layer 1, unless the model is saved in layers. You can split an object to layers, by selecting some polygons, cutting them (Ctrl x), then selecting an empty layer, and pasting. You can then select individual layers, or Shift L mouse click to select multiple layers. If you click in the bottom half of the split layer box, it will show the layer as an outline.
 +
 +
 +
Layers
 +
------
 +
 +
Layers can sometimes be useful if you're working on smaller details.
 +
 +
end - collapse all layers to one layer. You'll need to do this before trying to convert to an EEO or it won't load in game properly, if at all.
 +
 +
home - delete a layer
 +
 +
insert - inserts a layer
 +
 +
F7 - shows the layers panel. Useful if you end up with a lot of layers, and you can name them as well. For my Blackhawk cockpit, I had 15 layers.

Latest revision as of 08:50, 22 March 2020

This is a tutorial for how to make simple changes to objects in EECH using Lightwave. As an example we'll change the landing pads used by the helicopters in EECH to make them a little bigger, and change the texturing so it's not repeating.

Exporting the existing objects

First we need to export the existing objects of EECH, so that we can find the object we need to edit. Use the method described in 3D_modeling#Exporting to export the objects and scenes.

Next we need to find the scene for the object we want to edit. There are too many scenes for it to be effective to look through all of them manually. But you can try searching for something which describes it, most scenes have fairly obvious names. For the landing pad I searched for PAD, LANDING, FARP and MAT. The last two reveals a couple of interesting objects named 00BB_FARP_MAT.LWS and 00BC_FARP_MAT_GREY.LWS. Try opening them up in lightwave layout and bingo, this looks like what we want!

Note for textures to show up you must have a directory called \textures in the root folder on your hard drive where you've unpacked the textures. If you don't see any textures then the problem is probably that you don't have this folder, or that it's missing files.

When you've found the scene you want, click on the part you want to edit in Lightwave Layout. The pad scene has two objects, the pad itself, and a white collision object to the side of it, for now we only care about the object itself, though we want to change the collision object as well eventually, so that helicopters can land on it correctly once we change the size.

Layout.jpg

The selected object should now be surrounded by a yellow dotted box (if you're using default Lightwave colors). Now check the "Current Item" field in the lower left part of the UI. Or alternatively press P to bring up object properties, where there is a "Current Object" field toward the top. Either way it should say 051B for the 00BB_FARP_MAT.LWS scene. That is the name of the object we want to open in modeller, so go ahead and open the file called 051B.LWO in modeller.

Editing the pad object in modeller

Hovering mouse over top edge of polygon, and point mode selected
Selecting the points on the right side from back view

OK, let's do some simple editing of the object! First we want to make it rectangular, i.e. the same size in each direction. By using the top view (top left quarter of screen) and hovering the mouse over the edges of the pad you can read from the position in the bottom left that the upper and lower edge are at 6 and -6 meters, and the left and right edges are at 3 and -3 meters. So we want to move the left and right side a further 3 meters each to make them the same size.

We first select all the point on the right edge. Make sure you're in point selection mode, the Points button should be highlighted in the lower left corner of the UI. If you're not then press space until you are. Then hold the right mouse button and draw a circle around the points on the right side you want to select. If you select the wrong objects you can deselect objects by doing the same again, draw a circle with the right mouse button around the points you want to remove from the selection.

Then press T to start moving them. You can move by holding the left mouse button while moving the mouse in any of the views. But for this case when we know exactly how far we want to move them it's easier to enter the distance yourself. So press N to bring up the Numeric panel then enter 3m as the X offset, and leave the other values at zero. Then press apply in the dialog. Now do the same for the other side, but move in the other direction (-3m instead of 3m).

Editing the UV mapping of the texture

The texture used in the pad is a tiny texture which is repeated tons of times to fill out the entire pad. We want to change it to let the texture cover the entire pad entirely, with no repeating. That way we can make a nice high-res texture with various symbols, dirt etc and not have it be so repeating and uniform.

Display properties

First select the main polygon of the pad. You have to enter polygon selection mode to do this, so press space until you are in polygon selection mode (or just press Ctrl+H). Then click the mouse on the big flat polygon for the pad in any of the views. Then in the top left view, where it says "Top" in the drop down menu, select "UV texture" from that drop down. Then press D to open the display options. Select the Backdrop tab, and from the Image drop down select FARP_MAT.bmp. This is the texture used for the mat. Then press OK.

Modeller5.jpg

Then select the UV map used for this polygon from the drop down in the lower right. First select texture maps by clicking the T button, then select "VertexMapTexture000" from the drop down.

Now you may be wondering how you're supposed to figure out what the correct names for the texture and UV map are when I'm not here to tell you. So I'll now explain how to find it yourself. When you have a polygon selected, press I to open the info dialog. It has a field named surface, so remember the name in that field. Then open the surface editor and select the surface with the name you hopefully still remember. In the field named color, all the way to the right is a highlighted button with a T. Press it. This will open the texture editor which will tell you the name of the image and the UV map in the appropriately named fields.

Info dialog tells you which surface the polygon uses
Surface editor
Texture editor tells you which UV-map and Image this surface texture uses

Now on to the job of changing the UV map. With the correct UV-map and texture as background you will see in the UV-texture view a tiny spec in the lower left edge of the texture. This is not the UV-map, it's the normal, we have to zoom out to see the entire UV-map. Zoom out a lot.

UV texture view

Now that we have zoomed out a lot, we see that it's the polygon which is tiny and the UV-map which is huge. We want to make them the same size. Resizing works the same for UV-maps as it does for polygon, so press H to select the resize tool, and then drag your mouse so that the UV-map nicely matches the polygon. You probably have to zoom in a few times to get it accurate. And we're done! Save the object as a LWO file.

Final result

Well, the texture is of course really low res for such a big object, but that's a simple matter of creating a new texture. Just create one of appropriate size, give it the same name as the old one, and put it in any of the directories in cohokum\graphics\textures.

There are of course a lot more which can be done with modeller, and to create good textures, but that is beyond the scope of this tutorial. But that is not specific to EECH, and there are lots of tutorials around for both, so try one of those if you need more help in modelling or texturing. Now on to getting the object back into EECH.

Converting the object to EECH's format

There are two converters for converting a LWO file back to EECH's object format, EEO. I'll use the one I created myself for this tutorial, but FireBird's converter should work as well, though there may be some differences.

This converter is written in Python, so you will first have to download and install python, if you don't already have it. Then download and put the converter someplace convenient, e.g. in the same directory as your LWO-models. You also need a list of texture names internal to EECH. Put it in the same directory as lwo2eeo.py. Don't put any new names in there, unless you've checked the EECH source code that those names are already in the source code! You only need to add new names if you want to use a texture which is not an image, but generated by EECH, like an MFD or HUD-display, for normal textures they don't need to be named in that file, you just have to put the texture in one of the textures-directories and EECH should find it.

Now open a command line window and navigate to the directory where your model is. Then run the converter like this

lwo2eeo.py 051B.LWO 051B.EEO

Assuming you kept the name of the LWO file as 051B.LWO. If the name of the LWO and EEO file is the same, except for extension, like it is in this example you don't need to provide the name of the EEO-file. It is important that the name of the EEO file is the same as the number of the object in the scene (plus .EEO extension)! Otherwise EECH won't know which object you're trying to replace.

lwo2eeo.py should write something like this:

P:\eech\lwo2eeo.py version 1.4.1

Number of polygons: 17
Number of points: 56

Wrote 051f.eeo successfully!
With some good textures this can be the result

Or if there were any errors or warnings those will be shown. It will also list any textures you need to provide to EECH if you have used any textures not already known to EECH.

If everything was successful then place the EEO file in the cohokum\3ddate\objects-directory, and EECH should detect it and use it the next time it is started!

Notes on modelling, specific to EECH

  • All textures must use UV-maps, not any of the other projection-modes available in Lightwave. Using anything else will result in wrong UV-maps, and possibly even game crashes.
  • Several properties are not supported by EECH's 3D format. My converter will ignore those properties, and write a warning about it.
  • Only use flat, convex, single sided polygons.
  • Many objects have different levels of detail and collision and shadow objects. You probably want to change them as well if you do any significant changes to a model.


Common keyboard shortcuts

Space bar - switches between selection modes: point, line, polygon. I tend to stay on polygon

/ - deselect current selection

- (as in minus key) - hide selection: this is useful to remove surfaces that you don't need to see, or if a surface is behind another.

\ - unhide all

Shift \ ( | pipe) - hide inverted: this shows what's been hidden, and hides what's visible. So switches hidden.

] - select all connected polygons

Shift a - fit selected polygon

Ctrl a - fit all

" (quote mark: Shift 2 on UK keyboards) - invert selected. So selects everything not selected, and deselects what you selected. This can be useful to quickly hide everything. Select a surface you want to work on, invert everything, and hit the hide key.

In the perspective viewport

Alt and L mouse - rotate around view: this rotates around a centre point of your current view, not the current selection

Ctrl Alt and L mouse - zoom in / out

Shift Alt and L mouse - Move view about


Modify tab


t - move the selection

y - rotate the selection

h - stretch selection

Shift h - size selection


You can also hold Ctrl before using a modifier, and constrain the movement to one direction.

You can select a modify mode, then hit n to bring up the numeric panel, and change something using values instead of moving the mouse.

If you're in a modify mode, hitting Space bar will get you out of it.


Texture related


q - Change surface: used to assign or create a surface

F5 - surface editor (this is probably where you'll need to look up some tutorials)

In the bottom right, you'll see 5 letters W, T, M, C, S. T is textures. If you select that, then the dropdown shows all the existing UV maps.

Each viewport has some dropdowns at the top that can be used to change a view. If you set one of the viewports to UV, then select a UV map from the dropdown in the bottom right of the screen, then the UV map will be shown in the viewport. You can also show the image for the UW map, so you can see how the textures are mapped.


Other stuff


i - information on the current selection: can be useful to find the surface that is assigned to the selection

w - statistics: you can use this to select different surfaces by their characteristics. For example, all polygons with a certain surface

At the top right, next to the name of the model there is a number, then some boxes, split diagonally. These are the layers. Everything is usually loaded into layer 1, unless the model is saved in layers. You can split an object to layers, by selecting some polygons, cutting them (Ctrl x), then selecting an empty layer, and pasting. You can then select individual layers, or Shift L mouse click to select multiple layers. If you click in the bottom half of the split layer box, it will show the layer as an outline.


Layers


Layers can sometimes be useful if you're working on smaller details.

end - collapse all layers to one layer. You'll need to do this before trying to convert to an EEO or it won't load in game properly, if at all.

home - delete a layer

insert - inserts a layer

F7 - shows the layers panel. Useful if you end up with a lot of layers, and you can name them as well. For my Blackhawk cockpit, I had 15 layers.