Notifications
Clear all

[Closed] max script help

I am in need of a simple bit of max script to turn on and off the mask in a blend material but it needs to skip normal un masked/ unblended materials, work on the the materails in the entire scene, that are both top level and embeded in a multi sub material and if possible toggle all the blended materal masks in a scene so they can either be on or off

I am prepared to pay for this to get the script i need

please send me a pm if you can help

Si

5 Replies

PM sent.

-Colin

you mean something like this:


fn checkMat mat state = (
	if classof mat == blend then
		mat.maskEnabled = state

	for i = 1 to getNumSubMtls mat do
		checkMat (getSubMtl mat i) state
)	

fn setAllBlendMasks state = (
	for m in scenematerials do (
		checkMat m state
	)
)

setAllBlendMasks false

call ‘setAllBlendMasks true’ to turn them on. false for off.

focomoso, that almost does the trick, but when turning on it will be turning on all blended materials and not only the ones previously turned off, it would be convinient to save a temporary material library and then when turning on the masks, compare by name the blended materials in the temp matlib with the current scene materials and if the blended mat in the temp matlib is enabled then turn on the corresponding mat in the scene. I already did something similar but I dont have Max here right now, but should be easy to implement. Cyas and good luck.

The line seems to break on ” group $ name:”__Sink” “

When originally posting the script code this website wouldn’t allow me to paste it in like that (with all the code specific text…ex. green, red letters) so I had to paste it into notepad and then paste it into here

Anyway…

thanks for the help guys

Doug

put the code portion between “<code> </code>” tags, substitute <> for []