Selecting Array through Listview

1.How do I make the listviews selected item associate with the object array when the button "Select" is pressed. So when Select is pressed it then selects the correct array of objects which are defined at the top in the maxscript file.

rollout rlLights "Light Me Up"
	local OutterLights = #($Outter_00,$Outter_01,$Outter_02,$Outter_03,$Outter_04,$Outter_05,$Outter_06,$Outter_07)
	local InnerLights = #($Sphere009,$Sphere010,$Sphere011,$Sphere012)
	button btnPrint "Print" width:45 height:14 pos:[84,10]
	multiListBox mlbxSelSets "Selection Sets: " items:#("OutterLights","InnerLights") pos:[10,10] width:120 height:10
	button btnSetMtl "Make Material" width:120 height:20 pos:[10,165]
	button btn0 "0" width:24 height:20 pos:[10,185]
	button btn25 ".25" width:24 height:20 pos:[34,185]
	button btn5 ".5" width:24 height:20 pos:[58,185]
	button btn75 ".75" width:24 height:20 pos:[82,185]
	button btn1 "1" width:24 height:20 pos:[106,185]
	button btnCopy "Copy mtl" width:55 height:20 pos:[10,210]
	button btnPaste "Paste mtl" width:55 height:20 pos:[75,210]
	button btnClear "Clear keys" width:120 height:20 pos:[10,235]
	button btnSelect "Select" width:120 height:20 pos:[10,260]
	on mlbxSelSets doubleclicked val do 
		print "here we go"
	on btnSelect pressed do
		select OutterLights
	on btnPrint pressed do
		SelObjects = for i in selection do format "$%,"
		print SelObjects
createDialog rlLights width:140 height:290


Comment viewing options

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

if understand the question...

maybe this can help?

local OutterLights = #( ... )
local InnerLights = #( ... )
local AllSets = #(OutterLights,InnerLights)
on mlbxSelSets doubleclicked index do

my recent MAXScripts RSS (archive here)

JokerMartini's picture

Updated the code

Updated the code, Check it out because its still being funky.

John Martini
Digital Artist (new site)

br0t's picture

Hi, I think you can use

I think you can use selectionSets for that. If you write something like this in your add button:

	on btnAdd pressed do
		if txt != "" do 
		mlbxSelSets.items = append mlbxSelSets.items (etItems.text as string)
		mlbxSelSets.selection = mlbxSelSets.items.count
		theSel = selection as array	
		selectionSets[etItems.text as String] = theSel
		etItems.text = ""

and something like this to the doubleclicked event:

	on mlbxSelSets doubleclicked val do 
		theString = mlbxSelSets.items[val]
		theSet = selectionSets[theString]
		for item in theSet do selectMore item

it will create a selection set when u press the add button and it will select all items of that set when you doubleclick it in the list.


Never get low & slow & out of ideas

Comment viewing options

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