Post by orangemittens on Mar 8, 2015 14:14:36 GMT -5
This is the second section in a series of tutorials that shows how to make a Sims 4 custom object from start to finish. The first part of this tutorial series goes over how to make the mesh. That is posted HERE and should be completed before starting this section of the tutorial. This section will show how to map the mesh made in the previous section.
Mapping the mesh is the process of taking a three dimensional object and creating a resource that tells the game how to place a two dimensional image on it. This is done by separating the faces (the solid portion of the mesh that lies between vertices) and placing them on the two dimensional image. Any portion of the image that lies underneath the area defined by the vertices of the face on the map will be displayed on the face defined by the corresponding vertices of the mesh.
Thus, the mapping process consists, in general, of:
Marking seams that tell Blender how you want the faces cut apart from each other
- "Unwrapping" the mesh (the step where Blender actually separates the faces along the lines you've told it to cut along). During the unwrap process Blender will leave the mesh itself intact and make a copy of each face you have defined. This copy is used for the map. The copy isn't a physical copy of the mesh face...it is a representation of that face that can be manipulated on an image.
- Arranging the separated face copies on a map of the appropriate size for the game.
If you've never made a map this may sound a little confusing at first but as you go along you'll see how this works.
What you will need
Sims 4 Studio
paint.Net or other 2D editor
II. Mapping the Mesh
48. Go to Edit Mode and click the Edge Select button. This will allow you to select the edges between vertices instead of single vertices.
49. Go to the Front Ortho view (click 1 on your keyboard numberpad) and use the box select function to select the top edges of your mesh.
50. Click the Shading/UV's tab on the left side of the 3D view box. You will see the UV Mapping menu.
51. Click Mark Seam. When the seam is marked it will turn red underneath the orange color that indicates it is selected.
52. It is possible to mark many seams at once. Use box select to select all the other edges.
53. Tip your view of the mesh a little and box select all the corner edges also.
54. Click Mark Seam again.
55. Return to the front ortho view and click a on your keyboard to select all the vertices in your mesh.
56. Click Unwrap.
57. You will see your mesh's map show up on the left side in the UV/Image editor view box. Click the New button below that.
58. The New Image box will pop up allowing you to choose the dimensions and generated type of your image. Make the dimensions 512 x 512 and choose UV grid. This will cause the image below your map to change to a checkerboard with colored plus signs on it. The checkerboard pattern will allow you to create a map that has no distortion of the texture you put on your mesh.
59. To see the checkerboard on your mesh in the 3D view go to the Shading menu that is to the right of the 3D view box and select Multitexture instead of GLSL. If you don't see the menu bar to the right of the 3D view box click the n key on your keyboard to make it appear. When you're done with it clicking the n key again will make it go away again.
60. Put your mouse in the UV/Image editor view box and click the a key on your keyboard to deselect all the vertices in your map.
61. Place your mouse over the square in the upper left and hold the l key down on your keyboard. This will select all the vertices that are linked to whatever you have your mouse over. In this case the entire square will turn orange.
62. With your mouse still in the image editor view box click the g key on your keyboard. Just as in the 3D view box the g key allows you to move things in the UV/Image editor view box. After clicking the g key move your mouse to slide the selected square off the checkerboard and into the surrounding work space.
63. Once the square, which represents one face of your mesh, is off the checkerboard map space click the a key again to deselect it.
64. Repeat steps 60-62 for each of the other pieces of your map except the second large square. Move them so they are all in a separate place on the workspace outside of the checkered map area.
65. The square remaining should represent the front face of your mesh. You can double check that it is by moving it a little on the checkerboard. As you do so look at the front face of your mesh and you should see the checker pattern moving on it.
66. With the square selected click the s key on your keyboard to initiate the scale function. When the double arrows appear slide your mouse gently away from the square to make it get bigger. Enlarge it to about the same size as shown below. It doesn't have to be exactly the same. Left mouse click to terminate scaling when it is how you want it. Look at your mesh in the 3D view box. You should notice that as you enlarged the map of the front face the squares shown on the mesh became smaller and more numerous as shown below on the right.
67. Deselect the square and use the l key to select one of the upright rectangles as shown below. Use the g key to grab it and move it so the top of it is lined up on the top line of the square in the center of the checker map area. Use the scroll wheel to zoom in so you can see it and position it better. Move it around while looking at your mesh to see which side it is. It will be either the left side or the right side. Mine is the right side. It should show the same image at the top of the edge on the mesh that it shows at the top of the rectangle in the mapping area.
68. Once it's in position deselect it and box select the two lowest vertices on it.
69.Grab the vertices, constrain motion to the y axis, and slide them down so they line up with the lower edge of the large square. Once you've done this you will note that the squares on the edge of your mesh have become smaller and more numerous.
70. Put your mouse over this section of your map and press the l key to select the entire thing.
71. Put your mouse in the 3D view box and click 3 on your keyboard number pad to get a direct view of the side. If you are working on the left edge of your mesh map click Ctrl and 3 on to get a direct view of the other side.
72. If you zoom in closer to the edge of your mesh you will see that the small plus sign became distorted when you lengthened the map space for it without also widening it. Place your mouse in the UV/Image editor box again and click the s key to initiate scaling. Immediately click the x key to constrain scaling to the X direction (side to side). Gently slide the double arrows away from your map to widen the rectangle. As you do so look at the small plus signs on the edge of your mesh. When the plus sign returns to its normal appearance click your left mouse button to terminate scaling.
73. Click the g key on your keyboard and move the rectangle to one side of the large square. If you were working on the right side, as I was, move it to the right of the square. If you were working on the left side move it to the left of the large square.
74. Click a to deselect that rectangle.
75. Click the l key and select the opposite rectangle.
76. Move it so its left edge lines up with the left edge of the rectangle you just resized.
77. Click the a key to deselect it.
78. Box select the top two vertices of it.
79. Grab the vertices and slide them up so the top of the second rectangle is at the same level as the first.
80. Deselect the top vertices and box select the bottom two vertices. Slide those down to line up with the bottom of the first rectangle.
81. Deselect those two vertices.
82. Box select the two right side vertices.
83. Grab the selected vertices, constrain motion to the X axis, and slide them over to lay on the right two vertices of the other rectangle. When you're done the second rectangle should be the same size as the first.
84. Put your mouse over the rectangle and click the l key to select it.
85. Grab it, constrain motion to the X axis, and move it to the side opposite the first. When you're done the large square in the middle of the map should be flanked on left and right by the two edge map pieces.
86. Deselect all vertices and then box select one of the horizontal rectangle pieces as shown below.
87. Put your mouse in the 3D view box and click 7 on your keyboard number pad to get a direct view of the top of your mesh.
88. Put your cursor back into the UV/Image editor box and click the g key to grab the selected vertices. Slide the rectangle so that it's left two vertices are lined up with the left side of the large square in the middle of the map space. As you move it you should see the pattern move on the top edge of your mesh in the 3D view box. If you don't then you've selected the bottom edge. In that case click the a key to deselect the rectangle and box select the other one instead. Then move that one into the position shown in the picture below.
89. Once the rectangle is in place click a to deselect all vertices and then box select the right two vertices of the rectangle you just moved.
90. Click the g key to grab the vertices and then the x key to constrain motion to the X axis. Slide the vertices over until they line up with the opposite side of the large square in the center of the map space. When you're done you will notice the squares on the top edge of your mesh have decreased in size and increased in number. If you look more closely at the edge of the mesh you will see that the small plus signs have become somewhat distorted and are no longer the exact same shape as the plus signs on the checkerboard image in the UV/Image editor.
91. Deselect all vertices and use box select to select the top two vertices of the rectangle. Grab them and constrain motion to the Y axis (up and down direction). Slide the vertices upward while checking the edge of the mesh in the 3D view box.
93. When you see the plus signs have returned to the appearance they had, that is they match the appearance of the plus signs on the checkerboard image, left mouse click to terminate the grab function.
94. L select the whole rectangle.
95. Grab the selected vertices, constrain motion to the Y axis, and move the edge above the large square as shown below.
96. Deselect the vertices by clicking the a key on your keyboard. L select the last of the rectangles. Grab it and move it so that its top edge lines up with the top edge of the rectangle you were just working with.
97. Resize it so it matches the size of the one you just resized and moved.
98. L select it, grab it, and move it below the large square.
99. Deselect all vertices and then select the small square that isn't yet on the checkerboard map space.
100. Click s on your keyboard to initiate the scale function. When the double arrow appears slide that toward the square to shrink it a lot. When it is very small left mouse click to terminate the scale function. This small square represents the back face of your mesh so, in the game, it will be up against the wall and unseen. This allows it to be very small because the texture distortion this causes won't be visible to the player using your mesh in the game.
101. Click g on your keyboard and move the square onto the checkerboard map space. If it isn't small enough to fit just make it smaller using the scale function again. Once it is placed on the checkerboard map space click File in the upper left corner of Blender and save your work. This is the final high LOD mesh you will import back into the .package later.
102. With your mouse in the 3D view box, click Ctrl + 1 (on your keyboard number pad). This will flip the mesh around so you can see the back face. You will note the checkerboard pattern is very large. This is because the very small space outlined by the square representing it on the map is being stretched to fit over the larger square that is the mesh face. Again, since this is the back of the mesh no one will notice this in the game when the mesh is placed on a wall.
103. Under the view box of the UV/Image editor you will see the word UV's. Click that to get a pop up menu.
104. Select Export UV Layout. Another popup will appear that allows you to save your layout as an image. Save it in your project folder.
105. Open the resulting image in paint.Net. You will see your map and it should look similar to the one shown below.
The next steps of this tutorial will go over how to make the image for your mesh based on the UV map you just exported. That tutorial is posted HERE