Itoo Software Forum

Author Topic: Animating segments down  (Read 1088 times)

PixelWindChill

  • Newbie
  • *
  • Posts: 8
Animating segments down
« on: October 10, 2014, 09:37:16 PM »
Hay RailClone masters, Can someone point me to a tutorial that shows how to animated segments moving down into place but not to have them come in all at the same time. ie like a fence going into the ground but not all at the same time. So falling into place from the beginning of the spline to the end. Hope I am describing this right. Any direction would be great.

Thanks
Chris

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1551
Re: Animating segments down
« Reply #1 on: October 13, 2014, 11:55:30 AM »
Hi Chris,

Thanks for the interesting question. Attached is a possible solution that uses expressions to animate the segments moving into position based on their position along the spline. Here's the node tree:



In this example you keyframe the Counter value to create the animation. The Animation Distance numeric node sets the starting point for the segments on the Z Axis, and Time Offset allows you to control the pause before the next segment starts to animate.

To achieve this I've had to use a couple of expressions that find the segment's position along the spline (measured as a scalar value 0 -1) and multiply this by the offset to create the time delay.

Then in a second arithmetic operator there is an If statement to test to see if the current Counter value is greater than the value set by the time delay. If it returns true the the Animation distance is multiplied by 1 minus the amount the counter is greater than the time delay to create the animation! If the result is false it simply returns the Animation distance.

The second expression looks like this: if(Input1 > Input3, max(0,(1-(Input1-Input3))*Input2), Input2) Where Input 1 is the Counter, Input 2 is the Distance, and Input 3 is the time delay. Note too the Max() expression which prevents the segment's z value from going below 0, locking it to the spline.

I hope that helps, initially expressions can be tricky if you're new to them, but by examining with the attached file hopefully it'll all make sense. If you need further clarification on this or have any further questions please let me know.

Cheers,

Paul
Paul Roberts
iToo Software

harumscarum

  • Full Member
  • ***
  • Posts: 103
    • harumscarum's portfolio
Re: Animating segments down
« Reply #2 on: October 13, 2014, 02:41:35 PM »
wow! unbelievable what is possible with arithmetic expressions, but is there any manual for it?
as for me - i'm unfamiliar with any kind of programming so would be great to have just a basis which is necessary for RC expressions

PixelWindChill

  • Newbie
  • *
  • Posts: 8
Re: Animating segments down
« Reply #3 on: October 13, 2014, 03:33:10 PM »
Thanks Paul, going to give this a go this morning. I will let you know how it turns out.

PixelWindChill

  • Newbie
  • *
  • Posts: 8
Re: Animating segments down
« Reply #4 on: October 13, 2014, 03:54:41 PM »
Paul,
This is exactly what I wanted, so thank you so much!!!! I now need to understand how you did it ;D I agree with @harumscarum, I think this would make a great advanced tutorial for your site.

Thanks again, you guys rock!