jackassol Posted December 11, 2019 Share Posted December 11, 2019 I'd like to know the best way to use If Else type statements in Vex code. What I wanted to achieve: if( in the group name "inside") { @stiffness = 1; } else ( not in side the group name "inside") { @stiffness = 1000; } What's the correct vex code for this function Vex? I don't get this working. best jack Quote Link to comment Share on other sites More sharing options...
3dome Posted December 11, 2019 Share Posted December 11, 2019 (edited) while there are functions like inprimgroup() or inpointgroup(), whenever possible I like to use the shorthand @group_groupname syntax. So if you run over points and are looking for a pointgroup then your code would be if(@group_inside) { f@stiffness = 1; } else { f@stiffness = 1000; } Edited December 11, 2019 by 3dome 1 Quote Link to comment Share on other sites More sharing options...
LucaScheller Posted December 11, 2019 Share Posted December 11, 2019 (edited) Hi Jack, This should work: float @stiffness; int @group_inside; if(@group_inside==1) { @stiffness = 1; } else { @stiffness = 1000; } or in short: @stiffness = @group_inside==1?1:1000; Cheers, Luca Edited December 11, 2019 by LucaScheller 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.