1
$\begingroup$

How can i get a specific value of a float list by index?

for example: I have a list [3, 4.5, 89, 12]. In this list 3 is the ranked 1 value, 4.5 is ranked 2, 89 is ranked 3 and 12 is ranked 4. How to obtain a value in this list if I only know the rank of this value ?

$\endgroup$
15
  • 2
    $\begingroup$ so you want from [2, 4, 3, 1] become [1, 2, 3, 4]? i don't get it. Please add an understadable example of numbers. thanks. $\endgroup$
    – Chris
    Nov 2, 2021 at 11:49
  • $\begingroup$ Have you ever used animation nodes ? $\endgroup$
    – lazare
    Nov 2, 2021 at 12:19
  • 1
    $\begingroup$ would i ask if i haven't? by the way...you should be quick, because you have already 2 close votes because 2 people don't understand what you meant...just a hint. So you should improve your question instead of asking questions which are a bit weird.... $\endgroup$
    – Chris
    Nov 2, 2021 at 12:22
  • 1
    $\begingroup$ use get list element, use index as your rank, then you get that value $\endgroup$
    – Chris
    Nov 2, 2021 at 14:30
  • 1
    $\begingroup$ like this: [1]: i.stack.imgur.com/rKpDx.png $\endgroup$
    – Chris
    Nov 2, 2021 at 14:30

1 Answer 1

2
$\begingroup$

You can get it with this node setup:

enter image description here

I first created a float list (from your example).

With the "Get List element" node you can get any list element from a list by index.

The viewer shows the result.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .