ZBrushCentral

Multiple mesh's in Blender w/single texture to ZB Polypaint

Texturing models for video games is very particular. You want your models/textures to be as efficient as possible, and this means using one texture for a model even when it has several mesh’s coming together.

I have come up with a very quick workflow for passing a model from Blender over to zBrush for Polypainting. Multiple mesh’s using one UV/Texture map.

This workflow will be outlined here. This tutorial will assume you have basic working knowledge of both Blender and zBrush. Links will be included for the plugins you will need, as well as other tutorials that will help you get to this point.

ZBC does not allow more than 6 attachments per post, so I guess I will have to break this up into multiple posts. :rolleyes:

Software I will be using:

zBrush R6
Blender 2.72b

Blender plugins:
TextureAtlas0.18 - Very useful for getting all UV’s on one map, but is also great for Lightmap baking.

URL’s for TextureAtlas:
Downloadfrom: http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/UV/TextureAtlas
Intro& overview by Paul Geraskin - https://www.youtube.com/watch?v=cIok7SCQ3SA
Intro& overview by Gleb Alexandrov - https://cgcookie.com/blender/2014/08/19/using-texture-atlas-addon/

Note: This version of TextureAtlas is intended for Blender 2.68 but works just fine for later versions. Also available for older versions of Blender.

GoB - Unofficial GoZ for Blender
URL’s for GoB:
http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/GoB_ZBrush_import_export
Download from: http://www.zbrushcentral.com/showthread.php?127419-GoB-an-unofficial-GoZ-for-Blender/page15 (Look for post #216 by Magacal)
Intro& overview by Matthew Heimlich -http://cgcookie.com/blender/2013/06/03/using-gob-zbrush-applink-blender/

Note: This version of GoB is intended for Blender 2.65 but works just fine for later versions. Also available for older versions of Blender. The FIRST URL above (wiki.blender.org) has a download for Blender 2.69, which only contains a python script. It may be beneficial to use this, however it has not been necessary for me so far.

Learning resources

Blendertutorials
https://www.youtube.com/user/cgboorman
https://www.youtube.com/channel/UCVA3cYOgsTN4hs3v7pjne7w Be sure to check out Gleb’s “Game level texturing series”

Let’s get started!!

We will begin in Blender by creating a very basic scene. A cube, a cylinder, and a torus which has been link duplicated. We wont be modeling anything fancy here, this is just to illustrate the UV &Texturing process.

Link duplication is the same as “instance” in other modeling programs. This means it will share the same UV/Texture space as the original; texture one and therefore the other. If you want both to be textured individually, a regular duplication should be used. Of course those would also need their own seams and unwrapped separately.

Step 1. Create objects, Mark seams, and unwrap.

We are going to be using zBrush’s AMAZING Polypainting capabilities! This means we don’t have to worry as much about where our seams are. We are going to be painting on seams that are already joined together, so matching them up is painless.

Step 2. Use TextureAtlas to create a single UV layout for all mesh’s in your scene

2.a After installing TextureAtlas, you will find it on the render tab. In object mode select all objects with the exception of any linked duplicates. Click the “+” button to create a new UV set which will contain all UV’s created up to this point. Be sure that you have unwrapped everything first! Under “Group Name” you may call this anything you like and click OK. Mesh’s are now a group as far as TextureAtlas is concerned. Outlined in green.They are not merged or grouped traditionally.

2.b A new UV set is created. Press tab to go into edit mode. With the UV/Image palette open you will see a multi-colored checker pattern covering the UV layout, and a mess of overlapping UV’s.

On to part 2

Attachments

bl2zbTut8.jpg

bl2zbTut10.jpg

bl2zbTut1.jpg

bl2zbTut2.jpg

bl2zbTut5.jpg

bl2zbTut6.jpg

2.c Go into UV island selection mode. Select individual islands, press G and move them outside of the UV Layout area so you can sort through them. An alternative way is to select all Islands and press E. This will lay your Islands out automatically, however, use with discretion. Some Islands may need to be scaled up or down slightly to give them an appropriate amount of dedicated size in your UV layout.

bl2zbTut11.jpg

2.d
Scale and rotate islands as needed so everything fits into the UV layout area, without overlapping.
2.e Export image from UV menu and click FinishManualUnwrap. You will be able to select individual mesh’s, however they will still be outlined in green.

bl2zbTut12.jpg

2.f
Now, to remove our old UV’s that were used to get here. Under the Data tab you will find that you have an entry called “UV map” and one named for your TextureAtlas UV group. Select all in object mode, and Head back over to the Render tab. Click “RemoveOtherUV’s”

bl2zbTut14.jpg

2.g Save your file as a different name than the one you used to model. Use this file from now on. I highly suggest saving another file immediately. This will be for Step 3. Add “merged” to the name.

Step 3. In object mode, select all objects with the exception of any linked duplicates, and join (ctrl +j)

After joining your mesh’s you will see everything has been condensed into one entry in your Outliner. The name will be the last mesh that was selected; in this case, the cube. There will be a solid line going all the way around your merged group. Save your merged file separately from the rest. You will not need it again unless Blender or zBrush crash. After installing GoB you will see a new icon at the top of your screen. This will GoZ your merged group over to zBrush. This is where the real fun begins!

bl2zbTut15.jpg


Note:
Merging linked duplicates and sending them to zBrush with the rest is not necessarily a bad thing. If it’s presence helps you texture your model, it’s no problem. A couple things to bear in mind though. You will be able to Polypaint the linked duplicate and the original mesh separately. Those differences will be overwritten when you convert your Polypainting over to a texture. More on this below.

Step 4. With our object now in zBrush we prepare the model for polypainting. I suggest saving ztl’s along the way.

4.a Draw the object onto the canvas. Press T or click “Edit” as normal. If everything was merged and sent to zBrush properly, your entire model will be there as one mesh (no Subtools)

4.b First things first. Click Zplugin --> UV Master --> "Use Existing UV Seams"

bl2zbTut16.jpg

On to part 3

Attachments

bl2zbTut8.jpg

4.c Next, we need everything separated into Polygroups. Remember, our Seams and UV’s have already been set up. Under the tool palette open the Polygroups section and click “Auto Groups With UV”. Verify by clicking the PolyF button. You may want additional Polygroup’s for your individual components. In this example, the cube will be a wooden crate, so I want each side of the cube to be it’s own Polygroup.

4.d In order to Polypaint, we need to subdivide each Polygroup to get a sufficient amount of detail. We started with 3 objects which all had varying densities of geometry. The density of each Polygroup should most likely be close to the same. In this example, our cube contains 8 points, the cylinder 24 points,and the torus 96 points. My preferred method for this is to mask off the polygroups that we are not subdividing at the time. First, we will make sure “Smt” is turned off in the Geometry section of the Tool palette.
Ctrl+ Shift + Click the Cube.
Ctrl+ A to mask it.
Ctrl+ Shift + Click on the canvas to bring everything back.
Finally,Ctrl + Click the canvas to invert the mask.
You should now have everything but the cube masked. We will now Ctrl + D twice to subdivide the cube to 98 points. If you like, Ctrl + Shift + Click the cube to verify. Bring everything back and Ctrl + Click drag on the canvas to clear your mask. Rinse and repeat! Subdivide the cylinder two (72 points) or three (240 points) times. We do not need to subdivide the torus separately; all we needed was similar Polycounts for all 3 groups. Now, make sure all Polygroups are unmasked and visible. We will need at least 1 million poly’s in order to have enough resolution to paintdetails. In this case, we end up on 1.949 Million @ Sdiv 7.

4.e Business as usual from here on out. Tool palette --> Polypaint --> Colorize. Turn off “Add” at the top, and turn on “MRGB”. Turn off PolyF, and use a material that suits you for painting. I will be using chalk.
4.f Finally time to PAINT!! Of course all of the usual Polypainting tools are available to us. Spotlight will be where I’m going to hang out for the rest of this process. Once you are finished, open the texture map section of the Tool palette, expand the “Create” area. Click “New From Polypaint”; and voila! Notice the layout of our texture preview matches perfectly with the UV layout that was created in Blender. Now, we need to click “Clone Txtr”; also on the Texture map Section. When we do this it will send it over to the Texture Palette, and now we can export this as an image. Choose an image format and a location that suits your project.

Step 5. Armed with a texture thatperfectly wraps around our model we head back over to Blender!
Remember that we do not want to load the “merged”; Blender file. We want the file after the TextureAtlas process was completed. Once the file is loaded we can simply replace the image that was generated by TextureAtlas with the texture that was painted in zBrush. Set your scene up as normal with the newly created texture and you’re good to go!

bl2zbTut23-render.png

Rendered in Blender

In contrast I should have made a 2048 map and placed a seam going down the length of the Cylinder. Other than that I think it turned out quite well.

Let me know if you run into any problems and leave some feedback! Also, I can upload the project files for this including all screenshots and this entire tutorial in a text document if anyone is interested.

As always happy modeling everyone!

thank you! Zbrush + Blender make a great pair!

Nice tutorial. However your cylinder UVs are an odd choice. Any reason you did them that way?

MentalFrogNice tutorial. However your cylinder UVs are an odd choice. Any reason you did them that way?

Thanks! Yea just trying out different things. The UV layout requirement for this method is much more relaxed than traditional standards. I’m the type of person that always tries to see how far I can bend the rules, so I know what my options are for future projects.

At the end of the tutorial I mentioned that I should have used a 2048 map and a seam going down the length of the cylinder. Since, zBrush receives Blender’s UV’s exactly how they were created we are able to paint over both edges at the same time. So, in the end it doesn’t really pay off to try to hide seams at the cost of not having enough UV’s.

iXaariithank you! Zbrush + Blender make a great pair!

You’re very welcome. I completely agree, ESPECIALLY now that we have a good GoZ alternative and ZB reads the UV’s perfectly. Hopefully Pixologic will provide us with an official GoZ for Blender!! Until then, GoB will do the trick.

Thanks! Yea just trying out different things. The UV layout requirement for this method is much more relaxed than traditional standards. I’m the type of person that always tries to see how far I can bend the rules, so I know what my options are for future projects.

At the end of the tutorial I mentioned that I should have used a 2048 map and a seam going down the length of the cylinder. Since, zBrush receives Blender’s UV’s exactly how they were created we are able to paint over both edges at the same time. So, in the end it doesn’t really pay off to try to hide seams at the cost of not having enough UV’s.

Well it’s not just about seams and having enough UV space. There’s also being consistent. With your cylinder UVs you have various degrees of resolution. For some models that’s okay, e.g., a head model with more detail in the face area, and is actually better. For your model, a cylinder, having a change in resolution can be more noticeable, especially when it’s the same object and save type of area, like the cylinder. In other words with your UV setup one end of the cylinder would have a more crisp texture and the other end would be more blurry. That can be a bad thing.

I’ve just never seen anyone UV a cylinder that way so I was just curious if there was a reason behind it. Nice contribution with the tutorial though. :+1:

MentalFrog
There’s also being consistent. With your cylinder UVs you have various degrees of resolution.

By resolution, do you mean not having any vertical edge loops along the length of the cylinder?

Ok. This is a very quick and dirty example using precisely the same method, same exact cylinder. The only difference is that I put a seam down the length.

If I had done this with the previous cylinder, I would have been able to get these kinds of details.

Here’s the UV layout. I have scaled the middle portion of the cylinder down so it takes up relatively the same amount of overall space that the previous one did.

Here is the result after Polypainting in zBrush. I have used a checker pattern to illustrate consistency in the texture even though the resolution is uneven.

As a side note the cube from the previous tutorial remained the default primitive in Blender (6 faces) however I was able to get HQ details simply because it was unwrapped properly. In other words increasing resolution on an object that does not need it for shaping purposes, does not gain us a higher texture detail level.

I hope I am understanding your reply properly and not going on a useless rant! :slight_smile: LOL

-Dragonskin