Itoo Software Forum

Author Topic: Expression for matID value  (Read 392 times)

arch3d

  • Sr. Member
  • ****
  • Posts: 281
    • arch3d.pl
Expression for matID value
« 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

Dragan

  • Hero Member
  • *****
  • Posts: 1419
Re: Expression for matID value
« Reply #1 on: February 18, 2022, 12:04:43 PM »
Switch Arithmetic node to Expression and type:

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

arch3d

  • Sr. Member
  • ****
  • Posts: 281
    • arch3d.pl
Re: Expression for matID value
« Reply #2 on: February 18, 2022, 12:08:04 PM »
Thx, now i know where i made mistake:)
« Last Edit: February 18, 2022, 12:09:39 PM by arch3d »

Dragan

  • Hero Member
  • *****
  • Posts: 1419
Re: Expression for matID value
« Reply #3 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.
« Last Edit: February 18, 2022, 12:26:16 PM by Dragan »

arch3d

  • Sr. Member
  • ****
  • Posts: 281
    • arch3d.pl
Re: Expression for matID value
« Reply #4 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
« Last Edit: February 18, 2022, 12:35:36 PM by arch3d »

Dragan

  • Hero Member
  • *****
  • Posts: 1419
Re: Expression for matID value
« Reply #5 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.

arch3d

  • Sr. Member
  • ****
  • Posts: 281
    • arch3d.pl
Re: Expression for matID value
« Reply #6 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