Group Management

   2467   2   0
User Avatar
Member
5 posts
Joined: Nov. 2016
Offline
Hello all,

I am having trouble setting up primitive groups for an object according to a specific pattern. I recently posted my issue to the odforce forums, but unfortunately I did not explain my issue very well.
Hopefully I can explain it better here.

I have a tube, with 8 vertical rows and 13 columns.

I want to create a set of groups, with each group containing the polygons within every other horizontal loop (prims 0-12—> group1, prims 26-39 —> group2, etc, etc—-see pic). I want to do this procedurally because I plan on generating a digital asset later down the pipeline, and I want the group logic to remain consistent even if the number of columns and rows changes.


The way I see it, the number of polygons per loop is identical to the set number of columns:if there are 12 columns, there are 12 (numbered 0-11) primitives in the first loop, if there are 24 columns, there are 24 primitives). I feel like this relationship in and of itself should be enough for a startup logic of group creation?
I was able to get the first group easily enough using a group by range, with the rangeend value referencing the column value (ch(“../revolve1/divs”)-1". Can I then formulize this data to work iteratively until all loops have been accounted for? Even if the first time around I can only get a group per consecutive loop, I can (I think) get every other group out of this using some sort of ‘every other’ function.


I hope this is clear. I new to Houdini and am trying to get into the habit of using procedural methods for model creation.
I have attached two files and a pic, the first is just a base example. The second file is the work in progress file–containing some things I've been experimenting with–the group sop in question is colored blue.)

Thank you for your help. I am fairly new to coding by the way, so if it would make more sense for me to get a better handle on C++ fundamentals first, let me know. If you could point me to any resources for learning vex for the context at hand here as well, that too would be greatly appreciated.
All the best,
JK

Attachments:
groups_01.hipnc (50.2 KB)
Lightningbolt_v002.hipnc (187.4 KB)
groups_01.JPG (169.8 KB)

User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
- On the tube node, place the cursor in the Columns field. Right click and select “Copy Parameter”
- Set your Group SOP to “Group By Range” and place the cursor in the the first “Select_of_” field and right click
- Select “Paste Copied Relative Reference”
- Do the same for the second “Select_of_” field but multiply this expression by 2 “ch(”../youtubeobject/cols“)*2”
> If you now change the Column or Row values the grouping will still be every second row.
Hope this helps.

-b
Edited by bonsak - Dec. 22, 2016 11:38:13
http://www.racecar.no [www.racecar.no]
User Avatar
Member
5 posts
Joined: Nov. 2016
Offline
That is what I needed. Thank you
  • Quick Links