spf987 Posted February 12, 2019 Share Posted February 12, 2019 Hi, would anyone please be able to help with the following? I've searched to no avail. I have a curve, followed by resample. I would like to slide all of the extra points along the curve, in a similar way that you can do with one point using the Carve sop. I've been experimenting with the uv attributes and like the Shift sop, but it only moves the point number along, as opposed to the point itself. Ideally at the end point, they 'reset' back to the start of the curve. It's been a while since I used Houdini and I imagine it's the sort of thing you can do easily with vex, but am experimenting with sop solutions. Thanks Quote Link to comment Share on other sites More sharing options...
toadstorm Posted February 12, 2019 Share Posted February 12, 2019 (edited) Does it have to be happening on the source curve itself? I feel like having a separate set of points sliding along a fixed curve would be much easier to control. MOPs Move Along Spline could handle this fairly easily... http://www.motionoperators.com If you want to do it manually, what you probably want to do is create a duplicate set of disconnected points via the Add SOP or whatever, and then use xyzdist() to determine their relative positions along the parametric U of the curve. This would be done in a point wrangle, with your disconnected points in input 0 and the original curve in input 1: int posprim; vector primuv; float dist = xyzdist(1, @P, posprim, primuv); f@u = primuv.x; Then after that's been established, you can use a second wrangle with a parameter to add to that starting @u value and lock each point to the position along the curve that matches the new parametric U value: float add_u = ch("add_u"); float new_u = (f@u + add_u) % 1.0; // wrap points if they go past 1.0 vector new_P = primuv(1, "P", 0, new_u); @P = new_P; Edited February 13, 2019 by toadstorm Quote Link to comment Share on other sites More sharing options...
Noobini Posted February 13, 2019 Share Posted February 13, 2019 just scrub timeline vu_LineCrawl.hiplc 2 1 Quote Link to comment Share on other sites More sharing options...
spf987 Posted February 13, 2019 Author Share Posted February 13, 2019 Thanks toadstorm and Noobini, I also I found another example in the end which does it with one point wrangle. I'm trying to figure through all of the methods you've provided. Regarding toadstorm's method, I'm having trouble getting the second point wrangle working. Should the Run Over parameter be set to Primitives? If I leave it at Points then I'm getting an error, regarding undefined variables. Thanks again. Quote Link to comment Share on other sites More sharing options...
toadstorm Posted February 13, 2019 Share Posted February 13, 2019 here's an actual .hip example. i'm also grabbing N and up from the curve, so if you were instancing geometry on the points, they'd follow the curvature. slide_along_curve_toadstorm.hiplc 2 Quote Link to comment Share on other sites More sharing options...
spf987 Posted February 13, 2019 Author Share Posted February 13, 2019 Hi Henry, Thank you so much! The polyframe is something I've used a lot in the past few weeks so at least that's something I'm familiar with. Although as I guessed, there is much power to be had from understanding VEX. Longer term goal. Quote Link to comment Share on other sites More sharing options...
zebra Posted August 27, 2021 Share Posted August 27, 2021 On 2/13/2019 at 3:49 AM, Noobini said: just scrub timeline vu_LineCrawl.hiplc Hello! Thanks for the file! Is there a way to do this only using VEX? Quote Link to comment Share on other sites More sharing options...
devostevo668 Posted October 5, 2023 Share Posted October 5, 2023 Hi Steven, you could use VEX to slide points along a line. Connect a line orientated along the z axis, connect a resample to it with "Curve U Attribute: curveu" ticked then an bang on an attribute wrangle set to Run Over: Points & following VEX. float posBias = getbbox_max(0)[0]; @posZ = fit(chramp("pos_bias", @curveu),1,0,1,posBias); @P.z = lerp(@posZ,@P.z,posBias); @P.z = @posZ; Promote your chramp & adjust the points using the slider values. You can group the middle points using a group by range & have it only affect that group so it wont move the end points. Enjoy! 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.