When the deformer is initially placed onto the curve, you must compute it's 
U coordinate 'U' on the curve as well as the U coordinates of the bounding 
knots (u1, u2).  You then compute the ratio 'r' of the deformer's position 
within those bounds by performing a linear interpolation:

    r = ( (U - u1) / (u2 - u1) );

and store the result off to the side for later use (repeat per deformer). 
This works because the relationship is independent of the shape of the 
curve.

Every time there is an update to the curve you'll must exhume the ratio and 
perform a linear interpolation using the ratio and bounding knot U 
coordinates as input to compute the U coordinate of the deformer:

    U = ( ( r * u2 ) + ( (1 - r) * u1 ) );

The U coordinate can then be used to lookup the position coordinate and 
place the deformer on the curve.  The trick will be getting the proper knot 
indices and U coordinates as they will differ between linear and cubic 
curves, as well as open vs. closed curves.  ICE won't give you access to the 
details you need to pull this off for the general case, but you can 
definitely do it without much trouble in a scripted or C++ operator.

I have a prototype up and running in ICE (assuming an open cubic NURBS 
Curve), but the 'UV to Location' node is broken as the output position is 
offset by a fixed amount from where it's supposed to be.  It's also very 
finicky about the construction history of the curve.  Any manipulation of 
the control points or curve geometry results in flakey output.

I advise using a scripted or C++ operator for this particular problem.


Matt

------------------
Matt Lind
Animator / Technical Director
Softimage certified Instructor
matt.lind(at)mantom.net




Date: Tue, 12 Apr 2016 22:18:53 +0100
From: pedro santos <probi...@gmail.com>
Subject: Distribute between knots? Know the percentage position of a
knot?
To: Softimage Mailing List <softimage@listproc.autodesk.com>

Hi
How can I distribute deformers along a curve not by the total curve
percentage, but in between-knot percentage? This because when I stretch a
part of the curve I don't want all the deformers to be re-distributed, but
only the ones where where the curve length between their bounding knots
have changed. An using Curve Constrain uses the whole curve lenght.

Null constrained at 20% on a curve.
Below the duplicate of the setup but the curve was deform in such what the
null even passed the knot.
[image: Inline image 3]

In Green is the ICE attribute "PointU" which I thought it would give me
somethig I could work with but no...
No matter how I deform the curve that PointU is always the same. And
apparently there's no KnotU. If there were I guess I could work out
something with the bounding knots :/

[image: Inline image 4]

Basically I want to keep working with approximated curves, since it will be
used for deformation afterwards and splines aren't as smooth, but I see no
what to solve things in each section of the curve.

Let me know if there's a way I at least can Access the Knots' U or Position
:/

Thanks!
Pedro 

------
Softimage Mailing List.
To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.

Reply via email to