Custom fCurve?

Custom fCurve?

valhallen
Enthusiast Enthusiast
8,385 Views
6 Replies
Message 1 of 7

Custom fCurve?

valhallen
Enthusiast
Enthusiast

Is there any way I can generate say three points (vec2) and pass them into an fCurve?

Or even just a single point would work

Cheers

0 Likes
8,386 Views
6 Replies
Replies (6)
Message 2 of 7

calibrix
Advocate
Advocate

The fCurve is designed to work on scalar values. This makes sense as you consider that the evaluate fCurve is remapping a single value using a curve. This is very similar to using the remap value node in the hypershade or using the Vcoord on a ramp node. If you want to control a vec2. You could split the vector into its scalar components and drive each dimension using a separate fCurve.

0 Likes
Message 3 of 7

valhallen
Enthusiast
Enthusiast

Ah.  I have not explained this right.  I'm looking for a way to change a scalar fCurve based on outside data.   Basically calculating a curve based on a distance measurement.

Hope that makes more sense.

0 Likes
Message 4 of 7

calibrix
Advocate
Advocate

I don't think I quite understand what you intend. Are you just trying to calculate the distance between to points and feed that into an fCurve evaluation? "length(pos1-pos2)" the fCurve can cover any range including negatives. You can use the "change_range" node before the fCurve evaluate node to shift the range into easier to use values.

0 Likes
Message 5 of 7

valhallen
Enthusiast
Enthusiast

It's part of trying to implement catenary curves (again) ... I had a thought where I could grab the attachment point positions, run them through the catenary equation and get a y-displacement value out.  I could then build a nice 3 point bezier with the normalized y-displacement as the central point in the fCurve.

0 Likes
Message 6 of 7

calibrix
Advocate
Advocate

Oh I see. You want to generate the fCurve data manually via input points. I don’t think that’s possible. At least not in the way you would do that in the hypdershade in maya.  As the Value node only generates the fCurve datatype and the evaluate only allows for fCurve data inputs and the x values that it would read. I think you would be better off calculating more points for the catenary curves. Basically, you’d have to implement the sequential creation of points yourself. Back to the previous post about this topic, you’d implement catenary curves via the algorithm or you could build an approximation via an fCurve using a normalize curveU value. If you want both, you could create both algorithms and blend between them using a falloff. 

0 Likes
Message 7 of 7

valhallen
Enthusiast
Enthusiast

Yeah, have done the approximation already, works really really well 🙂 (thank you for that)valhallen_2-1613529046512.png


Considering what I am going to use this for (mostly a shadow-generator for a top-down project) this is probably going to be fine, but you know when your brain latches onto something and won't let go? Also nice to do things "properly" 😄

Generating the catenary curve is pretty simple, it's the sequentially generating the points that's hurting me atm ...

 

 

0 Likes