Jump to content

Alternating a Switch Node when using the Chain Sop


pixel_wizard

Recommended Posts

Please help me..:( I'd like to know if is possible to alternate a Switch node between 0-1 for every copy to point in a Chain Sop. Essentially mirror flipping these bricks so they orient in alternative directions similar to what we see in this castle retainer wall

I've seen examples of randomizing the switch on each iteration inside a for each loop. though here I am using the chain sop because it threads these bricks wonderfully on top of each other.

Capture.JPG

Alternating Corner Brick.hip

Link to comment
Share on other sites

Heyo! I don't know if you are still looking at this or if you've already solved it on your own but I've slapped together a quick edit of your file with the way I'd approach doing this. I did not end up using the "chain" sop so if that is a requirement then this solution is probably disqualified. My solution is using some Houdini 18.0 and above features so if you are using Houdini 17.5 or older then this is also probably a dud. Tell me if you are and I'll have a look at making a 17.5 compatible version. For my solution I used the good old "copy to points" sop with its "variant" attribute feature. This allows us to assign a "id" attribute to both each brick and to each point you want to copy to and if the attribute on the point and on the brick match then that brick will be copied to that point. Then I just also made a version of each brick that was mirrored using your setup and made sure to give these mirrored bricks their own unique "id". Lastly I just made sure that every other point on the line we are copying to has an id for one of the mirrored bricks and bam, alternating randomly distributed bricks.

Hope this can be helpful!

Alternating_Corner_Brick_mnb.hipnc

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...