Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
neilcooper33
1969 Views, 3 Replies

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

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

Tags (1)
Labels (1)
3 REPLIES 3
Message 2 of 4

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

  

Message 3 of 4

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

Message 4 of 4
Anonymous
in reply to: neilcooper33

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report