ScriptSpot

Forum topic · General Scripting

Listbox list with just unique object

By titane357 · 2018-08-08

Description

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 (3)

titane357 · 2018-08-09

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

.

miauu · 2018-08-09

I am glad to help. :)

.

miauu · 2018-08-08

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())
)