Itoo Software Forum

Author Topic: Impossible cause of loop dependencies, or how to achieve ?  (Read 886 times)

Klonsemann

  • Jr. Member
  • **
  • Posts: 61
Impossible cause of loop dependencies, or how to achieve ?
« 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 ?

Dragan

  • Hero Member
  • *****
  • Posts: 1295
Re: Impossible cause of loop dependencies, or how to achieve ?
« Reply #1 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.



Klonsemann

  • Jr. Member
  • **
  • Posts: 61
Re: Impossible cause of loop dependencies, or how to achieve ?
« Reply #2 on: November 11, 2022, 09:07:46 AM »
Maybe its more clear with a screenshot. See the attached image.

Dragan

  • Hero Member
  • *****
  • Posts: 1295
Re: Impossible cause of loop dependencies, or how to achieve ?
« Reply #3 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)
 

Klonsemann

  • Jr. Member
  • **
  • Posts: 61
Re: Impossible cause of loop dependencies, or how to achieve ?
« Reply #4 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 ?
« Last Edit: November 14, 2022, 12:24:15 PM by Klonsemann »

Dragan

  • Hero Member
  • *****
  • Posts: 1295
Re: Impossible cause of loop dependencies, or how to achieve ?
« Reply #5 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


Klonsemann

  • Jr. Member
  • **
  • Posts: 61
Re: Impossible cause of loop dependencies, or how to achieve ?
« Reply #6 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....

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2828
Re: Impossible cause of loop dependencies, or how to achieve ?
« Reply #7 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
Paul Roberts
iToo Software

Klonsemann

  • Jr. Member
  • **
  • Posts: 61
Re: Impossible cause of loop dependencies, or how to achieve ?
« Reply #8 on: November 15, 2022, 12:15:12 PM »
Ah, i see. Thank you very much !  :)