Hello guys,
for some time now I use a quick'n'dirty script I made for baking maps - "Custom bake elements" , I just wanted to share it. I know there are n+1 really good scripts for baking different maps out there - Textools, RTT Assist(Hi Martin, miauu :-) ,but this one uses V-ray for two of the maps(Vray EdgeTex and Vray Dirt -I haven't seen anything like that in another renderer), and works on SEVERAL selected objects, fast.
It's Ment for "tech" users - no interface, just change the values of the variables from MAX's script editor and hit Ctrl+E (quick'n'dirty, I told You:-)
Feel free to copy, paste, delete, sell, buy or carve in stone this piece of code, I'll be super happy if someone finds it useful!
NB: You'll need some version of Neil Blevins' "soulburn scripts" - http://www.neilblevins.com/cg_tools/soulburnscripts/soulburnscripts.htm , and V-ray (obviously).
A little info:
Bake elements Examples:
- Mray_AO - The standard Mental Ray Ambient Occlusion:
![Example%20Mray%20AO%20.png](https://raw.github.com/jazznazz/Maxscript/master/CustomMapsBake/Example%20Mray%20AO%20.png)
- works just like that when not all objects are selected - note the unselected objects add to the occlussion, too:
![Example%20Mray%20AO%202%20.png](https://raw.github.com/jazznazz/Maxscript/master/CustomMapsBake/Example%20Mray%20AO%202%20.png)
- Vray_DirtMap - now we're talking - if used with default settings it produces results similar to AO, but if "Invert normal" is ON - ("bakeVrayDirtInvertNormal = on" in my script) with small radius, it darkens edges, not crevices:
more info:
http://www.spot3d.com/vray/help/150SP1/examples_vraydirt.htm![Example%20DirtMap%20Edges.png](https://raw.github.com/jazznazz/Maxscript/master/CustomMapsBake/Example%20DirtMap%20Edges.png)
- Vray_EdgeSmooth - My favourite - cheap and fast way of baking "Rounded corners " normal map.
the "bakeVrayEdgesTexThickness" variable controls the radius of the fillet in MAX units. The green channel needs to be inverted If you're going to use that Normal Map in e.g Unity.
Tutorial :
http://www.peterguthrie.net/blog/2009/03/vray-edge-fillet-tutorial/![Example%20EdgeTex%20NormalMap.PNG](https://raw.github.com/jazznazz/Maxscript/master/CustomMapsBake/Example%20EdgeTex%20NormalMap.PNG)
Scanline_Quick_BW_Mask - standarg black/white mask
Download: https://github.com/jazznazz/Maxscript/blob/master/CustomMapsBake/CustomMapsBake_V2.ms
.
Replies
Solved my own issue.
Vray has a VrayExtraTexMap in the Bake to Texture options, which lets you plug in any 3DSMAX Map. I guess they did it this way because VRAY bypasses the default render system.
Confirmed working with Vray Dirt, Vertex Color, Material ID
Hi,
Wow, I didn't know that old piece of crappy code could help somebody! I'm sorry that it didn't work from the beginning for you. But then again, good job for making it work!