Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: Klonsemann on November 10, 2022, 11:54:54 PM

Title: Impossible cause of loop dependencies, or how to achieve ?
Post by: Klonsemann on November 10, 2022, 11:54:54 PM
Is it possible to drive the X-Size of a nested L1S generator beeing calculated via the splines XVertexAngle ?
Title: Re: Impossible cause of loop dependencies, or how to achieve ?
Post by: Dragan on November 11, 2022, 07:29:28 AM
Hi,
If you can give us some more info or some example. It is difficult to understand what you are trying to achieve, but it is possible.


Title: Re: Impossible cause of loop dependencies, or how to achieve ?
Post by: Klonsemann on November 11, 2022, 09:07:46 AM
Maybe its more clear with a screenshot. See the attached image.
Title: Re: Impossible cause of loop dependencies, or how to achieve ?
Post by: Dragan on November 11, 2022, 09:58:35 AM
Hm, if you can share the scene file that would be helpful. (lower it to 2020 if you can)
 
Title: Re: Impossible cause of loop dependencies, or how to achieve ?
Post by: Klonsemann on November 14, 2022, 12:22:00 PM
The green marked "length" and "angle" are the results of the calculation. If you wire them to the segments x-size of "Debug" generator you can measure the values in the viewport.

Use the slidebar to see the calculation work on the animated spline.

The "stacked" x-size and "roof inner corner" x-rotation are set by hand to the needed values. When wireing the calculation, no geometry is generated.

Any suggestions on this ?
Title: Re: Impossible cause of loop dependencies, or how to achieve ?
Post by: Dragan on November 14, 2022, 02:32:54 PM
Hi
My son knows math but he is not around so either we wait for Paul or you can do it yourself because I can see you know trigonometry.

1. Add one more Transform after Stacked->Transform25 and expose Y Fixed Rotation (you can delete conditional). This will control the angle for the RED line.
2. Know you need to calculate the angle for the RED LINE vs Base

keep in mind that trigonometry is calculated in Radians so you have to use DegToRad and RadToDeg in calculations

Title: Re: Impossible cause of loop dependencies, or how to achieve ?
Post by: Klonsemann on November 15, 2022, 09:45:42 AM
...you can delete conditional...

No, i want that geometry to appear just in certain angles.

...you need to calculate the angle for the RED LINE vs Base...

As i said, this anlge is already calculated correct in the green marked "angle".

But it is not working when wired....
Title: Re: Impossible cause of loop dependencies, or how to achieve ?
Post by: Paul Roberts on November 15, 2022, 11:49:04 AM
Please see the attached for a possible solution.

In most cases the parameters for a generator cannot be controlled using generator attributes. Those values are interrogated just once before the generator builds. Since the X Angle of the corner is potentially different each time, it won't work. An exception is when a generator is nested. In this case you can use the attributes of the Generator to which the nested array is attached. In this example, I have changed it so that the length of the hips uses that approach.

To get the angle there's no need to use the generator's parameters, instead, you can use a Transform node to rotate the nested array.

I hope that helps,

Paul
Title: Re: Impossible cause of loop dependencies, or how to achieve ?
Post by: Klonsemann on November 15, 2022, 12:15:12 PM
Ah, i see. Thank you very much !  :)