Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

hyperforce

Weighted blending of curves / point positions?

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.

Share this post


Link to post
Share on other sites

Hey Erwin,

I don't really know in which context you wanted to have this, but in SOPs it can easily be done in a vopsop.

Let me know if the example in the attached file was what you were looking for ;).

Twan

WeightedCurves.hipnc

Share this post


Link to post
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.

Share this post


Link to post
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.

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