Need help replacing some maps in my scene.
Hi I'm a new at using MAXScript, and I need to replace a lot of Normal Bump maps in my scene. I imported some models and they have a Multimaterial with several VrayMtl on them, and in some of those VrayMtls there is a Normal Bump map which I need to replace with a VrayNormalMap with the same Bitmap as before.
I searched the forums and someone had a similar problem (actually was the exact opposite), and I found a script that replaces VrayNormalMap with a Normal Bump map, so I tryed to tweak it to do the inverse, but I can't seem to make it work. I believe I need to specify that it is inside a multimaterial, and then a VrayMtl submaterial, but now I'm totally lost.
Any help would be really aprecciated.
This is the script I found earlier from barigazy:
try(destroydialog ::vrnRoll) catch() rollout vrnRoll " VrayNormalMap Convertor" width:168 height:30 ( fn filterNMap obj = ( isKindOf obj.material VRayMtl and \ isKindOf obj.material.texmap_bump VRayNormalMap and \ isKindOf obj.material.texmap_bump.normal_map Bitmaptex and \ obj.material.texmap_bump.normal_map.filename != undefined ) button btn "VrayNormalMap to NormalMap" on btn pressed do ( if (getClassInstances VRayNormalMap).count != 0 do ( local objMtlsArr = for g in geometry where filterNMap g collect g.material if objMtlsArr.count != 0 do ( for m in objMtlsArr do ( local NMap = Normal_Bump name:(m.texmap_bump.name) normal_map:(m.texmap_bump.normal_map) m.texmap_bump = NMap ) free objMtlsArr ) ) ) ) createDialog vrnRoll style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)
Comments
VrayLighrMtl Material to VrayMtl Material
Hello,
I would be appreciated if someone help me to make the script above to convert VrayLighrMtl Material to VrayMtl Material.
Pleaaaaase!
Would be possible change also a Gamma to 1.0?
Hi!
Its great script! Might you know there is a bug with Vray and normal bump in proxy objects. So all proxy objects has to have material with vraynormalmap, not with normalbump and this script is a solution.
I would be very pleased to have also an option to load every bitmap in converted vraynormalmap with gamma 1.0 in 3DS Max 2010 :) Pleasssss :)
Thanks
Nevermind, I found the error,
Nevermind, I found the error, a couple of materials had no bitmap assigned to the Normal Bump, thats where it crashed.
In any other case it works perfectly! Thanks again barigazy!!
...
Try this
bga
Yeah, I tried that same
Yeah, I tried that same thing, but it doesn't work. It returns a dialog that reads:
MaxScript Rollout Handler Exception --No "map" function for undefined.
On the Listener it reads the following:
...
send me test scene for testing
bga
try(destroydialog ::vrnRoll)
bga
Thanks barigazy!! but your
Thanks barigazy!! but your script does the opposite of what I want, it replaces any VrayNormalMap with a Normal Bump.
I need every Normal Bump replaced with a VrayNormalMap.
...
bga