Automate V-Ray Material - Diffuse 2 Bump & Displace

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vinyvince's picture

Doesn t seem to work on

Doesn t seem to work on max2017sp3 and latest Vray...

who could help please?

Thanks vincent*
[email protected]

W DIGITAL's picture

thank you barigazy! very

thank you barigazy!

very helpful

barigazy's picture

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

barigazy

barigazy's picture

Now the bump and displacement

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

vrMat.texmap_bump = copy vrDiff ; vrMat.texmap_displacement = copy vrDiff

barigazy

barigazy's picture

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
	)
)

barigazy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.