Difference between revisions of "User:Tottori/Blender Tutorial"
Line 225: | Line 225: | ||
04:55 - drawing in guide arrows. Red arrows will point to the top of the head. Green arrows will point to the front of the head. Blue arrows will go from the left side to the right side if you are facing that side. | 04:55 - drawing in guide arrows. Red arrows will point to the top of the head. Green arrows will point to the front of the head. Blue arrows will go from the left side to the right side if you are facing that side. | ||
06:35 - since this is not a very complex shape, a minimum of points are necessary to create a cube. After thinking about it a bit, I decide to use these 10 triangles for the main part of the boxes. | [[File:Boxtut1.png|right]]06:35 - since this is not a very complex shape, a minimum of points are necessary to create a cube. After thinking about it a bit, I decide to use these 10 triangles for the main part of the boxes and drag them outward on the Y-axis to isolate them for working. | ||
07:08 - selecting the pair of triangles for the front side of the box and scaling them up. | |||
07:48 - Using scale on the Y-axis (S then Y) to scale it down to 0 and flatten the front side. | |||
08:05 - using the grid in the background, we just drag the corners around on the X and Z axises to make a square. | |||
09:22 - arranging the points for the top of the box. Since it's connected to the front, two of them are already done. |
Revision as of 23:55, 17 May 2014
Overview
Useful stuff
- Jenkey's PES File Explorer
This will allow you to unpack stuff from the game files and has a file decompressor. Keep it handy.
- Facehair tool
This is necessary for the whole thing to work. It is a Windows-only tool however, so even though you can run blender on your mac you can't actually do any 4CC stuff with it. Also tucked into the .rar is a big list of real player ID numbers, which is helpful for targeting real players to use for base models.
Install
Download
- Facehair tool v1.7a: http://www.mediafire.com/download/rvgxhfz773uy6hq/pes_face_mod_tool.rar
- http://www.blender.org/download/
Setup Face/Hair Mod Tool
- Install Blender (I used the 64bit version)
- Unrar pes_face_mod_tool.rar
- Put the pes_temp in the blender installation folder (usually C:\Program Files\Blender Foundation\Blender)
- Put the files from config_blend into your blender's roaming folder (...\AppData\Roaming\Blender Foundation\Blender\2.69\config)
- Open up blender
- Press ctrl+alt+U to bring up preferences
- In the Addons tab, on the bottom, click on "Install from file"
- Locate pes_face_modifier.py and install it.
- Go back to the addons tab
- Scroll near the bottom, and tick the box next to "system: Pes face/hair Modifier tool"
- On the right side, click on the icon with the cylinder and the box
- Near the bottom there should be Face Model input boxes, use these to open up face_high.win32.model (face) files and edit them.
Troubleshooting
- Note that to edit points, it has to be in Edit Mode (bottom left) and to export, it has to be in Object Mode (bottom left)
- If the mod tool is giving permission denied errors inside Blender, you may need to right-click blender.exe to open the properties and set it to run as administrator.
- The mod tool will also not work if the blender exec file is not named blender.exe.
Exporting assets
You are only allowed to edit existing assets in PES if you want them to reimport correctly. It therefore is helpful to have as much existing stuff on hand as you can, so you can start as close to your end goal as possible.
PES File Explorer is kind of shit, however, so you will probably find it easiest to just wait for it to load the entire cpk, dump it all once, and pull out the files from it you need, delete the rest, and never have to go through that part ever again.
The real player face/hair data is in dt32.cpk at pes14_win_dat/common/character0/model/character/face/real
The edit player hair data is in dt33.cpk at pes14_win_dat/common/character1/model/character/face/edithair
Export these and stick them somewhere fairly close to 4cc/GDB (I drop them into KONAMI in a folder called model dump)
These exports, however, are still zlibbed. If you want to open the textures in Photoshop to edit them, you will need to unzlib them (PES File Explorer can do this under Tools). You don't have to unzlib them to get the facehair tool to work as it has its own internal zlib capability. Likewise you don't have to recompress them to get fileloader to work (it will take either zlibbed or unzlibbed files and work with them).
Models
The files
.model
These are the actual 3d data files with the vertex points, meshes, UV mappings, texture references, etc.
- face_high_win32.model - This is the face file that PES will load when a player's hairstyle is set to 'Default'.
- face_edithair_high_win32.model - This is the face file that PES will load when a player has an in-game hairstyle applied from the editor.
- hair_high_win32.model - This is the hair file that PES will load for high-detail situations (i.e. closeups).
- hair_d_win32.model - This is the low-detail model for the hair. It doesn't work with the facehair tool. (when people talk about LoD, it is primarily because the LoD mods force PES to ignore this model in favor of the high-detail model all the time.)
.dds
- Textures
- face.dds, hair_col.dds, and hair_parts_col.dds are all textures for the model files.
- Normal maps
- face_normal.dds, face_normal_detail.dds, face_edithair_normal_detail.dds are all normal map files that add additional contours to the model.
- Specular/roughness
- face_specular_roughness.dds and face_edithair_specular.roughness adjust the specularity (shiny) and roughness (noise) applied to a surface. Specular uses the green channel. High greens are very flat, low greens are very glossy. Roughness uses the red channel. High reds are very rough, low reds are very smooth.
- Specular
- hair_spe.dds and hair_parts_spe.dds are specular maps for hair_col and hair_parts_col. Black is low reflection, white is high reflection/shiny.
.mtl
For the most part you can ignore this, but if you are using an in-game edit hair as the base for the hair, you will want to replace the hair.mtl it came with a hair.mtl from a real player. Otherwise the game will ignore your texture's color data and make it all black.
Inside Blender
There are two components to a player model, the face and the hair. In general within the tool there will be one element to the face called Face.003 in the tool and multiple elements to the hair as follows:
- Hair_0 - This is the "body" of the hair and is generally a flat surface that extends away from the skull depending on how big the hair is. It uses hair_col.dds and hair_spe.dds as textures.
- Hair_1 - This is the layer that completes the skull and should match up precisely with the face model's boundaries. If it doesn't, you will be able to see unrendered gaps in the player's head if it's not covered by hair. It uses the non-face portions of face.dds as a texture.
- Hair_2 - This contains multiple small meshes that comprise strands of hair and other things like headbands. In the case of hair, some of these meshes are also programmed to flutter around slightly based on the player's motion, which can cause you problems like things moving that you don't want moving or things not having the same position they have in Blender. It uses hair_parts_col and hair_parts_spe for textures.
- Hair_3 - A few models have a 3rd hair component, these are basically the same as hair_2.
Normal vs edithair
In general there are two types of face models, face_high and face_edithair_high. The difference between them is that every edithair model has one common set of border locations for the edge of the face model. Similarly, the edithair hair files all have a hair_1 layer that will match these locations with no gaps.
The face_high layer from a real player will likely only be perfectly matched to that same player's hair file. If you want to use a real player's hair with an edithair face, you will have to modify the face to remove gaps between the meshes.
UI and commands
Screen layout
- 1 - layer list
- clicking the orange triangle on the left of the layer name or the layer name will make it the active layer and switch you to OBJECT MODE.
- clicking the black triangle on the right of the layer name will make it the active layer and switch you to EDIT MODE.
- you can show/hide layers by clicking the eye icon for that layer.
- 2 - Face/Hair mod tool options
- The Start New Scene button will clear out everything and set it up for a clean import. It is only active in object mode. It will also totally clear out anything you have worked on and not saved, and you can't undo it. So don't accidentally click it.
- For obvious reasons you should not move the Game thing off of PES 2014.
- 3 - Face Model file selector
- The button on the right side of the box will let you go find a .model file to work with.
- ALTHOUGH THERE IS NO FORMAT DIFFERENCE BETWEEN THE FACE_HIGH_WIN32.MODEL AND THE FACE_EDITHAIR_WIN32.MODEL, THE TOOL WILL NOT WORK CORRECTLY IF YOU LOAD THE EDITHAIR MODEL FILE TO START WITH.
- If you want to work on an edithair model, you will need to copy it to face_high_win32.model and use that to work in Blender, then re-copy that file back to face_edithair_high_win32.model when you're done.
- 4 - Import face
- 5 - Export face
- These two buttons only are active in OBJECT MODE. You should only use them to load a file named face_high_win32.model or the tool is liable to fuck up. As stated before, rename a face_edithair_high_win32.model file to face_high_win32.model and it will work fine (but you will have to rename it back to face_edithair_high_win32.model for fileloader to use it correctly in-game).
- 6 - Import hair
- 7 - Export hair
- These two buttons will import and export a hair_high_win32.model file.
- The face/hair tool does not work with the low-detail hair_d_win32.model files, even if you rename them.
- These two buttons will import and export a hair_high_win32.model file.
- 8 - apparently I skipped 8.
- 9 - Sync window toggle
- When this is on, selecting a point in one window will select it in the other one as well. It is usually useful to keep this on, but if for some reason you don't want to this is how to turn it on and off.
- 10 - border drag
- To make one window a little bigger or smaller, click and drag on the border between them.
- 11 - window mode selectors
- These will select which mode each panel is in. Usually one will be in 3D View and the other will be in UV/Image view. If for some reason they end up out of these here is how you restore them.
3D View Icons
- 1 - Mode select
- Object Mode (the import/export functions of the facehair tool only work in this mode)
- Edit Mode (where you actually push vertices around)
- 2 - Viewport Shading
- Texture - applies texture to model
- Solid - applies opaque monochrome color to model
- Wireframe - no textures, just edges and vertices
- 3 - Translate tool
- Move selected points in XYZ space
- 4 - Rotate tool
- Rotate selected points around XYZ axis
- 5 - Scale tool
- Scale selected points on XYZ axis
- 6 - Depth buffer clipping toggle
- If on, you will only see and be able to select the points closest to the view instead of every one through the model.
- 7 - Proportional Edit
- Disable - off
- Enable - affects all vertices on the entire layer
- Connected - affects all vertices on the same mesh
- mouse wheel up/down while working - makes effect range bigger/smaller (indicated by circle)
- 8 - Auto merge vertices
- MAKE SURE THIS IS ALWAYS OFF, IF YOU ACCIDENTALLY TOGGLE IT YOUR MODEL MAY GET ALL FUCKED UP WHEN YOU TRY TO GET IT BACK INTO PES (if it's dark it's on, if it's not it's off)
Keyboard shortcuts
- A - select all/none
- If any vertices are selected, it will clear the selection. If no vertices are selected, it will select all on the current layer
- B - selection mode
- left-click and drag will add points to the selection
- middle-click and drag will remove points from the selection
- ctrl-L - select linked
- This will go through every vertex in the current selection and add all of the other vertices in its mesh to the selection.
- This doesn't work on the UV mapping side.
- R - rotate tool
- S - scale tool
- After hitting R or S, you can select one axis to limit the tool to by hitting X, Y, or Z next.
- This is the also only way to scale a selection of points in the UV panel on just one axis instead of both.
- After hitting R or S, you can select one axis to limit the tool to by hitting X, Y, or Z next.
Camera
- num 1
- front view - camera aligned with Y axis looking at face
- ctrl + num 1
- back view - camera aligned with Y axis looking at back of head
- num 3
- right view - camera aligned with X axis looking at right side of head
- ctrl + num 3
- left view - camera aligned with X axis looking at left side of head
- num 7
- top view - camera aligned with Z axis looking at top of head
- ctrl + num 7
- bottom view - camera aligned with Z axis looking at bottom of head
- num 4 / num 6
- rotate view around Z axis
- num 8 / num 2
- rotate view around XY axis
- ctrl + num 4/ ctrl + num 6
- move camera view on Z axis
- ctrl + num 2/ ctrl + num 8
- move camera view on XY axis
- num 5
- toggle fisheye perspective (you should keep it off, this is just how to fix it in case you accidentally hit it)
- keyboard 1
- Work in 'normal' view. If you accidentally make everything disappear you may have hit a keyboard number instead of a numeric keypad number.
Mouse
- middle click-and-drag
- rotate camera view
- right-click
- apply target marker (good for keeping track of places through texture changes, etc)
Working in Blender
What you are doing
What the tool expects
Techniques
Twitch Walkthroughs
Making the box head
VoD link: http://www.twitch.tv/gainare_tottori/b/529736515
Offcamera we have done the following prep work:
- copied Arjen Robben's head into a new folder called boxhead, partially for the /wg/ Robben joke and partially because with a box head we don't really need anything besides hair_0 for the shape anyway
- unzlibbed hair_col.dds
00:56 - Since we have a 512x512 texture, some quick math determines 170x170 squares will fit 3 in a row in with a little extra wiggle room.
03:03 - laying out the texture template that we will UV map into the box head.
04:55 - drawing in guide arrows. Red arrows will point to the top of the head. Green arrows will point to the front of the head. Blue arrows will go from the left side to the right side if you are facing that side.
06:35 - since this is not a very complex shape, a minimum of points are necessary to create a cube. After thinking about it a bit, I decide to use these 10 triangles for the main part of the boxes and drag them outward on the Y-axis to isolate them for working.
07:08 - selecting the pair of triangles for the front side of the box and scaling them up.
07:48 - Using scale on the Y-axis (S then Y) to scale it down to 0 and flatten the front side.
08:05 - using the grid in the background, we just drag the corners around on the X and Z axises to make a square.
09:22 - arranging the points for the top of the box. Since it's connected to the front, two of them are already done.