remove every other value in array

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Post Reply
caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 15:13

remove every other value in array

Post by caledonian_tartan » 04 Dec 2013, 09:40

hello
i'm a bit stuck here:

how can i remove every other value of an array? e.g. 1,2,3,4,5,6 -> 1,3,5

i tried with modulo, but the filter node does not work with arrays...
SI 2015 @ WIN7-64

caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 15:13

Re: remove every other value in array

Post by caledonian_tartan » 04 Dec 2013, 09:47

array.jpg

seems like this works.

the "-1" gives me a correct array size. if put to 0 (or other legal ID) the array size does not change.
SI 2015 @ WIN7-64

nautilus
Posts: 29
Joined: 08 Mar 2011, 22:32

Re: remove every other value in array

Post by nautilus » 04 Dec 2013, 10:34

so the value "-1" deletes an array entry?
(so time ago i heard smething similar with -2 or polygons when building topo).
is that true?

NNois
Posts: 754
Joined: 09 Jun 2009, 20:33

Re: remove every other value in array

Post by NNois » 04 Dec 2013, 10:52

find in array then remove from array ?

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: remove every other value in array

Post by Mathaeus » 04 Dec 2013, 11:05

i'd try something like building a new array of half size, separately. Then, "get array indices", multiply by 2, select in original array. Should be faster than activating the "find in array", also somehow I feel more "safe" if new array is already defined, before.
Anyway whatever works, works...

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests