ScriptSpot

Forum topic · General Scripting

Accessing composite map color in standard material maxscript

By limeyverts · 2017-10-02

Description

Hi I'm new.

I'm trying to access and change the color of a specific composite map layer within the diffuse slot of a standard material.

Can anyone tell me where I am going wrong?

Thanks for any help


colorArray=#(red, green, blue, yellow)

rollout a "Random Shirt"
(
Button btn "Change Color"
on btn pressed do
(
selectedMaterial = $ material
selectedMaterial.diffuse.compositeTexture[2].diffuse = colorArray[random 1 colorArray.count]
)
)
createDialog a 200 300

Comments (1)

.

jahman · 2017-10-05


on btn pressed do
(

	for s in selection where s.material != undefined do
	(	
		if hasProperty s.material #diffusemap do
		(	
			if iskindof s.material.diffusemap CompositeTexturemap do
			(	
				for i=1 to s.material.diffusemap.mapList.count do
				(	
					-- check if map != undefined, check if it has needed property, set this property
					
				)
				
			)
			
		)
	)	
	
)