Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: arch3d on February 18, 2022, 11:59:39 AM

Title: Expression for matID value
Post by: arch3d on February 18, 2022, 11:59:39 AM
Hello,
I would like to ask you for quick help. I hate condition expression and I never know how to use it :(
I have L1S with fixed ID's
Now i would like to offset Generator from spline using expression
If matID=3 would be offset defined as Input1 else  Input 2 would define offset

Many thanks for help
Michal
Title: Re: Expression for matID value
Post by: Dragan on February 18, 2022, 12:04:43 PM
Switch Arithmetic node to Expression and type:

return
if(XSplinematID==3,input1,input2);
Title: Re: Expression for matID value
Post by: arch3d on February 18, 2022, 12:08:04 PM
Thx, now i know where i made mistake:)
Title: Re: Expression for matID value
Post by: Dragan on February 18, 2022, 12:14:28 PM
But I`m not sure this will work on General Y Offset. I think there were issues about this because of offsetting spline under the hood. I don't have Max at the moment to check it out.

If this won't work you can try adding transform and expose Y/Z Translation parameter (depending on your generator orientation) and use it as an offset.
Title: Re: Expression for matID value
Post by: arch3d on February 18, 2022, 12:33:32 PM
Exacly i found this Y Offset limitation
I tested as well

return
if(XSplinematID==3,input1, if(XSplinematID==4,input2,input1));


Your expression and nested second conditional works fine in X and Z Axis.

If General Y Offset wont work ill  transform segments
Title: Re: Expression for matID value
Post by: Dragan on February 18, 2022, 12:37:36 PM
Yeah, I know it  >:( :(

Well, you will have to use either Transform>Translate or some nesting depending on the complexity of your generator.
Title: Re: Expression for matID value
Post by: arch3d on February 18, 2022, 12:39:36 PM
I have nested L1S in L1S so its pretty complex - i testet segment translation - works fine

Thx again