pixel_wizard Posted May 13, 2021 Share Posted May 13, 2021 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. Alternating Corner Brick.hip Quote Link to comment Share on other sites More sharing options...
underscoreus Posted May 20, 2021 Share Posted May 20, 2021 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 1 Quote Link to comment Share on other sites More sharing options...
pixel_wizard Posted May 20, 2021 Author Share Posted May 20, 2021 Thanks Underscoreus! This was helpful. however, using the chain sop is most important for getting the bricks to stack neatly without clipping into each other Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted May 23, 2021 Share Posted May 23, 2021 Yes that's easy. The idea is to give to each connected piece the correct "class" primitive attribute. Here is one way to do it. Using Chain SOP. alternating.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.