Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: Mishanin on December 03, 2019, 08:20:29 AM

Title: Expression quastion
Post by: Mishanin on December 03, 2019, 08:20:29 AM
Why this expression doesn't work in evenly distance or evenly count?
return if (XSplineMatID==1,3,8); - (evenly count)
return if (XSplineMatID==1,150,450); - (evenly distance)

How i can get distance between two corner?
Title: Re: MatID expression
Post by: Rokas on December 03, 2019, 10:27:01 AM
Evenly is special distance. It is calculated once and applied throughout the spline at regular intervals.

Hopefully this technique (https://forum.itoosoft.com/railclone-pro-(*)/evenly-specify-by-count/msg9020/#msg9020) can be a workaround in Your case.

Hope this helps.
Title: Re: MatID expression
Post by: Mishanin on December 06, 2019, 09:23:19 AM
I decided not to create a new theme

Can you explain why it works like this?
I compare the length of the segment with the length of the next segment, but in one segment it does not work correctly.
I suspect that it has something to do with the first vertex spline, but how to solve it i don't know
Title: Re: MatID expression
Post by: Rokas on December 06, 2019, 01:30:00 PM
Would You please attach Your max file.
Title: Re: MatID expression
Post by: Mishanin on December 06, 2019, 01:37:18 PM
Would You please attach Your max file.
attached below
Title: Re: MatID expression
Post by: Rokas on December 06, 2019, 01:44:46 PM
Thanks for swift reply.

There is no next segment after 4 to compare and determine what to place teapot or a box. So RC ends with comparison= false = Box.

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

Hope knowing this will help You create the style You want.
Title: Re: MatID expression
Post by: Mishanin on December 06, 2019, 01:52:01 PM
For a closed spline, wouldn't the next segment after 4 be 1?
Why does it work correctly if it is done on a rectangle spline?
Example attached
Title: Re: MatID expression
Post by: Rokas on December 06, 2019, 01:57:25 PM
add edit spline modifier and check which spline is first:

I attach You the image:
(https://i.imgur.com/QN8hOXT.png)

RC checks:
is 1st segment shorter than 2? YES = Teapot
is 2nd segment shorter than 3? NO = BOX
is 3rd segment shorter than 4? YES = Teapot
is 4th segment shorter than 5(?) NO= BOX

P.S. Idea to get 1st segment value added for consideration for next RC versions. I agree it would be useful in similar cases.
Title: Re: MatID expression
Post by: Mishanin on December 06, 2019, 02:08:22 PM
Too bad it doesn't loop the counter. Thanks
Title: Re: MatID expression
Post by: Mishanin on December 13, 2019, 09:14:07 PM
Is it possible to set one random, so that it would be the same for all arrays, but different for splines?
or in another way how to set a different random on subspline?
Title: Re: Expression quastion
Post by: Dragan on December 14, 2019, 03:02:18 PM
Easy wat to do it is using Selector (but it will not place the same segments on the same mat ID subspline).
For index just use random parameter set to Generate on Xspline section.




Title: Re: Expression quastion
Post by: Mishanin on December 16, 2019, 10:25:43 AM
Not exactly what I wanted.
below is a scene for example
Title: Re: Expression quastion
Post by: Dragan on December 16, 2019, 03:26:36 PM
Ah, You are targeting the height of the RC object, right?
If so... then...
Title: Re: Expression quastion
Post by: Mishanin on December 16, 2019, 03:41:21 PM
It should be exactly two arrays
Title: Re: Expression quastion
Post by: Dragan on December 16, 2019, 04:15:39 PM
Please, check the parameters.

Uncheck 'No. Blocks or Height' checkbox (RC will calculate height based on the Min/Max number of blocks)
Set Min & Max Block # to value 2
Title: Re: Expression quastion
Post by: Mishanin on December 16, 2019, 08:04:53 PM
Here it is extremely important that it was possible to pass the same generated random number to all arrays, but that this number was different in sub-spline
Title: Re: Expression quastion
Post by: Dragan on December 16, 2019, 08:44:00 PM
I hope we are on the right track.  ;)


Title: Re: Expression quastion
Post by: Mishanin on December 16, 2019, 09:47:51 PM
here it turns out that only the number on the corners is randomized, and that by default-is set. The height of the corners and the default should be equal on the same spline. I think, that here need to as something engage subsplineCounter or somehow take the z (height) of the resulting array. Then another array can appear and the height on one spline must be equal to the other arrays on that spline.
Sorry for my English
Title: Re: Expression quastion
Post by: Dragan on December 16, 2019, 10:26:58 PM
sorry, still can't understand what you are referring to  :(
Ok. Both Corrner and default are same size?
How do you want to drive the Z size?

 
Title: Re: Expression quastion
Post by: Dragan on December 16, 2019, 10:30:54 PM
It should be exactly two arrays

What part of the object needs to be two arrays?

Do you need that each part on the closed subspline has height based on two segments array (2, 6, 4, 10, 8 ... etc)?

Title: Re: Expression quastion
Post by: Mishanin on December 17, 2019, 09:46:18 AM
The problem is that the number obtained through the random was the same for all arrays, but different for sub-splines
Title: Re: Expression quastion
Post by: Dragan on December 17, 2019, 10:18:00 AM
The problem is that the number obtained through the random was the same for all arrays, but different for sub-splines

Your example?
Title: Re: Expression quastion
Post by: Mishanin on December 17, 2019, 10:29:51 AM
Yes, mine, only that it worked on two occasions is an accident
Title: Re: Expression quastion
Post by: Dragan on December 17, 2019, 10:35:25 AM
Please if you can provide some illustration what are you trying to do. Still can figure out  :) :o!