Script to Apply Slider Manipulator to Multiple COPIES of an Object that have the same Modifiers?

Hey everyone,

I'm looking for any help I can get (pointers, tips, links, suggestions, anything) to accomplish the following:

(Also see attached Max file) Say have have 4 copies of a box. Each copy has a turbosmooth modifier and a spherify modifier. I want to link a slider manipulator to each of their TurboSmooth viewport iterations, a slider to their TurboSmooth render iterations and a slider to their spherify percentage.

As of right now, I have to link the slider to each object individually by going to the Schematic View, selecting the slider (eg. TurboSmooth Viewport Iterations), right clicking, selecting "Wire Parameters", Object/Value, clicking out in space to get the dialog to pop up, then searching through to find the right objects (out of hundreds of objects in my scene), expand all of their modifiers, click on viewport iterations and finally link them... 1 at a time. I've tried this the other way around too: Select all of the boxes first and try to wire them to the slider all at once... it only does 1 box unfortunately.

Something like this doesn't sound that bad when there are only a few object. But when there are maybe 100-150 (copies of) objects that I need to control with a few sliders (that all have the same modifier stacks), this can get very time consuming.

I'd like to script it but with linking sliders to object modifier values, I don't even know where to begin. Would be great if I could select a group of objects and tell them ALL to link to one slider and then it asks what modifier property I want to link.

Any help would be greatly appreciated! I've searched for several hours on the subject and thus far, have come up empty handed. So anything you can share will be helpful. Even if it's just pointing me to the right thread/link!

AttachmentSize
sample_file_01.max4.43 MB

Comments

Comment viewing options

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

Try this

mapped fn modifieModifer arr mods:TurboSmooth val:1 = 
(
	local modProp 
	case mods of 
		(
			TurboSmooth	: (modProp=#renderIterations)
 
			Spherify	: (modProp=#PERCENT)
 
			default		: (modProp=undefined)
		)
 
	if modProp != undefined  do 
	(
		for i in arr.modifiers where (isKindOf i mods)  do 
		(
			if (isKindOf i TurboSmooth) then 
			(
				if not (i.useRenderIterations) do 
				(
					i.useRenderIterations = on
					setProperty i modProp val 
				)								
			)
			else
			(
				setProperty i modProp val 
			)
 
 
		)
	)
)	
 
-- 
 
try (DestroyDialog changeValuMod) catch()
rollout changeValuMod "Untitled" width:162 height:65
(
	spinner spn2_turbo "Turbosmooth " pos:[15,6] width:121 height:16 range:[1,10,1] type:#integer
	spinner spn3_spereify "Sperify           " pos:[15,25] width:121 height:16 range:[1,100,400] type:#integer
 
	on spn2_turbo changed val do
	(
		modifieModifer selection mods:TurboSmooth val:val
	)
	on spn3_spereify changed val do
	(
		modifieModifer selection mods:Spherify val:val
	)
)
 
createDialog changeValuMod 

Hope it help tho, I cant open your max files, coz Im in lower max version right now.

--- run the script 
--- select any object, prefer that had modifier in it 
--- drag the slider you prefer , turbosmooth or sperify (I made the script to be expandable in the future if you know what properties you want to edit but only one properties at a moment tho)
--- see the result
DotScott1's picture

Thanks for the response!

Thanks for the response!

I didn't think about getting it done this way. I think it could potentially work! Though as of right now, it seems like the script works for the spherify modifier but not the render iterations. Or it worked once for render iterations but then wouldn't work again. I'm going to play around with it and see if I can get it to work. But again, thanks for the response! Greatly appreciated!

Comment viewing options

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