karen Posted May 30, 2023 Share Posted May 30, 2023 In attached hip, I'm trying to understand a second VEX code I've taken from Paul Esteves video vex groupname, I have no idea what's really going on, I thought I would get a result but the group is different than what I expected so I misunderstood the code. Could you please comment code lines, this may help shed some light (trying to learn vex) vex_group_intersection.hiplc Quote Link to comment Share on other sites More sharing options...
Atom Posted May 31, 2023 Share Posted May 31, 2023 That piece of code is assigning a 1 or a 0 to a group called "selected" The result of check>=0 will return a zero or a one. If you read the documentation on the intersect function you'll see this... Quote Returns The intersected primitive number, or -1 if there was an error or the ray didn’t intersect anything. Basically, if you get a -1, it won't be added to the group. Quote Link to comment Share on other sites More sharing options...
hannes603 Posted May 31, 2023 Share Posted May 31, 2023 i changed the code a little and put comments. should be easier to understand now. intersect_wrangle__primpoints_in_pointwrangle__array.hiplc 1 Quote Link to comment Share on other sites More sharing options...
karen Posted May 31, 2023 Author Share Posted May 31, 2023 @hannes603 @Atom many thanks Quote Link to comment Share on other sites More sharing options...
Omega-Minus Posted June 1, 2023 Share Posted June 1, 2023 (edited) @karen I recommend you to ask these types of questions to ChatGPT. Just give it the code snippets and ask questions like, "Can you break it down for me? ", "I can't understand x part of this code snippet. Can you make it more clear for me?". It works perfectly fine most of the time. If you don't know about specific VEX function you can use Dashbox ( use CTRL+D to open it), it's a global search function of Houdini UI and just type in the name of the function you're looking for and voila! It'll take you to the documentation of that specific function. It's not limited to functions though you can search for whatever you want. You can use certain keywords to filter context, for example, #vex intersect. This will eliminate results from other contexts that also include intersect in one way or another. If you still cannot get your head around certain things after reading documentations it's completely fine. Ask ChatGPT to give you some examples on whatever you're struggling with. Don't get me wrong, asking questions on forums is okay but it may take too long to get answers sometimes, even for relatively easy things. I hope that helps. Cheers! Edited October 29, 2023 by Omega-Minus correction for misspellings 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.