Itoo Software Forum

Author Topic: Uniform scale per segment.  (Read 1332 times)

IT1371

  • Full Member
  • ***
  • Posts: 187
Uniform scale per segment.
« on: December 06, 2016, 02:33:32 PM »
Lets assume I have a spline made of different ID (1,2,1,2,1,2...) segments.
And I need Railclone to place an object only when its ID 2, but it must be scaled proportionally along the Z and X axis. Y is not that important.

How do I make this? Scale and Adaptive does not seems to work.

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Uniform scale per segment.
« Reply #1 on: December 06, 2016, 04:15:29 PM »
Hi,

Thanks for the question. This is possible with a couple of simple expressions. As you've correctly identified, both scale and adaptive mode scale only on the X axis, so it is necessary to create our own scale mode that works on 2 or more axis. To do this you can use the variable XSectionLength to find the size of the current spline segment. Wire this to a new Transform Node's X Fixed Size input. You've now pretty much created your own scale mode.

To resize the other two axis we can work out the scale factor between the original size of the segment and the length of the spline section. To do this you would need a sum something like - (XSectionLength/Input1)*100 where input one is the X Size attribute of the segment. This can then be wired to the Fixed Scale input of either of the remaining two axis.



I've attached a sample file with this setup. I hope that helps, please let me know if you have any further questions.

Many Thanks,

Paul
Paul Roberts
iToo Software

IT1371

  • Full Member
  • ***
  • Posts: 187
Re: Uniform scale per segment.
« Reply #2 on: December 09, 2016, 10:13:33 AM »
Thank you, exactly what I needed :)