Modding tutorial: DriftInc

This is the tutorial for LFS Car Importer. I'll try to explain very clearly all necessary steps to get a good LFS car modification.
You'll need three softwares:

-LFS Car Importer;
-ZModeler 1.07b (with the MTR export filter installed);
-A good image editor (supporting DDS files).

VS2005 runtime:
-Runtime library

Sections:

-3d Modelling and Editing
-Setting up materials (important!)
-... back to LFS Car Importer
-Saving and releasing file
-Creating wireframes
-Gauges
-Setting up colors

ZModeler 1.07b

ZModeler 1.07b is a freeware software of Zanoza. ZModeler has third-party support which can be used to build plugins. The MTR export filter is a third-party export filter.
There are a couple of things you should know before start your project:
-The MTR filter uses the viewport of this ZM version which means that the front viewport is the front of your car and the default 3d mesh position is in the quadrant 4 of cartesian plan (x e -Z);
-You have to know how to use this software because I won't discuss any tool usage.

LFS Car Importer

LFS Car Importer is a freeware software created by me, MagnoT. This tool is necessary to successfully import car models to Live For Speed (Patch Z currently). It not only imports cars but lets you manage several things related to LFS car models. Although the user version of the present build is limited I didn't encounter any problems to create a LFS car modification. It might support previous version of LFS.
This software is at disposure free of charge. It was developed and licensed to users under the name 'LFS Car Importer'. The user, as Licensee, can not redistribute or sell it. This software does not offer danger to the final user. It does not collect any kind of data or information. I'm not responsable for bad usage.

First of all, you should know what car you are planning to replace.
For this example, I'll take FZs.

Open the LFS Car Importer and load a vob file (FZ.vob in this case).
Now you will notice that a lot of stuff is loaded. We'll concetrate in the material list for now. That's your reference for properly edit you 3d model in ZModeler. The list stores all available materials for FZs cars. We will assign those material names to our 3d model faces.

3d Modelling and Editing

This is the 240sx bonnet as you can see. LFS Car Importer compiles mtr files into vob files using material reference. LFS doesn't use a full 3d model data to build the car in-game, instead, it takes a compiled file to produce its 3d models. We'll just edit a 3d model to fit the mtr file properties. Your 3d model can't reach more than ~9.000 polygons. To have more than this, you can break it into separated parts like: body, interior etc and import every part separately. Every part you import over a child object can't recieve damage though. First thing you should take care of, is to get rid of all unnecessary polygons by deleting them. LFS can mirror faces so if you have faces in one side that would probably be the same in the opposite side, you just delete them.

Noticed that a few faces remain on the other side of the car. The 240sx bonnet has a vent thingy on the right and a flat surface on the left.

That's it. Of course you will repeat this step for whole car body. Get rid of mirrored faces and keep all non-mirrored ones.

Setting up materials

Now we will start to assign material references for those faces.
There are several reserved material names for the MTR 3d model. Keeping the focus on the mirrored faces, I'll select all of them and using the 'Material Editor' I'll set this material name: 'FZ5 TOP1 m a' to all mirrored faces (bonnet).

The first reserved name stands for 'FZ5' car model. There's a big table of reserved car names below.
The 2nd one is actually the name of a material name present in the FZs vob file. In this case, it's the Top of skin.
The 3rd character tells the MTR export filter that this face will be mirrored. And the last one sets a group for this amount of faces.

Car model reserved names force the MTR filter to link faces to a specific car model. These are the Car model reserved names supported by MTR export filter:

"BASE" = Base model. Every car model has a base model;
"RB4" = RB4 model name;
"MRT" = MRT model name;
"RAC", "RAS" = RAC model name and the dashboard model name;
"F08" = F08 model name;
"FBM" = Formula BMW FB02 model name;
"FOX" = Formula XR model name;
"BF1", "BFW" = Formula F1 model name;
"FXR", "FXO", "FXC" = Both FX cars and the roll-cage model names;
"XFG", "XFR", "XFC", "XFS1", "XFS2", "XFIR", "XFIG" = All XF cars, rool-cage, both spoilers and both interiors;
"XRG", "XRGT", "XRR", "XRT", "XRC", "XRRI", "XGTI" = XRG model, XRG and XRT models, XRR model, roll-cage and interiors;
"FZ5", "FZR", "FZC" = FZs car models and FZR roll-cage.

For faces material names you have to search the LFS Car Importer material list for a name that matches the faces you're currently editing.
Most of the names are very friendly and you won't have any problems with them. You can create your own material names too, but I'll talk about that later.
Now I set the name for the left side faces of my 3d model. It looks like the previous one but I've changed the reserved 'M' to 'E'.
This is a special character. You must use it when you're dealing with parts that won't be mirrored. In this case, the faces will be mirrored but they will stay in the left side of the bonnet. Take a closer look at it, it matches the other side of my bonnet model, right over the vent thingy. Right after I set the name, I'll mirror those faces back to the right side and merge them to the rest of bonnet faces (important!).

There are two more reserved characters: '0' and 'I'.
The 'I' character you must use when setting interior materials. Don't forget about the orientation of ZModeler. Everything should be placed in the left (front viewport). The gauges should be in the right side of the car, the dash can occupy both sides without any problems, just keep the part where the gauges will stay on the right side.
'0' character is used to block faces mirroring. I set the vent thingy of my 240sx model to '0', but the faces are divided by groups.

You'll notice that I've set different colors for vent part. Every color matches a different face group, orange for group c as you can see. Faces groups reserved characters avoid bad faces combination (linkage), thus, avoiding bad normal calculation (bad lights). I've set three different groups: orange, yellow and pink. The colors you set won't be exported to the model, they just help you edit. You know that each color represents a group of faces.
You can set up to 10 groups starting from 'A' to 'J'.

All you have to do now is finish your car editing. Repeat these steps to the whole car.

... back to LFS Car Importer

Once you have your 3d model finished you can export it for your first test. With the tool running click in the 'Actions' menu item and then 'Import external 3d model'.
Now your car is already imported and you can edit further things. During the edit process you set materials for doors, lights and everything. All parts that are NOT skin should be fixed.
To fix mapping mismatches, click in the 'Edit / Fix material' menu item. For skin materials (check the materials details control, it shows "Skin material") DO NOT try to fix mapping mismatches.
I'll explain how to do that later.

In addition, you can set several things related to the car parts materials including: texture name (DDS file), material name and set up a texture container.

In order to give you a good control over your modification I wrote special functions to support your needs. Let's understand some of them...
Copy/paste material: use this function to create new materials for your car model. Right after, you can set up its details to fit your need. In the texture name box you can enter the DDS file name of your material or just leave the default one. The material name set will be a derived name of the copied one but you can change it. To apply any changes press Apply button.

Duplicate material: it duplicates a material. DO NOT change the material details when you duplicate a material unless you know what you're doing.

Delete child model: does what it says. Sometimes when you are replacing a car some parts of other car remains so use this function to delete them. Use it carefully because some objects are actually setup data.

Change color: does what it says.

Fix material: does what it says. Necessary when you face texture mismatches.

Change viewport: use it with 'Fix material' feature. Every viewport should be correctly set.

Texture transform: changes texture orientation. Use this carefully. In the materials details part there are 8 boxes and a scale combobox. Some boxes show percentual values and some pixels values, the percentual ones are deprecated though. In the pixel boxes you have to enter a valid pixel offset (multiple of 8) and a valid texture container size (again, multiplie of 8).
Take a look at this picture:

It's a plain surface with my test texture applied to it. It looks messed up though. This is the actual texture I used.

And these are the container settings for this material. The texture transform is fine but the viewport is wrong. The numbers are completely messed up.

The texture size is 512x512. The offset entered is 0x0 (-0.0% means that the Y offset starts from the bottom of the texture. The same happens with the Y size value). To fix this I'll take a closer look at my texture file. Every square is 256x256 so it's easy to set the proper values. To map the surface to the red square I'll type these values:
Offset: X: 0 and -Y: -256 (entry point of the red square);
Size: X: 256 and -Y: -256 (I know that each square is 256x256).
I fix the viewport and material too (the correct viewport is 'Front' and then fix the material). Now take a look at the result:

Voilį! Let's mess it up a little bit:
I'll change the container to the yellow square...
Offset: X: 256 and -Y: 0 (entry point of the yellow square, Y:-0 is the bottom of my texture);
Size: X: 256 and -Y: -256 (I know that each square is 256x256).
Let's take a look:

It's complicated at first but once you get used to it, you see it's easy. Please remember to fix the material after you set the correct viewport.

Saving and releasing file

After you made all changes, save the file and test. If you have plans to share your modification, you can build your car using the 'Build for release' menu option. This option not only blocks LFS Car Importer from loading it back but optimizes the file size too. You can't edit the file anymore so make sure you save a good copy of your file.

Tips and notes

Creating wireframes: it's easy to create wireframes. In addition, you can fix any skin mismatches using this technique. All you have to do is create a big box around your car model (bound box) and map every side of this box to the respective skin material, i.e: side, top, front and back. Export your model and load it into LFS Car Importer. Fix the material for them and save. Back to ZModeler, reset the uv data and assign again including the box (don't forget to copy and mirror the mirrored faces). With the help of a colorful skin texture, move and scale the wireframe to the correct square one by one. Print it and load it into the illustrator software of your choice and that's it! This is the result:

Every part of the car is mapped to a color container. The box model helps you to scale your wireframe properly dragging the car wireframes with it. Once you did it, you can remove the box object from both, model and wireframe view, for a better result.

Gauges: you can have as many gauges as you want. Simply copy (don't use duplicate) the gauge material and assign to your 3d model. You can use this template to check some of the available gauges, the texture is 512x512.

Setting up colors: You set up to 4 different colors for your mods (color slides). To do so, you just have to change the name of the material to 'Color: #"number of the color"'. I.e. Color: #2, Color: #3...

Contact and feedback

If you think something is missing (tutorial or LFS Car Importer) you can contact me in this email address: lfsdriftinc@gmail.com