Xpresso Tutorial – Align To Spline

Align to spline is no doubt an expression that most Cinema 4D artists will have used at some time or another. The problem with the built in expression is that it is clamped and you can only animate the position parameter from 0% to 100%. If you want the object to loop or wrap around the spline it is not so simple.

align to spline01

Align To Spline Xpresso

There are other solutions available within the application, you could use MoGraph and clone onto a spline. Then use the offset parameter. However in this tutorial, I show you how to build a loopable align to spline expression using just Xpresso. The advantage here is you can use this setup with the most basic install of Cinema4D and also the object is still in it’s original state as it hasn’t been passed through a generator.

align to spline 02

Align To Spline User Data

I show you how to include a tangential option and the addition of a pop-up menu to define the axis you would like to align.

Anyway enough of my waffle. Check out the tutorial below or click through and watch it over on the helloluxx channel on Vimeo


Xpresso Tutorial – Align To Spline

Author: admin

13 Comments

  1. Rovino
    Rovino On March 17, 2012 at 5:42 am Reply

    Built!! thanks Tim.
    Is it me or is this only on 1 audio channel? I don’t hear anything on the other channel.

    You kinda lost me on the align to spline object going into the align to spline object.. then I realized that the first “object” is actually the user Data from the Xpresso tag.

    Quick question regarding the modulo math node. (I understand its taking the remainder of the number, internally the math is being calculated from 0 to 1 and not what we think is 0 – 100%. So when you use modulo of 1 you’re getting the remainder of 1.N N being the remainder.) Heres my question.. that range of 0 – 1.. is that taking the full ranger mapper percent of 0% to 20,000%? meaning when you reach 1 on the math node, a re-start your loop, you’ve gone a full 20,000% through the range mapper?

  2. moebius
    moebius On March 19, 2012 at 9:03 pm Reply

    what is the tag CV-StopMotion doing? Sounds interesting…

    • Tim
      Tim On March 20, 2012 at 10:43 am Reply

      CV-StopMotion is a Python tag that was written for me by a very kind and talented member of the Maxon US team. Keep an eye on Cineversity as I believe that it will be offered there for members at some time in the near future. Until it is released I am not at liberty to divulge information on it’s function. I’m sure you can hazard a guess though…

  3. Robert
    Robert On March 21, 2012 at 1:59 am Reply

    How can I fix the rotation of my object on my spline as its going around. It seems that when i gets to a certain spot on my spline it does a little spin. I under stand that this is gimbals lock of some sort. How is this fixed.

    • Tim
      Tim On March 29, 2012 at 9:47 pm Reply

      @Robert You would need to add an up-vector to the setup to stop gimbal lock. There’s a Target preset in the Xpresso pool you might be able to adapt the setup to convert it to an up-vector. (Perhaps something for a later tutorial.)

  4. Nader
    Nader On May 5, 2012 at 12:10 pm Reply

    hello Mr. Tim

    my question
    how can i study xpresso
    i do have all tutorials and i bught all your dvds
    but i still can not understand it
    or how it work
    i can not control it
    i just can repeat yout examples in your tutorials .
    but i can not understand it an can not creat anything my by self .
    i just can watch example for something and just did it exactly . i even forget it after watching from first time

    so please i just want you to tell me how can i understand and study it good until i can control it and do any idea in my mind using xpresso tag ?

    thank you so much Mr Tim

  5. bradon
    bradon On May 26, 2012 at 2:44 am Reply

    great Job! the gimbal flip is a real problem though. I have been trying to include a second rail curve to define the up vector, but im not quite getting the results. perhaps a part 2 tutorial?

  6. Drew
    Drew On August 22, 2012 at 7:11 am Reply

    Hi Tim,

    I was wondering how I can add a rail in the xpresso for banking or upvector? Couldn’t figure it out.

    Thanks

    • Tim
      Tim On September 7, 2012 at 10:48 pm Reply

      Hi Drew, perhaps something for a future tutorial (sorry for the late reply, work is crazy busy).

  7. Gianni
    Gianni On October 13, 2012 at 6:38 am Reply

    Hi Tim,
    first of all, thanks for sharing knowledge.

    This tutorial is good for understand XPresso, but I don’t figure out why I should make all this stuff when I can easly use the modulo function of Range Mapper to drive the position of the Align To Spline tag (I just used it in my last little animation).

    There’s something I don’t get.

    Sorry for my poor english.
    Bye

  8. Serge Step
    Serge Step On December 17, 2013 at 2:46 am Reply

    Hi to all.., and especially Mr. Tim Clapham.
    Firstly, thank you for sharing your knowledge.., very thankful…
    Wanted to ask.
    1. You wrote that you do a tutorial or addition, how to fix a problem with the weird rotation of the object on the Spline. How can I do something to fix that? “Target” and “Constraint” tag’s don’t work here. How can I add up vector? I can’t understand why this is happening, maybe if the points on the spline somehow incorrectly rotated. It seems it does not depend on the type of spline.
    2. Can I somehow animate the rotation of the object? (optional)
    3. What can be done in cases where the spline path has a gaps (but spline combined to one whole, using the “Connect and Delite” command). For example, such splines “Sweep Nurbs” sees as a whole, but your rig and “MoSplaine” see as two separate..
    I hope I clearly explained.. ))
    Sorry for bad English.
    Maybe someone else can explain?
    Thank you.

    • admin
      admin On December 18, 2013 at 10:40 am Reply

      @serge Thanks for the message. Your questions all require quite in depth answers, I’m sorry but I don’t have time to go through these answers right now. Perhaps something for a future tutorial?

  9. Carl
    Carl On September 4, 2014 at 4:02 am Reply

    Can’t see the user data when i’m dragging my null to my expresso

Leave a Reply