|
|
|
|
|
|
|
|
|
|
|
|
Multiple MaterialsPurpose: This tutorial will cover how create multiple material ids for your mesh in Blender. Keep in mind that you can’t export a material created in Blender with the mesh. This tutorial will allow you to assign multiple materials to the mesh inside the editor. Keep in mind that static meshes normally only have 1 texture/material assigned to them. While the editor can easily handle multiple materials per mesh, there are guidelines. If the mesh is going to be unique (used once), having more materials assigned to it isn’t really a problem. The more the mesh will be duplicated in the level, the fewer materials it should have assigned to it (two is fine). Check out Hourences tutorial for more info. Requirements: You need a basic understanding of the editor and Blender (including exporting a mesh to an .ase file). Understanding how to create basic materials in Blender is helpful (See the following tutorials for more info: Noob to Pro & Blender.org). You will also need to know how to import a custom mesh into the editor (See Waylon’s tutorial fore more information). Files: I have created 1 .blend files, 2 .ase, and a .ut3 file (unpublished) to give you a specific example. You can download them here. In Blender...1. Start up Blender and delete any default meshes. 2. Add a cube mesh. If you can, set the size of it to (256x256x256). 3. In Object Mode, select the Editing Panel (F9 key). In the “Links and Materials” section, select the “New” button once for each material you need. 4. Right above the “New” button, select the left or right arrow so that first material is selected. a. Keep in mind the first number is the total number of materials and the second is the one that is selected. 5. With material #1 selected, go to the Shading panel (F5 Key), the the Texture button (F6). 6. In the “Texutre” section, select the “Add New” button. In the “Texture Type” drop down menu, select “Image”. Two new sections appeard (“Map Image” and “Image”) 7. In the “Image” section, select the “Load” button. Find the texture, select it and select the “Select Image” button. a. Based on my understanding, it technically doesn’t matter what image you select as we are only creating a slot for it. How the texture is applied to your mesh is done when you UV map the mesh. 8. Go back to the Editing Panel (F9 key), select the next material and repeat steps 5-7 for each material. 9. Go to the Shading panel (F5 key) and select the “Material buttons” (looks like a red ball). 10. In the “Link to Object” section, select a material. 11. In the “Material” section, select the “Col” (Color) button and enter a value for “R”, “G”, and “B” (Red, Green, and Blue). a. This color is only important so you can see which materials have been applied to the mesh in Blender. Be sure that each color is unique enough to tell the difference between them. 12. Repeat this for each material you create. 13. Once you have assigned a texture and a color to each material, you now need to apply each material to a specific part of the mesh. Go to the Editing Panel (F9 key) and select a material. a. By default, the first material you created will be assigned to the entire mesh. 14. Go into Edit Mode (Tab key) and make sure you have “Face Mode” (Ctrl+Tab+3) selected. 15. Select a face (or faces) and in the “Link and Materials” section, select the “Assign” button. a. You need to view the mesh in the solid “Draw Type”. 16. Repeat step 16 for each material. 17. Once the mesh is ready (you will also need to UV map the mesh), export it to an .ase file. a. Depending on what exporter you are using (problably a version of the Goofos one), you need to make sure that the Materials are exporter with the mesh. Keep in mind that it’s only exporting the information of which material is applied to which face/faces. The actual material is not exporter with the mesh. The placement of the material is determined by how you UV mapped the mesh. In the Editor...18. Import the mesh into the editor and add to your map file. Locate the mesh in the Generic Browser and double-click on it to open up the Static Mesh Editor. 19. Expand the “LODInfo” section, then “[0]”, then “Elements”. This will show all the available material slots. a. Keep in mind that Blender starts counting at 1, while the editor starts with 0. So your #1 material in Blender will be your #0 material in the editor. 20. Find your material and apply it to the appropriate material slot. My Example1. I created a cube in Blender (256x256x256). 2. I created 4 materials and assigned the following colors (Material 1=Red, Material 2=Green, Material 3=Blue, Material 4=Black). 3. By default, material 1 was applied to the entire mesh. So I just applied materials 2, 3, & 4 to one face each. 4. I created a very basic UV map (Unrwrap smart projections). I did this so you can see materials applied to the mesh in the editor. 5. I exported 2 versions of the mesh. The first one (Multiple_Materials.ase) had the “Materials” button on my exporter selected, which remembered the materials I crated and which face they were applied to. I also create another one (Multiple_Materials_None.ase) which didn’t have the “Materials” button selected. I created one material slot for the entire mesh. a. If you never create any materials in Blender, it will always have one material slot assigned to it. 6. After importing the mesh into the editor, I create 4 basic materials (red, green, blue, & black) and assigned them to the corresponding material slots. a. In the editor (viewing from a top down view), the upper left mesh is one with the four material slots with the basic materials applied to it. Below it is the same mesh with some stock materials applied to it. The mesh on the right was the one that only had one material slot create because I didn’t select the “Materials” button when exporting. It also demonstrates how a mesh that doesn’t have any materials assigned to it in Blender will look like once in the editor. You can download the 1 .blend, 2 .ase, and the .ut3 map file for the above example here. Written by Odedge (Linked tutorials are created by their respective authors).
|
|