Jump to content

Weighted blending of curves / point positions?


Recommended Posts

I'm trying to blend together several curves.

These curves have been deformed from a base curve, I wish to have these curves blend together in Y based on their weight attributes. Think of the snap to average point position function of the fuse node, but then with weight taken into account.

In its simplest form I have 2 or more points, that need to be replaced by a point in their weighted average position.

To clarify. here is an example:

Point 1 is at Y = -10 with 90% influence

Point 2 is at Y = 15 with 50% influence

Point 3 is at Y = 5 with 20% influence

Does anyone here know if there is a node that does this, or otherwise, what mathematical formula I need to use to solve this problem.

Link to comment
Share on other sites

Thanks Kim and Twan.

I need it to be able to blend between a variable range of curves so a simple hardwire won't work. I did find a mathmetical formula to do it with. Take the weighted offset of each curve/point. Add these weighted offsets together. Also add the weights together. Divide the sum of the weighted offset by the sum of the weight. And the value you get back is the weighted average.

I haven't worked much with chops so far, I need to have another look at those.

Link to comment
Share on other sites

np,

I did find a mathmetical formula to do it with. Take the weighted offset of each curve/point. Add these weighted offsets together. Also add the weights together. Divide the sum of the weighted offset by the sum of the weight. And the value you get back is the weighted average.

That is basically exactly what the vopsop does :P,

if you want a variable amount of curves, you will need to put it in a forloop and keep storing the positions and weights per curve to attributes with procedural names.

Then calculate the result with a vopsop with a forloop inside it to go over all the stored data. That would be the most stable solution I guess, though possibly a bit over-designed.

If you know the maximum number of curves is going to something like 5, you could also duplicate the vopsop 5 times for the 5 possibilities and simply feed them into a switch.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...