6ril Posted May 22, 2016 Share Posted May 22, 2016 (edited) Hello, I'm looking for the best way to prevent an attribute from changing once it has reached a certain value. I'll have other benefits from this, but for now it's to control the "active" state of some points via an animated object. I'm setting a group of point with a bounding sphere grouping, then I wrangle i@active = 1 for that group. but, obviously, when a point is back out of the sphere, it's out of the group and gets a @active = 0 again. I'm wondering if it's doable in VEX (if active becomes 1 then never change again) or if there's other tricks to do that. here is a simple hip file where I move the points up when they are in group1, so for this exemple, I would like the point to never come back down if they get moved. Thank you! I've seen a way to do that in a particle tutorial, where the colours get changed and is then prevent from changing back when outside a box, but I just can't remember, and can't get my hand on that video again : / OD-F_keepattrib.hipnc Edited May 22, 2016 by 6ril Quote Link to comment Share on other sites More sharing options...
f1480187 Posted May 22, 2016 Share Posted May 22, 2016 Set Group's Merge Operation to Union with Existing and place the node inside a Solver SOP. accumulate_group.hipnc 1 Quote Link to comment Share on other sites More sharing options...
6ril Posted May 22, 2016 Author Share Posted May 22, 2016 fantastic ! bravo ! 1480187 thanks to you. out of curiosity, if there a way in VEX to prevent future change of an attribute? (if "attrib" becomes 1 then never change again) Quote Link to comment Share on other sites More sharing options...
f1480187 Posted May 22, 2016 Share Posted May 22, 2016 Sure, a simple if statement checking for value of 1 will work. You need to get previous geometry as an input, which involves usage of sop solver or for loop. Without it you will cook completely new geometry with fresh attribute. It is not impossible for pure VEX, but not efficient. You could cache animated geometry on disk, and then loop through files to get attribute values, and accumulate them the way you like: // Point wrangle. for (int i = 1; i < 35; i++) { string file = sprintf("$HIP/geo/geo%02d.bgeosc", i); int active = point(file, "active", @ptnum); i@active = max(i@active, active); } accumulate_group_weird.zip 1 Quote Link to comment Share on other sites More sharing options...
6ril Posted May 22, 2016 Author Share Posted May 22, 2016 I'll have to dig that up a bit more, but I understand the concept. thanks F1, quick and efficient ! Quote Link to comment Share on other sites More sharing options...
unex Posted June 7, 2017 Share Posted June 7, 2017 Hi, recently i've the same problem but can't solve it. I tried the "Union with Existing"-Group-Solver concept, but with no succes. (I'm relativly new to Houdini) Here's the Hipfile ---> Look at inside the "glue-rbdpackedobject1" - network cheers fracture_sidekick_04.hip 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.