Zbrush to Maya Project, Part 2
January 31st, 2009It´s weekend again, I´m almost sober again, only a little hangoverish and back on the Horny spare time project, showing my Zbrush to Maya workflow. (actually it´s a Maya to Zbrush to Maya workflow…)
Last sunday I stopped at the UV layout process.. well, actually I was stopped by a massive blackout. ( a real one, like where the electricity is gone) and I was so pissed off with loosing my progress, I didn´t want to redo it right then. But lesson learned: SAVE often. I didn´t, so I had to redo the UV layout, which is usually the most annoying part. God hates me.
Well here it is:


If I had to describe UV Layout with one word, it would be compromise. That´s what it is. The UVs for a cube can be layed out almost perfect. Each side can be represented by the exact same size on the texture, BUT you cannot merge all the seams ofc, that´s the compromise on the cube.
For an irregular model, as organic models usually are, there is no ideal way to do it. You have to cut shift and merge UVs to get to a point where you are satisfied.
Usually you would want to go for (in order of importance)
- Give each quad about the same size on the texture as it has on the model
- Use the most part of the texture file
- have the least amount of seams
- place the seams where it makes sense (don´t have one running diagonal across the face)
You should use a texture like this to check the UVs.

Luckily with using ZBrush, the importance of good UVs is shrinking, you could even use the AUV tiles function, but I am oldschool on this. I like to have my textures making sense when i look at them.
So now it´s first time export to Zbrush.
Select the head and export as obj. Next the horns (combine them as one object and be sure to have the UVs non overlapping)
Start up Zbrush and import both the objs, select the head and append the horns as a subtool. For now we will not care about the eyes and the tearducts as we will run some tests first.

press ctrl-d to smooth the elements (i smoothed only twice as my PC is an old jalopy.
Attention, this one is important, as it will influence the workflow at several points: there is an SUV button at the Subdivide options, wich is activating the option of having the UVs smoothed when subdividing the mesh. Don´ bother pressing it, because it´s buggy!
It is smoothing the UVs, BUT whenever you step down a subdivision level and up again, the smoothing is lost. Also when you save your tool and reload it again, the UVs re unsmoothed. This bug creates a hell of a lot of problems. with creating the color map and with creating the bump map, but luckily there are workarounds.
Let´s just hope they will fix it! Sometime! …soon!

start defining the shape. Use the standard, move and smooth brush. Also the transpose features if necessary.
I want to get rid of the boyish face and turn him into a deamon.
So this is the result after some minutes of tweaking:

I won´t go into too much detail on the modelling process, as there are already great video tutorials out there, as videos are much better suited for showing the detailed process.
Just some words of advice:
Do have one general concept. Who or what IS your character. And keep that concept consistent. Sounds very stupid, but this is one of the most crucial but also most made mistakes. A simple nono example would be, having the character skinny on the upperbody and fat at the legs, or having a solid bone structure at some places, but very delicate at other parts.(ofc this could also be done on purpose, but most of the time, it doesn´t make sense)
Even if you go for a fantasy creature, keep the correct anatomy in mind. Don´t randomly put in things that simply don´t exist. Just shift the features, exagerrating or reducing them.
If you throw in sthg, that normally wouldn´t exist, do so very mindfull. An example on this model would be the horns. They don´t belong on a primates head, but if you place them there, insert them carefully, by making the connection to the skull believable. Use reference of horned animals.
Take care of a simple base shape, the simpler the better.
Don´t overexagerate every detail just to make it look like you really did an effort on the model. Alternate between detailed and less stressfull areas to have a nice overall flow.
And an important one: Listen to feedback! It´s the curse of us graphic artists, that anyone can judge our work. If your six year old sister tells you this looks odd, believe her! A lot aspiring artists I´ve met so far do have some serious problems with feedback. And if they do, they have one thing in common: they don´t evolve.
So now it´s time to get that detail into maya. This is done by two steps:
increasing the density on the mesh in maya
and plugging the detail onto it, using a displacement map
Step down to the lowest level of your Zbrush tool

You can still see the basic shape of the changes you did. Export this as an obj and now we are ready to create the displacement map.
First of all: under tool/displacemen set smooth UVs and adaptive to ON. Altough we will not use the built in displacement map generator, but the MULTI DISPLACEMENT 3, this does make a difference.

Now up to the Multi Displacement 3 setting in the plug ins folder. Use the settings you see here.

Then press the export options and you will see this most confusing window. But don´t worry, once you´ve got the basic idea, it´s easy to understand. And if you don´t you can still use it by just copying this quick code in: DE-LBEK-EAEAEA-R32
Here´s what it should look like:

Apply these settings and press close. Back in the multi displacement tab, press Create All. This will export the selected R32 map. (make sure you are on the lowest level of your tool, or this won´t work correctly)
Now we have the mesh and the map exported, so it´s time to jump to maya. You can save your tool and close Zbrush.
Start up maya and import the obj file into your scene. Be sure to have Create Multiple Objects turned OFF in the import settings.

This is what you should see now

Now set the face normals to soft and then add a Mental Ray Subdivision Approximation node to the mesh by clicking Window/Rendering Editors/Mental Ray/Approximation Editor and clicking Create and with the mesh selected click Assign.
Important Note: The SA node smoothes the UVs. No way to change this. …at least, none I know.
So here´s one major problem in this whole workflow: Mental ray DOES smooth and the smooth UVs option in Zbrush is BUGGY. This is the source of a lot of problems when creating the bump and color textures, but we will get to that later.

This simply adds a node to the mesh which divides it at render time. If you want to have all the detail from the sculpting on the mesh, you must have a denser mesh than you see here. Sounds logical, doesn´t it?
Now to edit the SA node.
First of all, rename it to sthg that makes sense. I named it SA_disp. I use this name on all my scenes, as I find it useful to have naming conventions that apply to all my work.
With the rest go with the defaults for now.

Set up a render scene. I do sthg simple, that renders fast to test the map. No fancy lighting, just two directional lights with intensity to one from upper left and upper right corner.

Set raytrace shadows to on on both lights and add a new perspective camera. Don´t use the persp cam to render. You sure could, but it´s better to make a new camera (rename it to rendercam) which is solely used for rendering and leave the standard persp cam for navigating in the scene.
Turn on resolution gate for the rendercam so you can see the actual size of your image on screen.

In the Render Globals Window activate raytracing and hit render. You should get sthg like this.

The mesh is smoothed, but there are no details yet, as the displacement map is still missing. You can see the difference the SA node makes when you compare the head to the horns.
Now before plugging in the displacement map we need to convert it to a .map file. This is a format Mental Ray loves and it´s only one click away.
Open your windows explorer and navigate to your .tif file, created by Zbrush. Download this utility and place it in the folder. Simply drag your .tif file over it and it creates the .map file. It´s as simple as that.

Then plug the .map file to the displacement channel of the shader. Rename the file node to file_head_disp and edit the Alpha Offset channel. This has to be done as maya interprets the information of the file differently than Zbrush does.
If you type in a = into the channel maya automatically realizes you want to type in an expression. So type: = - file_head_disp.alphaGain/2 (this is case sensitive!) and hit Enter.
This automatically sets your alphaOffset to the minus half of your alphaGain. (you would have to close and open the attribute editor to see the effect.)
Now if you do have your model at the correct size (which would be about 22cm wide for the head) you should go with 2.2 on the alphaGain (the expression then sets the alphaOffset to -1.1) and you should be all set. If you do have any other scale, simply test different values till your satisfied. Changing this alphaGain value simply increases or reduces the effect of the diplacement map.

Also make sure you have set the filter type of the image to OFF as you don´t want maya to blur your displacement map.
When you hit render now you should get sthg like this:

be proud and dance a jig! well deserved. We go on in part 3.


















