Itoo Software Forum

Author Topic: scale along path  (Read 541 times)

eqko

  • Newbie
  • *
  • Posts: 40
scale along path
« on: March 15, 2016, 11:54:16 AM »
I read a thread from 2013 where it wasn't possible.

Is it currently possible to have a segment scale smaller along the path.
so lets say the 1st segment at the start is 100% and the one on the end is 50% gradually getting smaller along the path.

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1517
Re: scale along path
« Reply #1 on: March 15, 2016, 01:02:34 PM »
Hi,

This is now possible using Expressions. RailClone has a function called XSplinePosition that returns the segments position along the spline. 0.0 represents a segment at the start of the spline and 1.0 a segment at the end. Using this we can control the scale of an object based on it's current position in the array. To do that:

- Wire the Segment to a Transform operator.
- Right click on the Transform operator and export the Z, Y and Z Fixed Scale parameters, or a whichever you wish to control.
- Create two new Numeric nodes, call the first Scale Start and the second Scale End.
- Wire them to a new Arithmetic node and set the operation to Subtract. This will give you the total amount the segments changes between the start and end of the spline.
- Create a second Arithmetic note and wire Scale Start to the first input. Wire the Arithmetic node created in the previous step to the second input.

- Change the mode of the new Arithmetic node to Expression, click Edit Expression and enter

Input1-(XSplinePosition*Input2)

Where Input1 is the starting scale and and Input2 is the total scale change between the start and end of the spline.
- Wire the arithmetic node to the Transform operator's scale inputs. The final graph will look like this:


I've also attached a file with this example so you can try it out. If you'd like to know more about expressions, parameters and attributes then this chapter of the Next Steps with RailClone guide can be useful.  I hope that helps, please let me know if you have any further questions.

Many Thanks!

Paul
Paul Roberts
iToo Software

eqko

  • Newbie
  • *
  • Posts: 40
Re: scale along path
« Reply #2 on: March 15, 2016, 01:57:02 PM »
thanks for the fast reply, works like a charm !