Jump to content

Slide multiple points along curve, like Carve does.

Recommended Posts

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.


Share this post

Link to post
Share on other sites

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 by toadstorm

Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites
On 2/13/2019 at 3:49 AM, Noobini said:

just scrub timeline


Hello! Thanks for the file! Is there a way to do this only using VEX?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now