Locomancer

Locomancer

Not enough ratings
BYOS: Blender
By Selkcip
Explains how to paint your models in Blender and export them for use in Locomancer
   
Award
Favorite
Favorited
Unfavorite
Before You Start
The topic of modeling in Blender is far to broad to cover in this guide so it is assumed that you already have a basic understanding. if you don't, here's[www.blender.org] a good place to start.

When a model is loaded into Locomancer's model editor Blender's X axis points to the player's right, Y axis points away from the player, and the Z axis point upward. This may seem obvious, but I just want to say that what you see in Blender is basically what you get in Locomancer.

The units in Locomancer are metric so one unit in Blender is one meter in the game. The snapping grids on tables have cells that are 5mx5m so it's generally good to work with bounds that are multiples of five when designing buildings.

Spawnable pieces don't use textures so you can use a basic unwrap for the base UV layer.

FBX models support multiple objects and hierarchies so you can make complex models if desired. When a model with multiple parts is loaded into the model editor, each piece will be manipulable and child objects will move with their parents.
Face Grouping and Material Properties
Locomancer uses vertex groups to specify which faces should be painted when using the in-game paint tool. When one face is painted, faces with vertices in the same group will have the same paint applied to them.

In this picture the walls, window frames, and windows are each a separate group:

However, these are not Blender vertex groups as they are not exported to FBX files.

There are two ways to set up these groups. One is to vertex paint faces you want grouped together the same color and the other is to explicitly specify these groups and their material properties using UV layers.

In both cases the first thing you want to do is UV unwrap your model. As I said earlier this UV layer isn't used for textures on spawnables, but it's reserved for models that do use materials.

If you want to set up groups using face colors you can jump to the painting section.

This method is significantly more complicated, but provides finer control over the material properties and these properties will persist if you decide to update the model. Once you have your base layer you want to add a new UV layer in the UV Maps section of the object data tab:


Now open up the UV/Image Editor. Hit the N key to open the properties window and make sure normalized coordinates is unchecked:

Set the pivot mode to "2D Cursor" and enable "Keep UV and edit mode selection in sync"

In the 3D view select all of the model's faces. Back in the UV editor hit S to scale, 0 to set the scale to 0, and Enter to apply the scale. Now you have all the vertices set to the first group with a weight of 0. The weight specifies if these material properties should be used or not:

Add two more UV layers, they will be copies of the layer we just edited:

The material properties of your model are defined by these three UV maps. The first defines the vertex groups and weights, the second defines the metallic (does it look like metal) and glossiness (how shiny is it) levels, and the third defines the translucency (how much light passes through it) and emission (how much does it glow) levels. These values range from 0 to 256.

Select all of your model's faces and set the Y value in the properties window to 256 since we want or material properties to be used:

To set up groups, select the group/weight layer. To assign faces to a group, select the faces
and set the X value in the properties window to a a unique value:

Repeat this for as many groups as you want. I generally increment the value by one for each group. I have yet to assign 256 different groups to a single model, but if you somehow manage to exceed 256 you can theoretically use decimals as well.

Once you have set up all your groups, if you zoom into the UV editor you should be able to see each of the individual groups as vertices:

Select the first group with box (B) select:

Select the metallic/glossiness layer:

The group you previously selected will still be selected and you can set the metallic and glossiness levels by setting the X and Y values respectively in the properties window:

Repeat this step for each group.

You can then do the same for the translucency/emission layer.
Painting
There are two ways to paint your model.

The first way is to paint all of the faces manually.

If you went through the process of assigning vertex groups, you can easily paint groups by selecting them in the UV editor.

If you did not assign vertex groups you will need to select the faces you want to paint manually. Painting multiple faces the same color will automatically assign them to the same group when the model is imported.

When using the in-game paint tool, faces in the same group will be painted a solid color. I find that the easiest way to set solid face colors in Blender is to enable face selection masking (cube with the checkered face):
Select the faces you want to paint (the white outlined faces facing right):
And then setting the vertex colors from the Paint menu or with Shift + K:
The result:

Repeat until satisfied:

You can skip to the exporting section unless you want to get fancy.

The second way to paint your model is to bake a texture to the vertex color. This potentially allows for greater color detail, but will be lost if a player tries to paint your model in-game. How well it works also depends on the poly count of your model as color variation will only show up where there are lots of vertices.

This is where that base UV layer comes in handy.

Switch to the Material tab and create a new material:

Switch to the Texture tab and add a new texture:

Open the texture you want to apply:

In the Mapping section make sure the base UV map is selected:

Switch to the Render tab:

And expand the Bake section:

Set Bake Mode to Textures and check Bake to Vertex Color:

Click the Bake button and you should see your texture applied to the vertex colors of your model:

My model doesn't have very many vertices so most of the detail is lost. However, if I subdivide the mesh I can get it back:
Exporting
When you're ready to get your model in the game, go to the export menu and select FBX:

You shouldn't need to change any of the export settings. You can either export to a temporary location or directly to the C:\Users\[Windows Username]\Documents\my games\Locomancer\models folder (might be My Documents instead of Documents, please ignore the path in the image):

Click the Export FBX button and you're ready to import your model and create your custom scenery.

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=850285056
1 Comments
Davive 17 Jan @ 4:13am 
If anyone has trouble loading a model in the game. Use older Blender (like 2.79b) and export to FBX and set FBX version to "FBX 6.1 ASCII" or some program that can convert it to that.