Hi
Problem with multilistbox
(
local MYObjs = #()
rollout multi "" height:245 width:140
(
multiListBox lbx_Obj "Objects list" pos:[10,7] width:120 height:12
button Add_Obj "Add" pos:[10,185] width:24 height:24
button sel_lis "sel" pos:[34,185] width:24 height:24
button Mov_Up_lis "^" pos:[82,185] width:24 height:24
button Mov_Dw_lis "v" pos:[106,185] width:24 height:24
--add objects to the multiListBox
on Add_Obj pressed do
(
userSel = getCurrentSelection()
if userSel.count >= 1 do
(
for o in userSel do (appendIfUnique MYObjs o)
lbx_Obj.items = for i in MYObjs collect i.name -- update list with array
)
)
--select all scene objects in multilistbox items
on lbx_Obj selected lis do
(
itemsel = for j in lbx_Obj.selection collect getnodebyname lbx_Obj.items[j]
select itemsel
)
on Mov_Up_lis pressed do
(
local itm = lbx_Obj.selection as array
swap lbx_Obj.items[itm] lbx_Obj.items[itm-1]
lbx_Obj.items = lbx_Obj.items
swap AnimObjs[itm] AnimObjs[itm-1]
lbx_Obj.selection -= 1
)
on Mov_Dw_lis pressed do
(
local itm = lbx_Obj.selection
if itm < lbx_Obj.items.count do
(
swap lbx_Obj.items[itm] lbx_Obj.items[itm+1]
lbx_Obj.items = lbx_Obj.items
swap MYObjs[itm] MYObjs[itm+1]
lbx_Obj.selection += 1
)
)
)
createDialog multi
)
1_we adds some objects to the multilistbox list, is it possible by a button or function when we select the objects in the scene the objects get selected in the multilistbox list?
2_can anyone help me with the shifting the multi listbox items
Thanks in advance