PDA

View Full Version : Material Baker v2


ericyeo
08-16-07, 10:06 AM
Zscript by David Ikeda for zbrush 2.0~ I modified the script and it's now compatible with zbrush 3.1 and some new function add and work flow changed. The script still yet to work perfectly yet~ but it's good for creating base texture~ Do post some ur tests and feedback in here~


Material Baker v2?
It capture the polypaint and material colors into texture map.

Installation Guide:
1. Create a new folder and name it "temp" in C:\Program Files\Pixologic\ZBrush3.

2. launch zbrush 3.1 and load the zscript "material baker v2"

3. load in your model. Make sure u have ur polypaint done and material setting ready~

4. Click on start.

When it prompt
"This image contains material-index imbedded within each pixel. Would you like to save the material-index as a separate channel?"

Choose YES. It wont do any harmful to the orginal setting

5. It's recommended to bake the four views: Left, right, front,back. You can rotate hortizontally mannually or use the slider to controll the rotation . Once you have ur angle, press the bake button .

7. After bake, the texture will be embeded in the model. You can press "Check" to see your texture.

8. Top view and bottom view will be bake seperately. Becos of some light setting.

9. After you have ur baked all surface. press on "generate". Texture map will be generated.

If there are parts are not baked,you can rebake. u can use masking to hide areas to be baked

Difference between polypaint+material and material:
haha. I think dont have to explain this
comparematerial2.jpg (http://javascript%3cb%3e%3c/b%3E:zb_insimg%28%2765821%27,%27comparematerial2.jpg%27,1,0%29)

Difference between material on and off:
The reflection/refraction is not capture with material button off as you can see from below
comparematerial.jpg (http://javascript%3cb%3e%3c/b%3E:zb_insimg%28%2765819%27,%27comparematerial.jpg%27,1,0%29)

Results:
lowhigh.jpg (http://javascript%3cb%3e%3c/b%3E:zb_insimg%28%2765822%27,%27lowhigh.jpg%27,1,0%29)
Color map
colormap.jpg (http://javascript%3cb%3e%3c/b%3E:zb_insimg%28%2765823%27,%27colormap.jpg%27,1,0%29)

johnwkllr
08-17-07, 01:31 PM
Great work, thank you!
I'll try it tomorrow.

Trurl
08-18-07, 10:27 AM
Thanks ericyeo.
I will try it too.

rhinomax1
08-20-07, 05:11 AM
Thanks ericyeo.
but,what i finish is this.what wrong had happened?

Erklaerbar
08-20-07, 06:34 AM
one of my favourite scripts for Z2, awesome. Its a shame i cant test it right now, but will do so as soon as i find time.:tu:

PS: where do i have to change your "program files" to my german "Programme"?

PPS: why bake polypaint? You can use the "to texture", which is much more accurate than a bake.

ericyeo
08-20-07, 09:51 AM
rhinomax1: hum... weird.. I can see how ur model texture looks like before baked?
Erklaerbar: yes. U'r right~ I was thinking to cut down some process at that time~ Oh. the file directory.. it's actually written inside the code.. if the script is useful becos now still at test, then I'll make improve on it~

First attempt bake with with organic model.

Below model is in zbrush with flat shade, flat render with sub div 1.
I used matcap and play with the material modifier setting. Changed color of Col and Base.

I notice one thing~ Do bake ur model a few times(around 3 times or more) until it cant go any darker. It gives better color~ If u find any weird parts. u can go there and rebake that area.

test.jpg (http://javascript%3Cb%3E%3C/b%3E:zb_insimg%28%2766271%27,%27test.jpg%27,1,0%29)
color.jpg (http://javascript%3Cb%3E%3C/b%3E:zb_insimg%28%2766269%27,%27color.jpg%27,1,0%29)

Kosher
08-20-07, 10:52 AM
What's the benefit of using this over copying to a texture with GUV?

ericyeo
08-20-07, 11:09 AM
u might want to check David Ikeda's thread~ http://www.zbrushcentral.com/zbc/showthread.php?t=21035&page=1&pp=15&highlight=material+baker

WailingMonkey
08-20-07, 12:30 PM
Hi ericyeo,

Thank you for sharing your modified script! It looks to be exactly
what I was hoping for (basically a way to get the matcap's baked
into the actual texture map)....however, when using the script, for
some reason I'm unable to get it to generate the actual material to
1 single texture file after I've baked all 6 angles.

I've basically done what you've shown in the first post, and made
a cube with a similar 'cubemap' UV set. I am able to bake front, back,
left, right, top, and bottom textures, but when I generate, it only yields
a solid grey texture in the areas my UVs are. Any ideas on what
I may be messing up?

cheers. :)


WailingMonkey

Jaidek
08-23-07, 07:40 PM
Hi All,

I seem to be having some trouble with this script. I apply the material I want to bake to the object, for instance the rs_sculpy material, then launch the script. When I hit start I get the following message:
"This image contains material-index imbedded within each pixel. Would you like to save the material-index as a separate channel?"
Not sure exactly what that means, so I will hit no. Next I toggle on Materail_ button and click bake. The material switches to the default red wax for a split second then the "done" box pops up. When I hit "ok" I am left with the red wax projected onto my model. My active material is now called "myshade", which appears to be rs_sculpy. Even when I rotate around the model I see the sculpy material in the unbaked areas. Its just when I hit bake, it is baking the default material. Here is a screenshot, any ideas?

http://img213.imageshack.us/img213/8360/materialbaker2bakeproblmi6.jpg

ericyeo
08-24-07, 09:27 AM
wa.. I found the bug~ my apology to those who have downloaded.. Jaidek thanks. problem solved.

And when it prompt
"This image contains material-index imbedded within each pixel. Would you like to save the material-index as a separate channel?"

Choose YES. It wont do any harmful to the orginal setting

ancomic
08-24-07, 10:43 AM
Hi, ericyeo
Thank you.

I made the MaterialBakerv2 Submenu zsc file. ;)

MaterialBakerv2.zsc file Install folder :
C:/Program Files/Pixologic/ZBrush3/ZStartup/ZPlugs
.
MaterialBakerv2_Submenu.jpg

Jaidek
08-24-07, 09:30 PM
Hey All,

Thanks Ericyeo for the update. However, it seems to be doing the same thing on my side. I am able to get it working (both versions) as long as I have the Material button set to "on". If it is "off" it still defaults to the red wax shader. Should it be doing this? As far as I can tell you would want to have this on always.

Also, thanks ancomic for the Submenu file! Makes things alot easier!

ericyeo
08-24-07, 11:05 PM
ancomic: cool. Tks. That's a help helpful script. :)

Jaidek: Thanks. I didnt notice it, cos I tested with material "on". Sorry. Problem fixed.

ericyeo
08-25-07, 01:38 AM
WailingMonkey: sry. i didnt see ur post. I have a newer version. Do u still encounter the problem?

emdee
09-01-07, 08:03 AM
Hi ,

When I try to run the script I get an "internal error .\AFile.cpp Line:595"
"Unable to open/Create a FileC:\Program Files\Pixologic\ZBrush3\temp\colormap.psd"

I have created the temp folder.

Not sure why this is happening.

Thanks

em

kiki
09-08-07, 02:35 PM
i don't understand why zb don't make that's by défault !

so for me material baker is the best zscripts
but i have lot of bug :(

i can capture the matérial ;(

dozogovi
09-08-07, 11:57 PM
i agree with you kiki a material baker would be incredibly helpful i was on the beta team and asked for this functionality.However it seems the pixologic team doesnt think its a priority.
So because of this i have been useing subcessiotrs's technique of rendering displacement maps with shaders on them. however that is a pain in the butt to get the lights just right.I woudl also like to have real ambient occlusion. I tried to start a thread about it however it didnt get any attention so i assume no one cares. zbrush artists just want to make forum art evidently.

frenzyfol
09-16-07, 09:32 PM
Im awaiting our work copy of ZB3. I had high hopes this functionality would be included natively. Lets hope this script works better than the zb2.0 script.

mlionhsd
09-19-07, 08:50 AM
So Can a Material and Texture be baked into one or is it just Material and polypaint?

ZeroxNothing
09-20-07, 08:46 PM
NOTE****I posted this question in the help section of the forums as well, but I noticed you said to post our feedback and tests here, so I'm posting it here as well.****


Hello, I'm having some material baking issues and I'm hoping someone can help me figure out what is going on. :) Sorry in advance for the picture heavy post, but I wanted to document the steps I took so someone might be able to help me see what I did wrong.
For this project, I am trying to make a clothing item for Second Life using the SL avatar tool that CannedMushrooms posted on their site. If needed I can attach the tool that I am working with on this specific question. I made this this morning quickly as a trial item.
I would like VERY much to be able to bake in all the details that I see when I look at the item in Zbrush, so all day today I've been searching my tush off on these forums. I found a material baking script here on the forums (will post link below) and have remained hopeful for the past 4 or 5 hours that I've been trying to get it to work, but I'm begining to lose that hope.
The .psd that the script is baking is missing color/material information in certain spots when I follow the exact instructions found on the script's instructions page while baking the object. Thinking I could correct this issue, I decided I would try baking it from a few extra angles (in the first .psd outcome, I had only baked from angles 0, 90, 180, 270, top, and bottom. in the second .psd outcome, I also baked from angles 45, 135, 225, 315.). As you will see in a moment, that certainly did correct my missing color/material issues, BUT it made the texture MUCH MUCH too dark.
First off, I'm using the Material Baker v2 script for Zbrush 3.1 found here::
http://www.zbrushcentral.com/zbc/showthread.php?t=49966&highlight=material+baking

I followed the instructions listed on that page as best as I could, but these instructions do not yield usable results for me. Below I have outlined my workflow::

http://farm2.static.flickr.com/1229/1414867307_dce4861ffa_o.jpg


Here, I am simply picking my material and loading the script. All is good so far. I'm not sure if I should have the polypaint+material button and the Material off button highlighted, but my first trials without them highlighted resulted in a .psd texture with no color information on it at all, so I've decided that since I'm getting some sort of result this way, this is the way it is to be done.


http://farm2.static.flickr.com/1419/1415746696_82d779171e_o.jpg

Step 3, I press start on the script window just like the instructions say to do.
Step 4, I begin the start of many bakes.


http://farm2.static.flickr.com/1336/1414868705_cdce5ac7fe_o.jpg

http://farm2.static.flickr.com/1420/1414869353_551da43811_o.jpg

http://farm2.static.flickr.com/1411/1415748816_6cd14fa24f_o.jpg

Finally done baking here, this is before I've hit generate.


http://farm2.static.flickr.com/1409/1414870981_5ec3bc856d_o.jpg

The outcome. As you can see, this texture is missing ALOT of color and material information in angles that I did not bake on. Since this is not right, I've added more angles in the baking process.


http://farm2.static.flickr.com/1254/1414872321_87bc531648_o.jpg

Here, I've baked from the extra angles I mentioned at the begining of this post (45, 135, 225, & 315) that were not listed to bake on in the instructions. This seems to be giving good results, but once I'm done, you notice the texture becomes dark in the angles that I had baked in the begining (0, 90, 180, 270, top, & bottom).


http://farm2.static.flickr.com/1117/1415751744_7a0d8260cc_o.jpg


In this .psds it is clear that neither of these even resemble what my item looked like before I started using this script (see the first picture posted). These are both .psds laid out together so you can see what went wrong on both::

http://farm2.static.flickr.com/1223/1414855981_b92da829a1_b.jpg


As you can see, neither of these results is what I had wanted at all. One is missing tons of color and material information from not being baked in enough angles and the other one, well when I go back and bake the areas that are missing color information, it just starts making the areas I had already baked super dark. It never ends up evening out.

I have been working at figuring this out ALL day literally and have been working with this model and this darn script for HOURS now (5+hours when you add in the time for this post). I am seriously at my wits end and feeling a little crazy. I thought surely when I followed the instructions step by step that it would work, but it didn't. I tried more angles, which seemed to be working, only to find out that it ruined previously baked areas of the texture. What gives? I've tried playing with the lighting a bit, but I don't know if that really has any bearing on this problem and honestly, I REALLY could use someone to stear me in the right direction...please.

John Strieder
11-15-07, 02:13 PM
@emdee:
"Unable to open/Create a FileC:\Program Files\Pixologic\ZBrush3\temp\colormap.psd"The "Temp" Folder MUST be in "Program Files" or "Programme". If it's in "Program Files (x86)" or "Programme (x86)", the Error Message you've described appears and MaterialBaker didn't work.

John Strieder
11-15-07, 02:26 PM
I have a Question: How to Bake a Material in higher Resolutions than 1024x1024? What i need is 4096x4096 ... thanks for any help in advance! :-)

3dassets
12-02-07, 02:03 AM
I wonder why you want to bake into hi-res, baking material is meant for realtime display such as game environment and interactive 3d. These requirement is of low res so that it can be deliver online.

Great to see some progress with it and great job!;)

ivo d
01-15-08, 02:44 PM
I have zbrush 3.1 and the script just doesnt run, i've loaded it, just doesnt do anything,

any idears?

piotrek255
02-13-08, 01:54 AM
on the bottom of zbrush workspace you have 2 arrows, one facing up and one facing down, click on them, and a wide field will jump up, scroll down this wide emty field. for some reason the plugin's options are hidden there.

Elliott Mitchell
03-12-08, 06:37 PM
I can't seem to get this to work with zbrush 3.1 on 64 bit windows. Has anyone successfully used this script with ZB3.1 in win-64?

MAN9A
04-03-08, 06:18 AM
I wonder why you want to bake into hi-res, baking material is meant for realtime display such as game environment and interactive 3d. These requirement is of low res so that it can be deliver online.

Great to see some progress with it and great job!;)Por example, I want to export the appearance of my Zbrush object into other 3D aplication. And I need HiRes texture

3dassets
04-03-08, 08:36 PM
I see, I asume it can give you lighting control in other 3d software so that you can set up simple scene lighting. I have not been able to use material baker yet.

0xdeadc0de
04-06-08, 09:40 AM
hello, i found a big big bug.
seems you have hardcoded the c:\program files\pixologic\zbrush path in your plugin, i have a non english windows xp so my "program files" directory is not called in that manner, and your plugin crashes, it's also not usable for the ones that haven't zbrush installed in that directory (for example if you're using d: for datas and c: only for os stuff like a lot of people do)

anyway this plugin seems very nice, keep the good work

edit: i managed it to work making a fake c:\program files\pixologic\zbrush directory, now i'm having the same problem the guy above had, it's like it project the texture baked onto the mesh so when i do different bakes it mess up all ending with the dark stuff the guy above said

3dassets
05-03-08, 10:46 PM
For your info, you can create your own website at Google page creator with 100mb file space for FREE. All you need is a gmail account!

You can have two websites if I recall, thats 200 mb and allow hyperlink to any where absolutely no restrictions. G knock yourself out!

Here is mine:http://catalogue3d.googlepages.com/:tu:

akuendon2
07-02-08, 10:19 AM
Thanks a lot~~
It's good.

weiyan
07-07-08, 10:48 AM
-

irahk
08-06-08, 07:12 PM
I followed the directions to a tee for this script, but in the end, I am left with a model that is all black. It has no shaders or materials...just black. Any help as to why this is happening???

tinnycan
09-10-08, 11:42 PM
Great script! Really!

One question though, whenever I bake it automatically switches from best to preview render. Any way to fix this? Thanks in advance!

theeman
10-23-08, 06:55 AM
got the same problem as iray i also get a black model the texture disapears completly

vedanta
11-13-08, 07:02 PM
Thanks , I will have to try this script.

drondron
11-18-08, 02:16 PM
how to use resolution more tnan 2048 on 2048 .for exemple 4096 or 3000 pix

mim_armand
11-24-08, 12:55 AM
Hey really tnx for this great, handy, useful tool! saved my days! :D


irahk and theeman, after bake just turn texture off or if you are in "check" status yet, just press the start button again and it will back to normal your model again :)

drondron, I had the same question also, but it seems since it uses the screen snapshots to project em on UW-textures it's not different if you just scale it up in PS yourself coz the limitation isn't the size of texture, it's about the res of work area on ZB! (Btw just my thought of how it works!) ;D

:idea: :
Btw, as a side-note, I think it really needs a button to exit from "check" state also, ;)

m,

seraph769
02-22-09, 01:08 AM
It actually took me a while to figure out how to install this plug-in properly but I figured it out by reading your instruction carefully over and over again. :D

I think that this plug-in has a lot of potential in terms of developing it further maybe in the next version or something. This plug-in works similar to cannedmushroom's tutorial on how to bake materials in Zbrush 3.1 using Zapplink. The only downside to baking the materials the Zapplink way is that you don't have control over the lighting which makes it harder to get even lighting on your model.

I just figured out how to get rid of the black areas if you bake with material and color using your plug-in. You have to adjust the lighting intensity for the material itself and do almost a 360 turnaround bake on every angle on your model to get even lighting. Had I known this plug-in first before the cannedmushroom tutorial I would have got better material textures with color on them. It took me a while to figure out why certain areas were so dark when I finally rendered out my model in Maya with mental ray using the baked material generated by learning cannedmushroom's tutorial. Oh well, I was dumb then and I didn't know it at the time.

Overall this is a good plug-in. Keep up the good work. Thanks.:)

dirtbox
03-03-09, 02:25 AM
Just wanted to post to say thanks to Eric for this plug, I've come to rely on it over time and despite a few tiny hiccups here and there, it's very much appreciated.

I'd love to see it expanded on, perhaps to include fixed lighting and so on, but until then :tu:

Kyoske
12-03-09, 10:32 AM
Any one having issues getting this to work on 3.5R3. I know I'm having no luck. Or is there now a new way to get all the sculpted information on to my texture map in 3.5R3 that I have yet to hear of. I just snagged my copy yesterday so I haven't had a ton of time to research so I though I would start here.

thanks every one
Kyoske

Dromineer
12-21-09, 03:12 AM
Any one having issues getting this to work on 3.5R3. I know I'm having no luck. Or is there now a new way to get all the sculpted information on to my texture map in 3.5R3 that I have yet to hear of. I just snagged my copy yesterday so I haven't had a ton of time to research so I though I would start here.

thanks every one
Kyoske
Yup, I am also having the very same issue of having this great script to work on 3.5R3

Walt-Art
02-25-10, 11:37 AM
I've had the same issue as well. with r3.53
does anyone have an answer to this?
maybe silence IS the answer? :confused:

seraph769
02-25-10, 12:03 PM
The plugin you are trying to use on Zbrush 3.5 R3 which is the material baker I would presume is NOT compatible with Zbrush 3.5 R3. This plugin was designed for Zbrush 3.1 so it won't work for Zbrush 3.5 R3.

NoobVee
03-07-10, 06:48 AM
i wish pixologic develop this plugin. this is useful for quick texturing..