ScriptSpot

Forum topic · Scripts Wanted

Switch maps, texture stays

By roamn · 2012-06-18

Description

Hi all im not very skilled in maxscript (in not skilled at maxscript at all actually :-) )
i have a vraynormal map type in standard materials (or vraymtl it the same for my situation) bumps slot.

This VrayNormal map type has in it normal jpg texture. I have around 39 objects each with different jpg textures.

I need to swap automatically the VrayNormal map type for Normal map type (which si common to default max materials) but with the issue that all the jpg textures must stay in their places, just replace the the Vraynormal map type with the Normal map type and keep the texture as a submap.

Can anyone help me please?

Comments (8)

roamn · 2012-07-07

thanks, ill definitelly try it :-).

JokerMartini · 2012-06-21

This batch map switches for materials are so useful.
This script as well as many others is one worth keeping need your side as you'll find yourself modifying it and using it quite often.

*.ms

barigazy · 2012-06-19

or use below code as *.ms

Attachments

VRay Normal Map Convertor

barigazy · 2012-06-19

Tray this

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)

zahid hasan · 2012-07-11

thanks. very neat script.it will come handy.

barigazy · 2012-07-12

Thanks guys for the comments

We need the reverse of this process (from max to vray) ..

mustafa mamdouh · 2015-07-11

Hi barigazy!

Thanks so much for your help! .. really appreciated ..
Actually we need the reverse of this process cause we have a kind of problems from 3ds Max Normal Bump and we need to convert each Normal bump to VRayNormal Map ..
I think in this we will lose the "additional bump" slot on Normal bump but that's not important for us ..

Regards,
Musafa