Read a multiparm float as a float array
3258 3 2- RodrigoMartin
- Member
- 24 posts
- Joined: Nov. 2019
- Offline
Hello, following with the procedural vertical graph i was doing last weeks, I am now trying to do a reference in the side of the graphic that shows the relative high, so you have a reference of how much high is each block.
My aproach was creating a block that scale in the Y axis based of the max high of all the parameters of the vertical graph, the high is defined with a multiparm float, and i tough about using the vex function max() but I don't know if it is possible to create a dynamic array from multiparm block.
Thanks you for reading me.
My aproach was creating a block that scale in the Y axis based of the max high of all the parameters of the vertical graph, the high is defined with a multiparm float, and i tough about using the vex function max() but I don't know if it is possible to create a dynamic array from multiparm block.
Thanks you for reading me.
- tamte
- Member
- 8583 posts
- Joined: July 2007
- Offline
you can read them in a for loop
if for example your multiplarm folder is called columns and also I'd advise set first instance index to 0 instead of default 1
if for example your multiplarm folder is called columns and also I'd advise set first instance index to 0 instead of default 1
int ncol = chi("columns"); float alturas[]; for(int i=0; i<ncol; i++){ string si = itoa(i); float altura = chf("altura" + si); append(alturas, altura); } if (ncol>0){ f@altura_avg = avg(alturas); f@altura_min = min(alturas); f@altura_max = max(alturas); }
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- RodrigoMartin
- Member
- 24 posts
- Joined: Nov. 2019
- Offline
tamteThanks you very much! I knew loops but never though of using this way, you are the best helping everyone here in the forum! Thanks you!
you can read them in a for loop
if for example your multiplarm folder is called columns and also I'd advise set first instance index to 0 instead of default 1int ncol = chi("columns"); float alturas[]; for(int i=0; i<ncol; i++){ string si = itoa(i); float altura = chf("altura" + si); append(alturas, altura); } if (ncol>0){ f@altura_avg = avg(alturas); f@altura_min = min(alturas); f@altura_max = max(alturas); }
- OdFotan
- Member
- 192 posts
- Joined: April 2015
- Offline
-
- Quick Links