Hi there!
I'm trying to make a simple multiparm set-up for creating blocks that will stack on top of each other.
I can control the number of blocks and the height of each block but I have no clue how I can read the height of each box from each iterations.
I made an attribute within the multiparm itself to store the height of the block but I have no idea how I can call out that parameter from the previous iteration into my current iteration for usage.
Any help and ideas will be great!
How to access attributes from previous multiparm iteration?
2312 2 1- YuPing91
- Member
- 19 posts
- Joined: 7月 2012
- Offline
- Andr
- Member
- 899 posts
- Joined: 2月 2016
- Offline
If you name your multiparm block parm as “myparmName”, it will be automatically converted to myparmName1, myparmName2, as you add new instances…
So you can access a specific a multiparm block instance parm by compositing the general parm name + the instance id.
one thing to rmb is that multiparm instances indices generally start from 1. So keep that in mind when you compose the name.
So you can access a specific a multiparm block instance parm by compositing the general parm name + the instance id.
string instanceName = "myparmName" + itoa(id); // itoa() converts int to string float height = ch("path/to/controlNode/" + instanceName);
one thing to rmb is that multiparm instances indices generally start from 1. So keep that in mind when you compose the name.
Edited by Andr - 2019年10月29日 07:37:00
- YuPing91
- Member
- 19 posts
- Joined: 7月 2012
- Offline
Thank you Andr!
I was looking for a way to get attributes within each multiparm instead of the parameter input itself because I realize that I needed to add constantly add up the values with every instance and store them somewhere as an attribute but I do not know how I can read it.
With what you suggested, getting the parameter itself, I can just run a for loop through every instance and get the parameters into a list and add them up during every instance. It's a bit tedious but that's what I can think of now, and it works!
Thanks again!
I was looking for a way to get attributes within each multiparm instead of the parameter input itself because I realize that I needed to add constantly add up the values with every instance and store them somewhere as an attribute but I do not know how I can read it.
With what you suggested, getting the parameter itself, I can just run a for loop through every instance and get the parameters into a list and add them up during every instance. It's a bit tedious but that's what I can think of now, and it works!
Thanks again!
Game on!
-
- Quick Links