I want to add a new object only if its not already in the list. I don't want duplicate names of the same object.
This is what I have so far but I'm not sure what I'm missing? Why wont it work.
(
try(DestroyDialog rlDitto)catch()
local AnimObjs = #()
rollout rlD ""
(
MultiListBox mlbxAnimatedObjects "Animated Objects" pos:[10,7] width:120 height:12
button btnAddAnimObj "+" pos:[10,185] width:24 height:24
on btnAddAnimObj pressed do
(
userSel = getCurrentSelection()
if userSel.count >= 1 do
(
for o in userSel do
(
for i=1 to mlbxAnimatedObjects.items.count do
(
currListObj = (getNodeByName mlbxAnimatedObjects.items[i])
if (currListObj.name != o.name) do
(
append mlbxAnimatedObjects.items o.name
mlbxAnimatedObjects.items = mlbxAnimatedObjects.items
append AnimObjs o
)
)
)
)
print AnimObjs
)
)
createDialog rlD
)
By JokerMartini · 2011-05-16
miauu · 2011-05-17
br0t · 2011-05-17