Itoo Software Forum

Author Topic: Transform segment along a spline  (Read 809 times)

Gabriel

  • Newbie
  • *
  • Posts: 2
Transform segment along a spline
« on: October 07, 2015, 01:09:54 AM »
Hello,

I was wondering if there is a way to transform the same segment along a path. For example I would like its scale to be 100% at start but to get gradually smaller by the end of the spline. I have tried playing around with the plug in but I haven't managed to have success.

Thanks in advance

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1609
Re: Transform segment along a spline
« Reply #1 on: October 07, 2015, 11:24:19 AM »
Hi Gabriel,

To do this you would need to use an expression that will rescale the object based on it's position along the spline. To do this follow these steps.

  • Create a new Transform operator and wire the it between the segment you wish to rescale and the generator
  • Right click on the Transform operator and export the Fixed Scale X,Y, and Z properties
  • Create a new Arithmetic node, wire it to the Transform  nodes exported scale parameters and set the mode to Expression
  • Create a Numeric node for the start scale value and wire it to the Arithmetic nodes 1st input
  • Create a second Numeric node and wire it to the Arithmetic node's second input. You will now have a graph like the image below. New nodes are shown in red

  • Finally we need to add the expression. In the Arithmetic node, open the expression editor and enter:

    (1-XSplinePosition)*Input1 + XSplinePosition*Input2

    This expression is using the segment's position along the base spline to gradually transition between the start value (Input1) and the end value (Input2). XSplinePosition returns a scalar between 0.0 for the start of the spline and 1.0 at the end, so it can be used as a multiplier to gradually increase [ XSplinePosition*Input2] and decrease [(1-XSplinePosition)*Input1] values. By adding the two halves of the equation together we get a transition from one state to the next.

I hope that helps, please see the attached file for this example.

Many thanks!

Paul


To learn more about expressions, check out Chapter 3 of our new RailClone guide.
Paul Roberts
iToo Software

Gabriel

  • Newbie
  • *
  • Posts: 2
Re: Transform segment along a spline
« Reply #2 on: October 08, 2015, 01:43:25 AM »
Oh I see! Thanks a lot for your help Paul.   :D


Yuriy Bochkaryov

  • Jr. Member
  • **
  • Posts: 51
    • https://www.behance.net/Bochkaryov
Re: Transform segment along a spline
« Reply #3 on: October 12, 2015, 04:44:20 PM »
Hello,
Is it possible to have more control points? Not only start and end, but some in the middle.
Thanks
Home - https://www.behance.net/Bochkaryov
Skype: hunter-3d
Mail – Hunter_H@Rambler.ru

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1609
Re: Transform segment along a spline
« Reply #4 on: October 12, 2015, 06:17:41 PM »
Hi,

Though it is possible, it's a little bit fiddly at the moment (see attached).



In future versions we hope to make this process simpler, possibly using transform markers placed along the spline.


Many thanks,

Paul
Paul Roberts
iToo Software

Yuriy Bochkaryov

  • Jr. Member
  • **
  • Posts: 51
    • https://www.behance.net/Bochkaryov
Re: Transform segment along a spline
« Reply #5 on: October 12, 2015, 06:23:53 PM »
thank you!
Home - https://www.behance.net/Bochkaryov
Skype: hunter-3d
Mail – Hunter_H@Rambler.ru

Yuriy Bochkaryov

  • Jr. Member
  • **
  • Posts: 51
    • https://www.behance.net/Bochkaryov
Re: Transform segment along a spline
« Reply #6 on: October 14, 2015, 02:07:20 PM »
Hi Paul,
I made some tests...
If start scale is higher than 30% - everything goes wrong
Please see the screenshot - http://clip2net.com/s/3oKF6o5
Home - https://www.behance.net/Bochkaryov
Skype: hunter-3d
Mail – Hunter_H@Rambler.ru

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1609
Re: Transform segment along a spline
« Reply #7 on: October 14, 2015, 03:27:50 PM »
Hi,

You're right, there was a mistake in the graph. The attached version should fix it.

Many thanks,

Paul
Paul Roberts
iToo Software