The first difference to realize between making colors in Blender for 3D printing and the usual way of making colors in Blender is that you have less control. All you can control is the diffuse color. You cannot make the object shinier by adjusting the specularity, you cannot add transparency, or any of the other controls. In this respect, a 3D printer is like a regular printer. All it understands is a colored pixel. If you use transparency, at best it will show you the bare physical material underneath. Shininess, specularity, and so on are all properties of the material that you are printing with.
There are three ways to color your model:
Many 3D printers do not handle color. This includes printers that print metal, extruded plastic, or liquid resins. The final color of the object comes from the material selected. Many colors and materials are available. You can dye or paint the objects after they are printed. The lunar lander in Chapter 1, Designing Objects for 3D Printing, was printed in this way. It was printed in white nylon then dyed yellow and grey. Next, the joystick was painted red and black with acrylic paint and a small image of the lander's touchscreen from a standard color copier was glued into place. Blender exports an STL file for printers like these.
Assigning color to the polygons is the easiest way, but it's also the most limited because your minimum detail is constrained by the size of the polygon. When you select a polygon and assign a color to it, the color is assigned to all vertices of the polygon:
red
.yellow
.That's pretty simple, and when it is printed, you will have a red cube with one yellow side.
Blender has painting tools included to do vertex painting, which is much easier than just selecting faces and assigning them colors and produces a better result. Vertex painting allows you to set the colors vertex-by-vertex. Then, the computer blends the color between the vertices. So, between a blue vertex and a white vertex, the edge and part of the face will go from blue to light blue to white. Let's see how vertex painting works:
15
. Put the cursor over the sphere. Press the LMB and move the mouse to paint some of the sphere.Pretty easy! You can see how the colors are centered at the vertices and blended between them. Feel free to play a little more with coloring and rendering.
The most powerful way of adding a texture to your object is by using a texture map. Do not use a texture map and vertex colors on the same object, especially if the two methods share a vertex. The 3D printer may not choose the right material.
Make sure you delete any unwanted materials before exporting your object for 3D printing. This is easy. With your object selected, just select the materials button on the Properties window header. It's the one that looks like a chrome ball. At the top will be a list of the materials assigned to the active object. If you click on them, the Preview window will display a preview of that material. To delete the material, simply click on the minus button to the right of the list of materials.
Texture mapping gives you the best control over the color of any part of the surface. It also gives you controls so you can assign the locations of different regions of the texture and use another program such as Gimp or Photoshop to create fine details.
The most common colored 3D printing material is gypsum, sometimes called sandstone. The following graphic is a chart of colors used in printing full color sandstone:
You get them from the printing service. The chart on the left-hand side of the preceding diagram shows you a range of colors. The bars on the right-hand side are 3D-printed samples printed with the same colors. Look at the printed samples to choose the printed color you want. Read the index number off of the samples. Then, use a program such as Gimp or Photoshop to get the exact RGB values of the indexed color which you can use to specify the exact color in Blender.
This is a useful tool because the colors printed are not always exactly as you specify them. You can see this if you look at one color in the previous chart and samples. And indeed, the printing service specifies that no two samples may be exactly the same. So it's a rough guide, not an exact one. A copy of the chart on the left-hand side is in your download kit as 4597OS_02_01.png
.
UV mapping is a way of assigning a section of a graphic image to the face of a polygon. This is done by a process called unwrapping the UV mapping. The letters U and V describe the horizontal and vertical axes of a bitmap image. The letters U and V are used to avoid confusion with the X, Y, and Z geometry coordinates.
Creating UV maps may seem intimidating, but it's not that difficult. To unwrap the UV mapping, you select a polygon and press the UV Unwrap button. Then, Blender assigns a pair of UV coordinates to each vertex of the polygon and gives them an initial value. Next, in the UV/Image editor window, an image is displayed with an overlay that shows where the UV coordinates for the polygon are with respect to the image. You then move these coordinates around until they are over the section of the image that you want to be displayed on the face of that polygon.
Next, you will do some texture mapping onto a model of a dragon that we will be working on for most of the rest of the book. We will decorate its wings, its chest, and its head.
We will start by applying UV maps to the wings. This will give us good practice in moving the UV coordinates as groups:
4597OS_02_Dragon_Untextured.blend
from the code bundle.Texture - Outer Wing
. Assign the faces to it. This assigns all the faces that are currently selected in the 3D View to the vertex group.Using Vertex Groups to organize your sections of texture is very important. It means you will never have to go through selecting the faces again. This gives you a lot of flexibility if you make a mistake and greater control when working with the UV maps.
The first thing that you notice when you look at the UV/Image Editor is that the mapping of the UV coordinates does not resemble the shape of the wing. You want to reorganize the UV coordinates so that they do:
Good. Since the UV coordinates are now laid over the image in a shape like the faces of the wing, when you paint the wing, you will know which part of your image is mapped to which part of the wing. Now, to help us remember which section of the image has already been used, let's outline it:
5
.Congratulations, you have texture mapped the outer side of the wing. Now it's time to do the inner side:
Texture - Inner Wing
.Texture - Inner Wing
group. Now, UV unwrap the inner side of the wing membranes just as you did for the outer side. Use the UV Unwrap
command, display your Untitled image, and move the UV coordinates. Be sure to start building your mapping from the upper-right corner of the image at about the same size as the outer wing was mapped. Do each section as before.Texture - Inner Wing
group. Then, in the 3D View, press A to deselect all faces and then select a face from the membrane whose UV coordinates you want to move. They will appear in the UV/Image Editor and you can note where they are. Then, go to the Vertex Groups subpanel and click on Select to have all the faces of the inner wing appear.Now we map the dragon's belly. This will give us practice in modifying individual UV coordinates.
Now, it's time to texture the dragon's belly:
Texture - Belly
and assign the vertices to it.Mapping the edges of the wings is very similar to mapping the belly and the wings. First you work with groups of UV coordinates, then you work with individual UV coordinates:
Texture - Edge Wing
vertex group. Assign the faces to it.Note the solitary orange dot near the lower-left corner of the following screenshot. This is a quirk of Blender. You selected only the faces of the edge of the membranes. But, since the faces on the end of the fingers shared vertices with the edges of the membranes, Blender also picked them up. Since you did not choose them, it did not assign them any area on the UV map. It just lumped them all together in one spot. This will work; just make sure that they are all mapped to an area with the background green. Use the C or B command to select them if you want to move them.
With the UV coordinates of the head, we will learn to adjust the UV coordinates to emphasize certain details, giving us more of the texture map to use on these details and allowing us more creative control:
Texture - Head
, and assign the vertices to it. UV unwrap it and display the green texture map image.You may have noticed that we have not texture mapped the entire dragon. In the following chapters, we will modifying some of the geometry to put a pen cup into his back. This will destroy the UV mapping of any faces that are involved. Only the faces on the center of the dragon's back are affected, not the wings. But Blender does provide a default UV mapping in this case. It takes the four corner pixels of the texture map and uses the average of these four pixels as the color for all unmapped polygons. So, make sure that none of your UV coordinate faces cover the four corner pixels of the image.
It's time to paint your texture. You have a choice of methods. You can continue to use the Paint tool in the UV/Image Editor, or you can export your UV maps as a .png
file for use in another program such as Gimp, Photoshop, or whatever you prefer.
Exporting the UV Layout lets you have the power of the best graphics programs for making a texture map. When you export the UV Layout, it is in the form of a .png
file that you can read into another graphics program. One layer will be an image of all of the UV coordinate locations. Make an image on other layers, using the coordinate layer to guide you. Turn the coordinate's layer off when you are done and save a bitmap copy of the finished graphic. Then, bring it back into Blender as a texture map for the object.
It's easy to export your UV map. Display all of the UV coordinates that you want to show up on the map and use the Export UV Layout function:
.png
file with a layer that you can use as a guide to creating a texture map for your dragon.You can also create a texture map using Blender's paint tools. This may be more convenient, even though you don't have quite as much control as you get in a dedicated graphics program such as Gimp or Photoshop.
Now you can paint the image in the UV/Image editor. You'll then save your file and create a material that employs the UV mapping work that you've done and mates it up to the texture map that you make:
.png
file you just saved.You can also modify the UV coordinates to use more of the texture map for more important details and use less of the texture map on less important details. Here, you add more detail to the horn on his head by adjusting the UV coordinates and painting on the texture map:
Now, as a final touch, we will explore how to add better detail to the texture map by bringing in an outside graphic and duplicating the patterns from it.
25
and the strength to 1.0
.4597OS_02_02.png
in the Images
directory. Press Home.4597OS_02_02.png
. The image of the scales will appear at the bottom of the UV/Image Editor window.Now, something may look odd. The dragon's body is a different shade of green than its head is as seen in the following screenshot. Remember about the pixels in the corner that I mentioned in the last information box? You probably painted over two of the corner pixels when you used the Clone brush. But that is easy to fix:
2
and the strength to 1.0
.3.141.3.175