Home Technical Talk

Maxscript - Custom bake elements

polycounter lvl 13
Offline / Send Message
jazznazz polycounter lvl 13
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:
-- Custom bake elements v2
   --   25.05.13 , Hristo Dinev. A HUGE thanks to Neil Blevins - http://www.neilblevins.com/, and also to Chaos Group :)

   -- Usage:
   -- The script needs a version of "soulburn scripts" - http://www.neilblevins.com/cg_tools/soulburnscripts/soulburnscripts.htm
   -- for its object combining function, and also Vray - if you want to use Vray's specific bake elements, of course.
   
   -- Main purpose - baking tesxtures to SEVERAL selected objects , not just one. 
   -- Tested on 3DS MAX 2013, but should run on older versions, too.
   -- No User interface for now, just open it in MAX's Script editor and hit Ctrl+E. 
   -- All the important variables are at the top and are relatively "human" readable. Read the comment after each variable for info.
   -- Change the "bakeElementCustom_elementName" variable to select a bake element.


Bake elements Examples:

- Mray_AO - The standard Mental Ray Ambient Occlusion:
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

- 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


- 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

Scanline_Quick_BW_Mask - standarg black/white mask

Example%20Scanline%20Quick%20Mask.png




Download: https://github.com/jazznazz/Maxscript/blob/master/CustomMapsBake/CustomMapsBake_V2.ms




.
Sign In or Register to comment.