Variable number of break SOPs?

   2966   6   0
User Avatar
Member
12 posts
Joined: Feb. 2012
Offline
I'm trying to figure out a way for a digital asset to add a user defined set of break planes to an object but am stumped on where to look.

I've been following a bunch of Peter Quints tutorials on ForEach and noticed his last one was sort of close (http://vimeo.com/7361320 [vimeo.com]) but it uses cut planes and random numbers for rotations. What I'm looking for is a way to control the parameters of each Break SOP that I'm adding, but have the number of Breaks SOPS added controlled by an integer variable, so maybe I'll use 2, 5, 8, etc.

Does anyone know of a way to do this?

Thanks!
User Avatar
Staff
6205 posts
Joined: July 2005
Offline
Use a foreach sop to do the breaking.

But instead of driving off a random number, use a ch() to refer to multiparm parameters on your asset. Set the number of foreach iterations to be the number of multiparms set.

I'd start with something simpler - just use a foreach in Merge mode to accumulate rotated grids, with the number and rotation of the grids driven by the multiparm on your asset.
User Avatar
Member
12 posts
Joined: Feb. 2012
Offline
Feel like a dummy because I'm sure I'm missing something ultra-simple but I can't seem to get this working. I dragged the rotation values into the type property>parameters of my asset but I'm not seeing any of the grids from my foreach node changing.

I can tell its creating multiple grids because when I MMB click over the digital asset and I see that I have 3 polygons when I set my foreach number to 3.

What am I missing here?

Attachments:
foreach_test_02.hip (58.0 KB)

User Avatar
Member
512 posts
Joined: July 2009
Offline
there's a couple of things that you've been doing wrong.
See the attached file and feel free to ask questions

best,

Manuel

Attachments:
multiparms_fix_manu.hipnc (55.3 KB)

http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
User Avatar
Member
12 posts
Joined: Feb. 2012
Offline
Awesome! Once I set the each node to merge mode I got what I was looking for perfectly.

I'm kind of curious about ch(“folder0”)-1, does that take the input into input #1 of the foreach inside my digital asset? I'm guessing you did a -1 since I was sending in a grid already, so the first object was already there.

I have a couple questions on the transform rotation formula you used. Why did you use FORIDXVALUE over FORVALUE as it appears they both work? Also stamps() instead of stamp()? In looking at the houdini help files it seems like stamps is used when retrieving a string? I guess I'm a little fuzzy on the conditions one would use FORIDXVALUE vs FORVALUE

Thanks for the help!
User Avatar
Member
12 posts
Joined: Feb. 2012
Offline
In looking at it more I think I understand better now. Folder0 is the name of the multiparm list in the digital asset and the way your formula was setup gets us the names of xform1_r#x r#y and r#z. Seems like you used index stamp name instead of stamp name so you could start with 0 which is a better index to start with.
User Avatar
Member
512 posts
Joined: July 2009
Offline
I used ch(“folder0”)-1 because your index is always starting with a zero, if you just leave it that way there's always one multiparm which is being leftover.
As for why I use stamps() : In this case I'm concatenating strings, stamps() returns a string, alternatively you could use ftoa(stamp()) which gives you the same result.
http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
  • Quick Links