Listbox list with just unique object

Hi, I made a little script in where I want to list "proxy" objects.
There is uniques objects and other that are instanced.
I would like to list all the differents objects but not to see all instances.

XXX.items = for a in Objects where ( matchPattern a.name pattern:("*"+ NNNAME.text + "*") and ( classof a == proxy )) collect a.name

if someone can help.
Thanks

Comments

Comment viewing options

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

Thanks a lot Miauu !!! Do you

Thanks a lot Miauu !!!
Do you know I can manage this to work ? ( no ?) yes.
Works like a charm ! :-)
Cheers.

miauu's picture

.

I am glad to help. :)

miauu's picture

.

I am sure that you can incorporate the next fn in your script. :)

(
	fn uniqueNodes nodes: = 
	(
		if nodes == unsupplied do nodes = objects as array
 
		local handles = #{}
		for node in nodes where not handles[GetHandleByAnim node] collect
		(
			InstanceMgr.GetInstances node &inst
			for i in inst do handles[GetHandleByAnim i] = on
			node
		)
	)
	select (uniqueNodes())
)

Comment viewing options

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