Align to Spline Xpresso
Xpresso – by: base80
January 29th, 2007
Sometimes things go horribly wrong. You want to align an object on a growing Sweep NURBS.
When you use the Align to Spline Tag you can have the following result.
The object is not synchronous with the growth, Grr!
The solution is to make an simple xpresso that replaces the Align to Spline Tag
Follow up:
My model is very simple to illustrate the case.
I have a Sweep NURBS with a free form spline in it. The Sweep NURBS “grows” from 0% to 100% in 90 frames.
I have a Sphere (called Target) following the spline with an Align to Spline Tag set from 0% to 100% in 90 frames.
And I have trouble…
The trouble is caused by the type of spline and the interpolation, but my design does not permit to modify those settings.
Ok lets get started. Delete the Align to Spline Tag.
Add an Xpresso tag.
Drag the Spline and the Sphere in the xpresso editor.
Now add a “Spline-Node” from the general xpresso nodes to the editor.
The node has 3 visible ports, on the left you have the object and Offset port, on the right you have the position port.
Connect the left Object port back to the right Object port of your Spline.
Connect the right Position port to the left Position port of the Sphere.
Click on the Spline node and go to the Attribute Manager
Now you can set the Offset from 0% to 100% in 90 frames.
AND, here it comes… check the “Use Natural Distribution”
Tadaa It should work fine now
Lets take this one step further. we want to make the object tangential to the spline.
Start by opening the Tangent port on the Spline node.
Don’t ask me why I do the following steps… it just works.
Add a Vector2Matrix node and a Matrix2HPB and connect them as in the following image
This will point your object in the direction of the spline.
Xpresso is like magic!
Enjoy!
Oh By the way, this xpresso makes it possible to go round and round and round… The Align to Spline Tag is limited to one full circle (100%)