Notifications
Clear all

[Closed] When-construct double return?

Hi,

I got the following when-construct:

	when select objects changes obj do (
 		print (findItem LightList obj)
 	)

And at first selection change (from no selection to an object) everything is ok, i get printed out one number (index in array)

But when I change from this object to another i get the old number+the new one printed…how can I avoid that? To only return the index of the currently selected obj?

1 Reply

This is a guess, but could it be that this behavior is caused by the fact that the “selected” state of two objects changes, and thus you get two event callbacks? I.e. object 1 goes from selected to deselected, object 2 goes from deselected to selected.

If you’re looking for a general selection changed callback, you should either use the general event callback #selectionSetChanged, or the NodeEventCallback.selectionChanged