hi
does anyone know how to script the procedure of moving the diffuse map into bump and displace map slot, and also enabling displace and setting the value to 3 ?
that would be awesome!
thanks for any help
Forum topic · General Scripting
By V-MOTION · 2012-10-13
hi
does anyone know how to script the procedure of moving the diffuse map into bump and displace map slot, and also enabling displace and setting the value to 3 ?
that would be awesome!
thanks for any help
Comments (5)
Comment policy
Doesn t seem to work on max2017sp3 and latest Vray...
who could help please?
Thanks vincent*
bout_de_lune@yahoo.com
thank you barigazy!
very helpful
final solution
This function will better fit into all of this
fn diff2BumpDispl vrMat bMulti: displMuli: asCopy: =
(
if isKindOf vrMat VRayMtl do
(
vrDiff = vrMat.texmap_diffuse
if vrDiff != undefined do
(
if asCopy then (vrMat.texmap_bump = vrMat.texmap_displacement = vrDiff)
else (vrMat.texmap_bump = copy vrDiff ; vrMat.texmap_displacement = copy vrDiff)
vrMat.texmap_bump_multiplier = bMulti
vrMat.texmap_displacement_multiplier = displMuli
)
)
)
--this will create instance of diffuse map in bump and displacement slot
diff2BumpDispl meditMaterials[1] bMulti:30 displMuli:3 asCopy:false
--this will create copy of diffuse map in bump and displacement slot
diff2BumpDispl meditMaterials[1] bMulti:30 displMuli:3 asCopy:true
Now the bump and displacement maps are instances of diffuse map.
But if you want to be copy of diffuse map than replace line7 with
Like this
vrMat = meditMaterials[1] -- or $.material
if isKindOf vrMat VRayMtl do
(
vrDiff = vrMat.texmap_diffuse
if vrDiff != undefined do
(
vrMat.texmap_bump = vrMat.texmap_displacement = vrDiff
vrMat.texmap_bump_multiplier = 30
vrMat.texmap_displacement_multiplier = 3
)
)