Разворачивание меш объекта
Материал из Blender3D.
Оригинал - http://wiki.blender.org/index.php/Manual/Unwrapping_a_Mesh
Содержание |
Процесс развертывания - unwrap - анврап. Его можно начинать тогда, когда сетка имеет необходимое количество полигонов, когда процесс моделирования закончен. Если вы добавите или разделите полигоны на развернутом меше, Blender добавит их в готовую развертку автоматически. При этом вы можете использовать существующую текстуру для дополнительной детализации объекта.
UV инструменты значительно изменились в версии Blender 2.46.
Начинаем
UV развертывание осуществляется в режиме Edit Mode. При этом создаётся одна или несколько частей (острова, лоскуты) разверток, которые отображаются в окне UV/Image Editor.Разделите окно 3d вида пополам и назначьте правую часть как УВ-редактор. Создайте объект (напр. сферу), войдите в режим редактирования. Обратите внимание на панель F9, UV calculator. Тут находятся параметры развертывания. Подробнее о панели вы можете найти на странице http://wiki.blender.org/index.php/Reference/Panels/Editing/UV_Calc
Процесс
Само развертывание — простое дело, но имеется много опций, которые очень сильно влияют на итоговый результат. Постарайтесь понять значение каждой из них, и вы сможете разворачивать более эффективно.
- Настройте панель UV Calculation для общих параметров процесса (см. ниже).
- Выделите объект.
- Выберите текстурный режим отображения в заголовке окна или нажмите Alt+Z.
- Перейдите в Edit mode, Tab.
- Выделите те полигоны, которые необходимо «развернуть». Для удобства можете включить режим выбора фейсов (треугольная иконка в заголовке). Выделение рамкой B, окружностью B B и т.д.
- В панели Mesh нажмите кнопку UV Texture New чтобы назначить новую текстуру.
- Если вы создали новую ув-текстуру, то выбранные полигоны автоматически разворачиваются в простом режиме Reset (описание ниже). Розовым закрашиваются выделенные полигоны, белым - не выделенные.
- Нажмите U или из меню в заголовке Mesh > UV Unwrap. Появится меню (см. рисунок). Оно позволяет выбрать алгоритм и метод для развертки.
- Выберите необходимый метод.
- Пересчитается позиция свободных ув-вершин которые соответствуют выбранным полигонам.
Каждая пурпурная точка на UV карте соответствует вершине меша. Линии, соединяющие УВ вершины, соответствуют ребрам на меше. Полигоны развертки соответствуют полигонам меша.
Каждый полигон может иметь несколько ув-текстур. На каждую UV текстуру можно применить индивидуальный рисунок. Когда вы разворачиваете полигоны в ув-редакторе, каждому полигону автоматически назначается две дополнительные характеристики:
- Четыре UV координаты Они определяют, как будет отображаться рисунок на полигоне. Это двумерные координаты UV, не путайте с XYZ. Они используются для рендера и отображения в окне 3d вида (OpenGL).
- Ссылка на рисунок Разные полигоны в Blender могут ссылаться на разные изображения. UV координаты определяют как каждая картинка проецируется на полигон. Окно 3D вида должно быть в режиме выделения полигонов, чтобы назначать изображения, или изменять ув-координаты меш объекта.
Это позволяет одному полигону иметь несколько натянутых на него ув-текстур.
АКТИВНЫЙ ПОЛИГОН Последний полигон, на котором щелкнули мышкой является «активным» (выделенный ПКМ или снятый с выделения shift+ПКМ). Если вы выделите несколько поликов, затем снимете выделение с нескольких из них, то последний снятый полигон будет активным. Если полигон активен, но не выделен, вы не увидите его на ув-текстуре. Все выделенные полигоны отображаются на развертке.
UV Ориентация
Когда вы развернете поверхность на UV, вы не будете знаеть ориентацию. Плоские квадратные полигоны на модели могут стать трапецеидальными на разветрке. Для сравнения ориентации ув-текстуры и полигонов в 3d виде применяется тест-рисунок. Перейдите в окно ув-редактора:
- Синхронизируйте UV и Меш выделение, нажав на иконку с квадратиком. Появятся все UV полигоны, а не только выделенные в 3D виде. Это поможет лучше понять, как они расположены и распределены по текстуре.
- Проверьте View > View Properties > Draw Type > Faces. Выделенные полики будут окрашены в розовый цвет, их проще будет увидеть.
- Выделите всё, нажмите A
- Сделайте тестовую сетку. Меню Image > New, включите UV Test Grid, OK.
UV тестовая сетка (Test grid) похожа на шахматную доску с диагонально расположенными плюсами в центрах. По вертикали цвета меняются: малиновый, розовый, синий, голубой, два зеленых, желтый, красный. Эта последовательность смещается на один цвет, поэтому видны диагональные ряды. Очень легко увидеть ориентацию UV полигонов относительно 3D полигонов.
Нажимая ПКМ на полигонах в одном окне видно ориентацию в другом окне, полигоны подсвечиваются. Кликайте на полигоны на объекте. Если полигон белый в 3D, и в UV пропало изображение, остался только фон, значит на полигон не натянуто изображение. Чтобы применить рисунок к выделенным поликам, просто выберете в заголовке из списка необходимое изображение или создайте новое.
UV Поворот
Если расположение UV грани оказалось неудачным (например картинка не попала на её середину или перевернута), воспользуйтесь кнопкой R в окне редактора развертки, чтобы повернуть эту грань. Точно также как и при повороте 3D объекта, в заголовке окна редактора развертки будет отображаться угол поворота, а если при этом удерживать клавишу CTRL, то угол поворота будет каждый раз изменяться строго на 5 градусов.
UV Location
Changing the shape of a UV face (by moving the corner UVs) will also change the orientation of the mapping, since the vertex has not moved, but the mapping of image pixels to the face has (because you moved the UV location). Press G to grab the UV's and move them; LMB Шаблон:Switch: L to drop, RMB Шаблон:Switch: R to abort, just like vertices.
You can also snap UV's just like vertices by activating the magnet icon on the UV/Image Editor header. If you do, the Snap Target Mode selector will appear: hold control to snap UVs to the closest, center, or median of another UV island.
Mapping an Image to Your UVs
When you entered UV Face Select mode, Blender created a mapping in the UV/Image editor window. If you examine your Editing (F9) buttons, the Mesh panel, you will see a new UV Texture entry, called "UVTex" by default. This panel section has a button to the left of the name, used to select the UV Texture map if there are many listed. The name can be changed by clicking into the field and typing. This texture map can be deleted by clicking the X. You can add arbitrary UV Textures by clicking New, but you will rarely have to, since Blender creates them automatically each time you unwrap.We just very briefly talked about assigning an internally generated image to this UV Layout, the Test Grid. We call that image a "UV Texture" once it is mapped to the mesh using the UV layout and applied as a texture to the material for the mesh. Let's go over that process in more detail.
First, we created the image in memory. With the faces selected in the 3D window, move on over to the UV/Image Editor window. From the header menu, select Image->New. Here you select the size of the image to be used, and/or a test grid. Use the Test Grid to orient yourself to the direction of the UV mapping. If you select Test Grid and click OK, that image of the test grid is mapped to the faces. It cannot be rendered yet, because we have not told Blender how to reflect the light off the object when rendering. We do that by creating a Material Texture.A quick render will show that you have automatically mapped the color of the faces of the mesh to an image used as a UV texture. Congratulations!
These three links are crucial to understanding:
- A UV Layout, shown in the UV/Image Editor, that maps mesh faces to all or part of the image workspace,
- A Material assigned to those faces which maps a texture to the colors, and
- An image texture which loads an image.
Now here comes the confusing part: a mesh object can have many UV Layouts (listed in the Editing buttons panel, UV Texture list). A mesh object can have multiple materials, with a single material mapped to one or more faces of the object. A material can have many (up to 10) textures, each assigned to a texture channel. Each of those textures can be an image mapped to a UV Texture. So, Blender provides ultimate flexibility in mapping and layering images to faces of a mesh object.
Once a face has been mapped, RMB Шаблон:Switch: R clicking on that face in the 3D View will cause the UV/Image Editor window to automatically show the image and UV coordinates for the selected face. The UV map for that face will be selected in the Mesh panel.
Images versus Maps
You may have heard the terms "Bump Map" or "Spec Map". These are simply terms to denote how a UV Texture is mapped to the material, and what purpose it serves. A Color image affects the color that you see. For skin, there are four common color maps, or images, that are applied to the mesh through the UV coordinates: Tone, Spec, Blemish, and Makeup. The Tone is the basic skin color, Spec is the color you see when the light shines directly on the skin, Blemish is the wonderful imperfections: varicose veins, pimples, scars, scrapes, and makeup is coloring of the lips, eyes, cheeks. These images are Map To Col or color.
All the other images are black and white images, where black is no effect, and white is 1.0 or full effect. These images map the texture channel indicated and then on to the mesh through the UV Texture. For skin, there are commonly five: Bump (Map to Nor), Diffuse (map to Ref), Specular (map to Spec), Ambient (map to Amb), and Hardness (map to Hard). The Bump map wrinkles and gives the skin pock marks and that cellular un-eveness. The Diffuse map makes the color weaker in some areas. The Specular color indicates the skin's thickness, as thinner skin looks redder because of the blood underneath when exposed directly to light. Ambient reflects how flushed the skin is, and Hardness highlights where the skin is oily.
For example, the skin is oily around the crease of the nose. For the Hardness map then, the image would be black except where the texture maps to the area around the outiline of the nose, and there it would be white. In the Material settings, the maximum hardness might be 50. Instead of being universally hardness of 50 all over, by using the Hardness map, we can control where it is between 0 and 50.
Using UV Textures, mapped to some aspect of the texture, enables us to achieve photo realism of any surface through CG. You are not limited to these. I saw a very good zombie skin texture that used an Alpha Map to place holes in the flesh where the bone could show through (ugh).
Panel Interaction
Please excuse me for belaboring the point, but it can be very confusing. There are three different button panel sets going on here that all link to one another, as shown below.All of these names and such have to match up. I hope you can see how you can use a static image for simplicity, or use an animation to show someone blushing, or beginning to sweat, by using a movie or sequence to affect the different texture channels. I'm sure you've seen the different X-Men effects, so now you know how it was done, and how photo-realism can be achieved.
Unwrapping Using Seams
For most cases, using the Unwrap calculations of Cube, Cylinder, Sphere, or best fit will produce a good UV layout. However, for more complex meshes, especially those with lots of indentations, you may want to define a seam to limit and guide any of the unwrapping processes discussed above. Just like in sewing, a seam is where the ends of the image/cloth are sewn together. In unwrapping, the mesh is unwrapped at the seams.To add an edge to a seam, simply select the edge and Ctrl E Mark Seam. To take an edge out of a seam, select it, Ctrl E and Clear Seam.
You do not have to select continuous seams. If you select one edge, and follow that line and select another edge further down the line using Shift + Alt + RMB Шаблон:SAMB on the edges in UV face select mode, Blender will connect the line and select all edges in between. Шаблон:Clr
When unwrapping anything that is bilateral, like a head or a body, seam it along the mirror axis. For example, cleave a head or a whole body right down the middle in front view. When you unwrap, you will be able to overlay both halves onto the same texture space, so that the image pixels for the right hand will be shared with the left; the right side of the face will match the left, etc. Шаблон:Clr
Unwrapping Multiple Faces
- In Edit Mode (tab), enter Face Select mode and select the faces you want.
- In UV Face Select mode using the 3D window, right-click or border select the faces you want.
The example to the right shows that we have hidden many faces from view; the ears and the back of the head. We did so by creating and using the Vertex Groups, selecting the "BackSkull" group and Hiding them from view. We did this because we do not want to unwrap those areas, and we don't want them to get in the way during any further face selection that we may do. Шаблон:Clr
If you did not select all desired faces prior to entering UV Face Select mode, you can select multiple additional faces in any of the following ways:
- Press A and all faces of the Mesh will be selected and highlighted by dotted lines.
- Select Linked faces from the 3D View menu; this will select additional faces up to a seam
- You can select many faces by Шаблон:SMB clicking on each one you want. You may spin the object or your view of the object and resume selecting by Шаблон:SMB.
- BorderSelect in the 3D window.
- Enter EditMode and select the vertices or edges that define the face you want. After leaving EditMode and back in UV FAce Select mode, the faces defined by the selected vertices/edges will also be selected.
In UV Face Select mode, just like in Edit mode, you can also hide faces from view so they don't get in the way as you are trying to select faces:
- H to hide selected faces
- Shift H to hide the faces which are not selected, sort of the reverse of H by itself.
- Alt H to reveal the hidden faces. Note that if you leave and then re-enter UV Face Select mode, they will be unhidden.
Only one face is considered active; the last one selected. Since the UV/Image Editor can only show one image at a time, it will show the image for the active face. IF you change the active face mapping (if you move the its UV coordinates), you may be overlapping or affect all other face mappings that are part of tha UV map (even if you cannot see them). So, before adjusting a face's UV coordinates, it is best to select adjoining faces to you see the whole map. Шаблон:Clr
Face Unwrap using UV Calculation
- Automatically using the 3D View window command Face->Unwrap UVs U
- Automatically using the UV/Image Editor window command UVs->Unwrap command E
- Creating seams and then unwrapping. A seam is marked in Edit mode by selecting edges that make the seam and then issuing the command to Mark Seam.
Above, when you selected a single face and went into Face Select Mode, Blender automatically mapped the selected face to the entire image for you, based on the face's UV orientation (the red and green borders). You can unwrap a face manually through the Face->Unwrap menu. How the selected faces map over to the image depends on the UV Calculation method that you choose.
This point is crucial to understanding mapping later on: a face's UV image texture only has to use part of the image, not the whole image. Also, portions of the same image can be shared by multiple faces. A face can be mapped to less and less of the total image.
Based on the fundamental geometry of the object, and how it is viewed, the Face->Unwrap->Cube, Cylinder, and Sphere UV Calculations attempt to unfold the faces for you as an initial best fit. Here, the view from the 3D window is especially important. Also, the settings for cube size or cyclinder radius (Editing buttons, UV Calculation panel) must be set (in blender units) to encompass the object.
Normally, to unwrap a cylinder (tube) as if you slit it lengthwise and folded it flat, Blender wants the view to be vertical, with the tube standing 'up'. Different views will project the tube onto the UV map differently, skewing the image used. Also note the Polar coordinate axis selection buttons in the UV Calculation panel located in the Editing buttons window; they tell Blender which way is up.In the 3D window, Face->Unwrap UVs->Project from View option maps the face as seen through the view of the 3D window it was selected from. It is almost like you had x-ray vision or squashed the mesh flat as a pancake onto the UV map. Use this option if you are using a picture of a real object as a UV Texture for an object that you have modeled. You will get some stretching in areas where the model receeds away from you.
In the 3D window, Face->Unwrap->Reset maps each selected face to the same area of the image, as previously discussed. To map all the faces of an object (a cube for example) to the same image, select all the faces of the cube, and unwrap them using the Reset menu option.
Note: The next four options create a UV map that stretches to maximum, and does not respect the image size. After using these options, you may have to zoom waaaaay out in the UV/Image Editor, select all UV coordinates, and scale them waaaaay down to fit inside the image area.
The Face->Unwrap->Click project from face is a three-step process that lets you orient the projection map according to a selected face's orientation. When selected, the upper User Information bar changes to display the step you are on, temporarily replacing the Blender version and statistics. The first click selects a bottom-left corner of that typical face. The second defines 'up' based on the face orientation, so click on the corner of that face that corresponds to the up direction from the first corner. The third click defines the V coordinate, namely which way is right on the map.
The Face->Unwrap->Follow Active (quads) takes the selected faces and lays them out perfectly square, even if the mesh face is irregularly shaped. Note that it does not respect the image size, so you may have to scale them all down a bit to fit the image area.
Use Face->Unwrap->UVs from unselected adjacent to expand your UV map by selecting un-mapped (new) faces and then this option. Blender will attempt to match up the coordinates of the new face with existing faces previously mapped. This option is helpful if you have added new faces and want to unwrap them.
Finally, the Face->Unwrap->Unwrap (smart projections), (which used to be called the Archimapper) gives you fine control over how automatic seams should be created, based on angular changes in your mesh. This option is especially well suited to unwrapping multiple mechanical objects all at once. The Archimapper is discussed a little later on.
Face Unwrap using the UV/Image Editor Menu
In the UV/Image Editor window menu, the menu item UVs also has a simple Unwrap option. There is no choice of different calculations to use; it is the same as selecting Face->Unwrap UVs->Unwrap in the 3D View. Use this option to unwrap additional faces with an existing set of unwrapped faces. The UV Coordinates for the addtional face will be added to the existing set in a non-overlapping manner. Warning: the UV coordinates for all of the faces will be recalculated.
Texture Face
Unwrap (smart projections)
In the example to the right, the Archimapper mapped all of the faces of a cube to a neat arrangement of 3 sides on top, 3 sides on the bottom, for all six sides of the cube to fit squarely, just like the faces of the cube.
For more complex mechanical objects, this script can very quickly and easily create a very logical and straightforward UV layout for you.
Archimap allows you to unwrap multiple meshes in a single step (select multiple meshes in object mode). If you only have one mesh selected and are in Face Select mode, you can unwrap only selected faces, or if you select all the faces of the mesh, the whole object.
The popup panel allows the fine control over how the mesh is unwrapped. The angle limit controls how faces are grouped: a higher limit will lead to many small groups but less distortion, while a lower limit will create less groups at the expense of more distortion.
Archimap prefers you to have an image loaded if you want to Stretch to Bounds. When you use an image for a UV Texture, sometimes the edges of the image won't align perfectly or there will may be a border around the outside of the image. The Bleed Margin will shrink the overall UV coordinate map so that this margin is not mapped or used as UV Texture. For complex meshes, Archimap may create (by default) a map that has holes in it, resulting in wasted space in the image. Selecting Fill Holes will cause Archimap to do a little more work at ensuring each face is mapped as large as possible and that there are fewest holes (wasted image texture pixels) possible. Шаблон:Clr

