Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: themaxxer on May 06, 2017, 07:12:51 PM

Title: random left and right
Post by: themaxxer on May 06, 2017, 07:12:51 PM
hello

I try to make curtains that are randomly left and right in different widths... http://c2n.me/3KbJG8o.png

I know I need to tell railclone to put the curtain sometimes left and sometimes right and then add the random width, but how? :)

thanks in advance
themaxxer
Title: Re: random left and right
Post by: Paul Roberts on May 08, 2017, 12:54:13 PM
Hi,

Thanks for contacting us.

To do this you can use a random number node and the Selector operator. Basically you need to create two states: one where the curtain is on the left, one where it is on the right. To randomly generate these states you can use the Random Number node with a Minimum value of 1 and a Maximum of 2, set to generate a new value for each spline.

(http://i.imgur.com/QSU0R0u.png)

This is wired to a Selector operator's Index property. In the first input you would add your curtains and in the second, an empty "null" segment. When the random number returns 1 you'll get a curtain, when it returns 2 you get nothing. Wire this to the Start input.

Then duplicate the Selector operator and swap the inputs so that the null segment is now in slot 1. Wire this to the End input. Now whenever 1 is returned you'll get a curtain on the left and a null on the right. And when 2 is returned you'll get a null on the left and a curtain on the right.


(http://i.imgur.com/hriL4Xl.png)

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

Many Thanks,

Paul
Title: Re: random left and right
Post by: Pierre on January 04, 2022, 11:58:32 AM
Hello,
I allow myself to reopen this old post that I tried to modify. I want the length of the segment to be between 1 and the maximum length of the spline. I modified the random parameters in this way but the length exceeds the maximum length of the spline. Can you explain to me why?
Regards
Pierre
Title: Re: random left and right
Post by: Paul Roberts on January 04, 2022, 01:01:33 PM
Hi Pierre,

The X Size property always expects a value that is measured in scene units. This means you need to convert your percentage values into scene units by multiplying them with the length of each sub-spline. You can do this with an expression as shown in the screenshot below.

(https://i.imgur.com/BcQKBk3.png)

I've attached an amended version of the scene file.

I hope that helps,

Paul
Title: Re: random left and right
Post by: Pierre on January 04, 2022, 03:45:53 PM
Thank you very much Paul, it helps me a lot; I I understood my mistake
Regards
Pierre

Title: Re: random left and right
Post by: BJ2494 on January 06, 2022, 03:23:40 PM
please for 3dsmax 2017
Title: Re: random left and right
Post by: Dragan on January 06, 2022, 03:31:02 PM
.
Title: Re: random left and right
Post by: Paul Roberts on January 06, 2022, 03:32:35 PM
Thanks Dragan - saved me a job  :)