Notifications
Clear all

[Closed] How to change rollout in modifier parameters

i place my rollouts codes in plugin script, but mxs is load all rollouts. I want when i change some paremeters load rollouts .

sample code

plugin modifier mod1
name:"A Deneme"
classID: #(0x5e015873, 0x3841453b)
(
	parameters main2 rollout:ro1
	(
		deger1 type:#integer animatable:true default:10 ui:ddl1
		on deger1 set val do
		(
			print val
		)
	)
	rollout ro1 "ro1"
	(
		dropDownList 'ddl1' "" pos:[24,8] width:140 height:40 align:#left items:#("RO2","RO3")
		spinner spn1
		on ddl1 selected i do
		(
			
		)
	)
	rollout ro2 "ro2"
	(
		label lbl "ROLLOUT 2"
	)
	rollout ro3 "ro3"
	(
		label lbl "ROLLOUT 3"
	)
)
5 Replies

The general concept of the max’s plugin user interface is to use one or more rollouts, where every rollout can be in an open or closed state… visible or hidden rollouts are conceptually wrong for use with plugin’s UI.
If you want to use rollouts with a visibility option, I recommend using the SubRollout mechanic, which is very well presented with examples on MAX resources, including this one.

try(destroydialog rol) catch()
rollout rol "Test" width:191
(
	local required_rol =
	(
		rollout required_rol "Required"
		(
			label lb "REQUIRED PARAMETERS ..." align:#center offset:[0,30]
		)
	)
	local optional_rol =
	(
		rollout optional_rol "Optional"
		(
			label lb "OPTIONAL PARAMETERS ..." align:#center offset:[0,30]
		)
	)


	label param_lb "Parameters: " align:#right offset:[0,8] across:2
	dropdownlist subs_dd items:#("Required", "Optional") default:1 width:84 height:100 align:#right offset:[4,6]
	subrollout subrol width:172 height:200 align:#center

	on subs_dd selected state do
	(
		if state == 1 then
		(
			removeSubRollout subrol optional_rol
			addsubRollout subrol required_rol
		)
		else
		(
			removeSubRollout subrol required_rol
			addsubRollout subrol optional_rol
		)		
	)
	
	on rol open do
	(
		addsubRollout subrol required_rol
	)
)
createdialog rol

Thank you DenisT. How can i make, refresh and load new rollout like a “edit_poly” modifier switch subobjectlevel.

Or like this

a

I found a some solition. Save two seperate plugin script file(classid and plugin name should same), and use “filein” method on event handler.

Like this;

rollout ro1 "ro1"
(
	dropDownList 'ddl1' "" pos:[24,8] width:140 height:40 align:#left items:#("RO2","RO3") selection:1
	on ddl1 selected i do
	(
		case i of
		(
			1:(filein "C:\mod1.ms")
			2:(filein "C:\mod2.ms")
		)
	)
)