Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: OU9561 on January 11, 2018, 05:50:28 PM

Title: Change scale and distance over spline
Post by: OU9561 on January 11, 2018, 05:50:28 PM
Hi!
I'm trying to distribute some playing cards along a spline, so that they get smaller as they travel through the spline.
I managed that by using an arithmetic Operator with this expression: return (XSplinePosition*100)+10; and a transform modifier with the 3 scale parameters exported. (the smaller cards will be scaled to 10%)

That works fine for the scale. The problem I have is that I want the cards to be superimposed a little one over another, so I don't use the Linear 1S in default, I have it set to evenly, and play with the left padding on the segment. This causes the problem you can see in the file, I have a lot of cards on the start of the spline but to few at the end.
The ideal thing would be to have the left padding set at 150cm at the start of the spline and at 0cm at the end. I tried doing another arithmetic operation with return XSplinePosition*150; but i don't know why it doesn't work.

Any help would be really apreciated!

Title: Re: Change scale and distance over spline
Post by: iToo on January 13, 2018, 09:51:39 AM
Hi, the problem is that Evenly positions are not affected by Padding (same with Start, End and Corner). Only Default segments are affected by it.

This happens because RailClone first computes the positions of Start/End/Corner and Evenly segments (according to their respective parameters)... and then the gaps between them are filled with Default segments.
Basically the position of Evenly segments depends only of the Generator->Rules->Evenly parameters.

This interesting case can be solved just using Default segments. I made the following changes:

- I use only Default segments.
- Left padding is computed as a percentage of the card width: return - Input1 * Input2 / 100;, where Input1 is the Overlap percentage, and Input2 is the card width.
- To compute the card width properly,  i moved the Transform->Padding after all other transformations, exported "X Size" from the last transform, and connected it as "Input1" in the Padding expression. In this way, "X Size" is the final size, once applied all scale transformations.

You can find the modified scene attached. I hope that helps.
Title: Re: Change scale and distance over spline
Post by: OU9561 on January 16, 2018, 05:10:59 PM
Thanks a lot! it works great