Tattoo Workshop
Introduction
This is a tutorial about using Blender to project images onto body mesh. My usual approach has been to paste designs into a transparent layer on top of a skin texture then to drag, scale rotate them and hope for the best. The results have been mixed at best, with tats deforming as the body mesh curves and a lot of guess work being required to get the image correctly placed. I've also had to place them a little oddly at times to avoid seams in the UV map.
The approach I outline here results in precise placement and greatly reduced distortion. It also lets you map tattoos over seams without having to worry about lining them up, It isn't a perfect solution, but it's a lot better than paste-and-pray. I hope you find it useful too.
What you will need:
- Blender 2.75 or better
- The latest nif importer scripts for Blender
- The Gimp
- The Gimp dds plugin
- Some sort of BSA unpacker - I used BSA Browser
Getting Ready
Start by making sure that the body mesh(es) you want to tattoo have been unpacked unpacked. I used BSA browser. You're after femalebody_1 for the body itself. Make sure you're using the body mesh you use in game - if you use UUNP you want to use that mesh rather than the one from the Skyrim - Meshes bsa.
While you're at it get the textures too
One more thing - create an empty UV map image at the texture size you want. I tend to work at 1024x1024, but if you want 2048x2048 or bigger go for it. Just bear in mind that each tat is a new texture taking up VRAM. All you do is open the Gimp, create a new image of the desired size, delete the background so you have an empty transparent image and then export it as a png. It'll be useful later.
Set Up the Studio
I use a couple of tutorials to help figure this process out. One of them is from 3dcheapskate who recommends setting up a "Tattoo Studio" in Blender. What you do is this:
- Open Blender on the default scene
- Delete everything. The cube, lights, camera, the lot
- use shift-C to make sure the cursor is at the origin
- add a light (I used a sun) and transform it 2 units up the z axis
- add a camera and transform it one unit up the z-axis
- point the camera at the origin
- save the setup as tattoo_studio.blend
This probably isn't as important with the latest Blender and Quick Projection as it was with 2.49b, but it's still good to have a setup where you know where everything is and where the lighting will be good.
Import and position the mesh
I'm going to assume you have the latest nif importer setup properly. Go to file->import in Blender and import the mesh part(s) you need. Set the scale adjustment really small - something like 0.02.
Once the import process is complete, move the model so the area you want to tattoo at the origin point and facing upwards. Zoom in so the target area fills the screen. You want to be looking down at it as squarely as possible.
Quick Projection
Go to texture edit mode. In the tool bar on the left there should be an section labelled "external". Expand that.
Set the image size to the size you want to use for your textures, then click "edit" **Check**
The gimp will open with a screenshot of the view in the 3D window. Any changes you make here will be reflected back in the 3D window.
Create a new transparent window over the screenshot and paste your tattoo design into that. Scale it and position it until it looks about right.
Once you're happy, hide the original layer so all you can see is the tattoo design on a transparent background. The export the image. Use the filename the Gimp suggests and overwrite.
Apply The Projection
Remember the transparent UV map you made earlier? Load that into the UV window. You want to see the grey-on-grey alpha checkerboard pattern overlaid with UV mesh. Once you have that, go back to the external tool tab and press the "apply" button. If all goes well you should be able to see the tattoo in the UV window. You may need to go back to object or edit mode and play around with the selection before it appears.
Assuming all goes well, save the UV image with a new filename. You can now exit Blender.
Set up the texture for SlaveTats
The texture file you just saved will be in .png format. You need it to be a dds. Open the file with the gimp and export it with the .dds suffix. Choose RGBA8, BC3/DTX5 and "Generate Mipmaps".
Make sure there's a slavetats folder for your mod. It should be in skyrim\textures\actor\character\slavetats\yourmodname. Create the folder if it doesn't exist, then copy your new dds file into it.
Now edit skyrim\textures\actor\character\slavetats\yourmodname.json and add an entry for the texture. By way of example, this is the entry that adds Lady M.'s spider mark.
[ { "section": "Young Mephalians", "name": "Castemark", "texture": "young_mephalians\\wide_grey.dds", "area": "Face", "credit":"DocClox" },]
Test The Result
Start Skyrim, go to the SlaveTats MCM and apply the tattoo to your character (or whoever). Make sure it looks as you expected.
Post Processing
The technique is not perfect and there are still a lot of reasons why your texture might look strange.
Elven forehead geometry, for isntance, is radically different from that of humans, so a tattoo that fits on a human forehead may well be all over the place on an elf. You may need to make a separate version for elves. (And probably again for argonians and khajiiti if that's something you want).
Areas with a high cell density can also cause problems. The pubic mound, for example, has a lot of small UV cells and not many pixels to share between them. Your texture gets sheared and scaled to make it fit and the effects can be brutal. In cases like this it's probably best to do a little post-processing. Open the texture, create a new blank layer, draw the texture again using the distorted texture as a guide so you get the poisition and proportions correct, and then hide the old texture layer and save the new one. It's a pain, but probably nothing you haven't been doing anyway.
Example
Hildy Half-Bright decides she in need of some protection in battle and asks Ragvar Bad-Apple to give her an enchanted tattoo. Ragvar agrees and recommends this as a suitable protective talisman.
Hildy agrees that it looks most potent, but is a little taken aback when Ragvar tells her it will only take effect if inscribed on her ass-cheek. Reluctantly she agrees to have her bum tattooed.
This is what Ragvar sees. (afer clicking in the 3D window and pressing shift-space anyway)
Now the ideal place to put this tat is right on top of the butt-to-leg seam. You can see the seam in the screenie there. (For some reason I can never get CBBE to work quite right with Mod Organizer). Anyway, this doesn't deter Ragvar who clickes the "Qucik Edit" button there at the side. Gimp opens showing the scene in the 3D window.
From there, the easiers thing is to pick "open as layers" from the file menu and open our "hurt me" design.
And there you see the image in the gimp. First thing to do is to rotate it and scale it so it looks about right
I left that at a bit of an angle so it would follow the curves of the body rather than being mechanically vertical. I have no idea if this will work or not, but that's what makes these things interesting. (Ragvar's excuse is he had too much Flinn before starting work. I like mine better...)
Now: there are two things you need to do. First, the tattoo image is too small. You can see that from the yellow dotted line around the edge. So right-click on the layer in the layers box and resize layer to image. Then hide the layer with the original screenshot. The result should be like this:
After that you can export the image. Use the name it suggests and say "yes" to overwrite.
I'll finish the screenshots off tomorrow.
Notes
If you can't see the section of mesh you want to tattoo, it's OK to delete sections of the model. It's not as though going to save the mesh, right?
This works best when the surface is fairly flat. Small curvatures are not a problem. Moderate ones can be fixed in gimp using perspective or cage transforms. More extreme cases may require you to apply the texture in settings, changing the view between projections and correcting any errors that creep in.
Summary
By now you should know how to use Blender to project a tattoo into a model and save as a texture scaled to the model's UV mesh. By doing this you can position the image precisely, automaticlly scale it to follow the UV map of the mesh and map over seams without problems. I hope you find it useful.
References
http://www.blendtuts.com/quick_projection
31 Comments
Recommended Comments