From BlenderWiki

Jump to: navigation, search

A UV Texture is a picture (image, sequence or movie) that is used to color the surface of a mesh. The UV Texture is mapped to the mesh through one or more UV maps. There are three ways to establish the image used by the UV Texture.

  • Paint a flat image in the UV/Image Editor onto the currently select UV Texture, using its UV map to transfer the colors to the faces of the mesh
  • Paint the mesh in the 3D View, and let Blender use the currently selected UV map to update the UV Texture ("Projection Painting")
  • Use any image-editing (paint) program to create an image. In the UV/Image Editor, select the UV Texture and load the image. Blender will then use that texture's UV map to to transfer the colors to the faces of the mesh

Blender features a built-in paint mode, called Texture Paint, designed specifically to help you edit your UV Textures and Images quickly and easily in either the UV/Image Editor window or the 3D View window. Since a UV Texture is just a special-purpose image, you can also use any outside paint program. For example, Gimp is a full-featured image manipulation program that is also open-source.

Since a mesh can have layers of UV Textures, there may be many images that color the mesh. However, each UV Texture only has one image.

Using Blender's Texture Paint

The "Paint" tool in action.
Texture Paint works in both a 3D window and the UV/Image Editor window. In the 3D window in Texture Paint mode, you paint directly on the mesh. In the UV/Image Editor window, you paint on a flat canvas that is wrapped around the mesh using UV coordinates. Any changes made in the UV/Image Editor window show up immediately in the 3D window, and vice-versa.

A full complement of brushes and colors can be selected from a floating Image Paint panel in the UV/Image Editor, or a Paint panel in the Buttons window, Editing (F9) context. Brush changes made in either panel are immediately reflected in the other panel.

When satisfied or at intermittent intervals, please save your image using the UV/Image Editor window. How to use Texture paint is explained in this section.

Square Power of 2
Texture paint is very fast and responsive when working in the 3D window and when your image is sized as a square, power of two; 256x256, 512x512, 1024x1024, etc.


Getting Started

Manual-UV-TexPaint-select.png
Once you have un-wrapped your model to a UV Texture (as explained in previous pages), you have to:
  • Load an image into the UV/Image Editor (Image->Open->select file) , or
  • Create a new image (Image->New->specify size) and saved it to a file (Image->Save->specify file).

You cannot paint on a mesh in Texture Paint mode without first unwrapping your mesh, and doing one of the above steps. After you have done these two things, you can modify the image using the Texture Paint mode. Once you do:

  • In the 3D View window, select Texture Paint mode from the mode selector in the window header, and you can paint directly onto the mesh.
  • In the UV/Image Editor window, enable Texture Painting in the Image menu (shown to the right).
  • In the UV/Image Editor header, click the magic pencil (highlighted to the right).

At this time, you may choose to show the alpha (transparency) channel by clicking the button to the right of the magic pencil. The dot icon to the right of that button allows you to paint the alpha channel by itself.

Once you enable Texture Painting, your mouse becomes a brush. To work with the UV layout (for example, to move coordinates) you must disable Texture Painting. To work with the mesh in the 3D View (for example, to move it in 3D space), or select other objects, you must leave Texture Paint mode.

When you enable Texture Painting, use the View->Paint Tool option in the UV/Image Editor window or the Paint panel in the Buttons window to modify paint settings.

All painting you perform in either window will be instantly reflected in the other window (if the 3D View is in textured viewport mode). However, the modified texture will not be saved until you explicitly do so by Image->Save in the UV/Image Editor window.

See Outline: If you want to paint directly on the mesh in the 3D View window, change to UV/Face Select Mode first to show the edge outline of the mesh, then switch to Texture paint mode, which visually overlays the previous mode, but keeps the outline.

As soon as you enable Texture Painting or switch to Texture Paint mode, a Paint Panel becomes available in the Editing (F9) buttons. This panel has all the same controls as those available in the Paint Tool discussed below. Use this panel if you are only working in 3D view in order to change brushes (colors, patterns, function).

Instant Feedback

Manual-UV-TexPaint-preview.png
If your texture is already used to color, bump map, displace, alpha-transparent, etc. a surface of a model in your scene (in other techie words, is mapped to some aspect of a texture via texture channel using UV as a map input), you can see the effects of your painting in the context of your scene as you paint.

To do this, set up side-by-side windows, one window in 3D View set to Textured display mode, and the second UV/Image Editor window loaded with your image. Position the 3D View to show the object that is UV mapped to the loaded image. Open a Preview window (see 3D View Options for more info) and position it over the object. In the image to the right, the texture being painted is mapped to "Nor" or Normal, and is called "bump mapping", where the gray scale makes the flat surface appear bumpy. See Texture Mapping Output for more information on bump mapping.

Brushes

To paint on the mesh, you just click and drag the left mouse button across the mesh in the 3D View window, or across the image in the UV/Image Editor window. What that mouse action does to the color of the mesh depends on the Brush you are using. Some brushes add color, some take it away, and some even make your mesh transparent!

Mode: UV/Image Editor

Hotkey: C for Color

Menu: View -> Paint Tool...

Manual-UV-TexturePaint-panel.png
Press C in the UV/Image Editor to pop up the Image Paint panel. With this panel, you can create many brushes, each with unique settings (such as color and width). Use the Brush selector to switch between brushes, or create a new brush. When you add a brush, the new brush is a clone of the current one. You would then change the setting for the new brush. Texture paint has an unlimited number of brushes, and unique user-defined controls for those brushes, set in the Paint Tool panel. You can paint in either window; you can paint right on your mesh in the 3D window, much like vertex painting, or flat on the UV Image in the UV/Image Editor window.

To use a brush, click on its name from the BR: selector up/down arrow. Name your brush by clicking on the name field and entering any name you wish, such as "Red Air" for a red airbrush. To toss out a brush, click the brush delete X button next to its name. If you want to keep this brush around for the next time you run Blender, click the Fake user button next to the brush delete X button.

If you have a tablet pen with pressure sensitivity, toggle the small "P" button next to the opacity, size, falloff and spacing buttons to control these parameters using the pressure of the pen. Using your pen's eraser end will toggle on the Erase Alpha mode.

Brush Mode Options

Planet texture example using various brush modes

Across the top and down the side are several controls that determine what the brush does when it draws:

  • Draw: The normal brush; paints a swath of color
  • Soften: blends edges between two colors
  • Smear: when you click, takes the colors under the cursor, and blends them in the direction you move the mouse. Similar to the "smudge" tool of Gimp.
  • Clone: copies the colors from the image specified (Tex.Dirt in the example), to the active image. The background image is shown when this brush is selected; use the Blend slider to control how prominent the background image is.
  • Wrap: wraps your paint to the other side of the image as your brush moves off the OTHER side of the canvas (any side, top/bottom, left/right). Very handy for making seamless textures.


Mix Mode Options

Mix Mode determines what the brush action does to the image:

  • Mix: the brush color is mixed in with existing colors
  • Add: the brush color is added to the existing color; green added to red gives yellow.
  • Subtract: brush color is subtracted; painting blue on purple gives red
  • Multiply: the RGB value of the base is multiplied by the brush color
  • Lighten: the RGB value base value color is increased by the brush color
  • Darken: tones down the colors
  • Erase Alpha: makes the image transparent where painted, allowing background colors and lower-level textures to show through. As you 'paint', the false checkerboard background will be revealed.
  • Add Alpha: makes the image more opaque where painted
UV/Image Editor Alpha

In order to see the effects of the Erase and Add Alpha mix modes in the UV/Image Editor, you must enable alpha channel display by clicking the Display Alpha or the Alpha-Only button. Transparent (no alpha) areas will show an checker background; the clarity of the checker background depends on the opacity of the image.

Brush Control

The controls for each brush allow you to choose:

  • Color: The current brush color shown in the color swatch. Click the swatch to choose a color for the current brush; then pick a new color from the popup color picker applet. You can pick any hue and then a saturation/value, pre-defined colors, or even use the eyedropper to take a sample from anywhere within the Blender window.
  • Opacity: how thickly you apply the paint when you click down, like how hard you press down on a spray can button, or how much paint you put on your brush.
  • Size: How big your brush or spray area is, in pixels.
  • Falloff: How spread-out the spray is. Decrease for a softer brush; increase for a harder one.
  • Spacing: The distance between paint spurts when dragging the mouse, relative to the size of the brush.
  • Airbrush: When enabled, the brush paints continually while the LMB Template-LMB.png is held down, rather than only when the mouse is moving.
  • Rate: How fast the paint is applied by the Airbrush

RMB Template-RMB.png click on any part of the image to sample that color and set it as the brush color.

Brush Pattern/Texture

Manual-UV-TexBrush.png
Use the texture selector at the bottom of the paint panel to select a pre-loaded image or procedural texture to use as your brush pattern. Note that in order to use it, you must have a placeholder material defined, and that particular texture defined using the Material and Texture buttons. It is not necessary to have that material or texture applied to any mesh anywhere; it must only be defined. The example to the right shows the effects of painting with a flat (banded) wood texture. Switching the texture to Rings makes a target/flower type of brush painting pattern.

Note: In Clone paint mode, this field changes to indicate the picture image or texture that you are cloning from.

Saving

If the header menu item Image has an asterisk next to it, it means that the image has been changed, but not saved. Use the Image->Save Image option in the to save your work with a different name or overwrite the original image.

UV images
Since images used as UV Textures are functionally different from other images, you should keep them in a directory separate from other images.

The image format for saving is independent of the format for rendering. The format for saving a UV image is selected in the header of the Save Image window, and defaults to Targa (.TGA).

If Packing is enabled in the window header, or if you manually Image->Pack Image, saving your images to a separate file is not necessary.

Options

The Paint controls are also shown on a Paint panel in the buttons window, Editing set.

Mode: Texture Paint

Hotkey: F for Face-select submode

Face Painting: By default, you will be painting the whole mesh and it will look solid. RMB Template-RMB.png clicking will pick up the color from the mesh at that point. To only paint part of the mesh, press F in 3D View to highlight the UV/Face edges. The faces of the mesh will be outlined for you using the red-green edges in the 3D View, and if you have Shadow Mesh enabled in the UV/Image Editor, the UV Layout will also be shown as a gray outline in the UV/Image Editor window. Now, RMB Template-RMB.png will select a face, and ⇧ ShiftRMB Template-RMB.png will select multiple faces. To only paint part of the mesh, press H to Hide the selected Faces when in Texture Paint mode. Just like when editing a mesh, doing a Border select with the LMB Template-LMB.png button selects only certain faces. Doing a Border select with the RMB Template-RMB.png button excludes those faces from the selected set of faces.

Selecting some faces and pressing H Hides them from view and thus painting. It also continues to hide them during textured viewport shading in Object view. During your painting session with F active, or in UV Face Select Mode, AltH un-hides them. Unfortunately, H and AltH don't do anything when you are not in this face-select sub-mode (because there aren't faces 'selected').

Using an External Image Editor

If you use an external program to edit your UV Texture, you must:

  1. run that paint program (Gimp, Photoshop, etc.)
  2. load the image or create a new one
  3. change the image, and
  4. re-save it within that program.
  5. Back in Blender, you reload the image in the UV/Image Editor window.

You want to use an external program if you have teams of people using different programs that are developing the UV textures, or if you want to apply any special effects that Texture Paint does not feature, or if you are much more familiar with your favorite paint program.