Maxscript to convert standard materials to vray materials but retain animation on diffuse slot?

Maxscript to convert standard materials to vray materials but retain animation on diffuse slot?

neilcooper33
Enthusiast Enthusiast
2,604 Views
3 Replies
Message 1 of 4

Maxscript to convert standard materials to vray materials but retain animation on diffuse slot?

neilcooper33
Enthusiast
Enthusiast

Hi All

I have an export from Synchro which has animated Standard materials which I need to convert to Vray materials and retain the animation keys in the diffuse color slot (see attached).

I can do this manually by picking the material, create new Vray material, and wiring in the bezier controller to the new vray material but i have thousands so looking for an automated way.

I've tried a couple of material converters but they don't bring across the animation.

 

if doing in maxscript, i think i need to.....

Get current object material
Create new vray material
Wire in old diffuse bezier node to new vray material

apply new material to object

repeat

 

thanks in advance! 


Neil

0 Likes
Accepted solutions (1)
2,605 Views
3 Replies
Replies (3)
Message 2 of 4

denisT.MaxDoctor
Advisor
Advisor

i don't have VRay in my system but the solution can be as:

 

 

mapped fn convertStandardToVRayWithDiffuse mat = if iskindof mat Standard do
(
	vmat = VRayMtl name:mat.name showInViewport:mat.showInViewport
	
	if (c = getpropertycontroller mat #diffuseColor) != undefined do
	(
		setpropertycontroller vmat #diffuse c 
	)
	replaceinstances mat vmat 
	vmat
)
fn changeStandardMaterialsToVRay =
(
	mats = getclassinstances Standard 
	convertStandardToVRayWithDiffuse mats
)	

/*
changeStandardMaterialsToVRay()
*/

 

 

 

let me know if you meet any problems (errors, etc.)

  

0 Likes
Message 3 of 4

neilcooper33
Enthusiast
Enthusiast

thanks so much for this! will test this out later..... 🙂

0 Likes
Message 4 of 4

Anonymous
Not applicable
Accepted solution

I am doing exactly same thing. trying to change materials which came from Synchro to V-rayMat, but still cant transfer keys:((( 

0 Likes