Midway83 Posted November 16, 2021 Share Posted November 16, 2021 Hello everyone ! I've been trying for day (literally.) to make a super simple thing in Houdini : - I have a Float Array with infinity values I want extract My idea was to make a FOREACH in this array, and when I have a infinite value, I put it on an array. When I have a real number, I put it on another array. But I can't understand the Attribute Vop For Each and If System... Were they drunk when they make a system like this ? ^^' It drives me crazy here's my situation at the beginning : I have my array (AllMax) and 2 empty arrays (MaxBad for infinites values, and MaxGood for the rest) My main array have 70k+ values like this : I'm trying to do something like this : (I tried with getAttribute, with Bind, I'm not sure if I need to bind_export each time I want to update the binded array, ...) The best result I get (I'm not sure I can get again haha I'm empty) is that I have the good values in the good array but when the IF BLOCK have a false value, my foreach end and I have only one value in one of the two arrays. I don't understand well the Houdini if and foreach system I think I don't understand why they don't have a system like Unreal Engine, with a if node which have two output, one for true and one for false... and have "exec" input/out to control the flow... it's much easier :/ Thanks in advance guys !!! Quote Link to comment Share on other sites More sharing options...
Ziyad Posted November 17, 2021 Share Posted November 17, 2021 (edited) Hi, I'm more of a VEX guy but I think you have the right idea in your VOP as it looks similar to how you can do it in VEX. You essentially would need to create a foreach loop that goes through every index of your AllMax array, then using if statements you would check if an index is infinite or not, then append each index accordingly to MaxBad & MaxGood arrays. I have attached bellow a screenshot showing the solution inside a point wrangle: Hope this is what you want! Edited November 17, 2021 by Ziyad typo Quote Link to comment Share on other sites More sharing options...
Midway83 Posted November 18, 2021 Author Share Posted November 18, 2021 Thanks for your answer !! Ok it's working... haha I'm trying for 2 days with nodes and It works with a few code lines... I need to learn VEX (if you have some tutorials or tips don't hesitate :p) I don't understand why it didn't work with nodes... maybe I don't understand the way the handle their foreach and if paired blocks (it's too confusing for me) Thanks again, you motivates me to learn VEX Quote Link to comment Share on other sites More sharing options...
Ziyad Posted November 18, 2021 Share Posted November 18, 2021 Glad I could help! I recommend this free programme by cgwiki: https://www.tokeru.com/cgwiki/index.php?title=JoyOfVex He explains VEX in a fun and easy way! Best wishes, Quote Link to comment Share on other sites More sharing options...
Midway83 Posted November 18, 2021 Author Share Posted November 18, 2021 Hi again ! Wow, it seems really cool maybe I'll try ! The thing is to find project to experiment with VEX ^^ Thanks again !! 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.