dpap Posted October 17, 2013 Share Posted October 17, 2013 (edited) A VOP performs a pointcloud lookup and uses while loop in oder to take advandage of the pcimport node to get distance,ptnum ,P etc. How can I store the result of each loop in a while node in vops? Each loop gives me a point but I only get the last point out of the node( although I have set max number of points to a number higher than one.. ) Maybe somehow push/append them into an array so I can call the later on? If that is the way, arrays in vops need inline code (afaik..) and I haven't managed to figure i out... One of my goals is to draw multiple lines that connect the look up point with a number of points on the pointcloud(= max number of points) without puting the VOP and the Foreach node into another ForEach node out side the vop (because it is not fast). I hope all this makes sense ......thanks ps. play a bit with the slider of "max number of points". Slide it from 1 to 4 and you'll see the line jumbing to the next point. I want to be able to store these points without movin the slider.. Push in array.hip Edited October 17, 2013 by dpap Quote Link to comment Share on other sites More sharing options...
Hudson Posted October 17, 2013 Share Posted October 17, 2013 (edited) Hello! I took a quick look at your scene and figured out a few things I would try to change. Heads up, I have never created a matrix and generated attributes in a while loop. But is seems as you have to store a large amount of data and attributes in a single point so I tried a different method. But it might not be suitable for your purpose In the vopsop I calculate the distance and direction between the floating point with the points in the geometry. I also added an interger attribute (in_range). You can then set the geometry points to in range or not depending on an user input. Thereafter delete all points which are not in range. Then copy stamp lines using the direction attribute and the length between the points of the geometry to the floating point. It might be easier to understand if you check out the scene. You could probably do a for_each if you have other floating points. *Edit* forgot the file ofcourse Push in array.hipnc Edited October 17, 2013 by Hudson 1 Quote Link to comment Share on other sites More sharing options...
dpap Posted October 22, 2013 Author Share Posted October 22, 2013 Thank you for your time and effort Hudson and sorry for late answer ! Although I would like to learn more about arrays, your approach is different and very cleaver. Maybe I have to start thinking in a new way when in houdini... The bad think is that I am used to ICE and where arrays are very easy to use.Damn I thought I'd be in cg heaven when using Houdini Maybe I'll try again the arrays approach another time. Thank you again! Quote Link to comment Share on other sites More sharing options...
petz Posted October 22, 2013 Share Posted October 22, 2013 its not a problem to use arrays in vex. take a look at the attached file. maybe this is what you are looking for. hth. petz array.hipnc 3 Quote Link to comment Share on other sites More sharing options...
dpap Posted October 24, 2013 Author Share Posted October 24, 2013 (edited) Hi Petz! Thanks for your help! You actually nailed it!!! It gets the job done in a clean and tidy way! You are right that arrays in Vex are not a problem but you have to know Vex for that to be true... Although I understood your code, I am far from saying that I know Vex.. So, for guys like me Vops is the way to go, because I dont want to be a programer /* I wouldn't be a good one*/ but I really enjoy a "visual programing " workflow. Long story short , for educational reasons I changed a little bit your code and tried to "translate" it from VEX into VOPs. But as I expected : result==failure I uploaded the file if someone wants to give it another crack.. And btw since I can set a "float array" at the inline code outpout type, why can’t I declare an attribute of array type in my “attribute create” node or my “add attribute node”??? Not very intutive...... translating vex to vops.hipnc Edited October 24, 2013 by dpap 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.