Itoo Software Forum

Author Topic: HOW TO USE ‘OR’ AND ‘AND’ OF ‘IF’ CONDITIONAL STATEMENT IN EXPRESSION NODE ?  (Read 929 times)

cc8boy

  • Sr. Member
  • ****
  • Posts: 286
  • I'll do my best.Welcome to www.c7design.cn .
    • C7design
Hello developers of itoosoft,
How to use ‘OR’ and ‘AND’ of ‘IF’ conditional statement in expression node ?
Is any loop statements in expession node ? What language is based on this expession ? Javascript ?
I can’t find it in ‘railclone_documentation.pdf’.
Could you please show me some example about ‘SegmentXRole’ in expression node ?
I don’t understand how to use this ‘SegmentXRole’ value.
I can’t find any tutorial or example in this website or ‘railclone_documentation.pdf’.

Is it possible to print out some values (to debug) in the expression nodes ?
Could you please help me ?
MAX2014/RC 3.10 :'(
We are working hard in virtual effects in 3DSMAX. Welcome to our website in China.

Rokas

  • Hero Member
  • *****
  • Posts: 3324
Hi

OR is | operator
AND is & operator
More about arithmetic operator You can find in our documentation page.

There are no loop statements.

segmentxRole can be used on segments before passing them to macro, when in that macro it is used multiple times.
Example there is a macro in which the same segment is used 3 times- on start, end and in evenly.
On Top Level style editor, before passing this segment to the macro I have added this Z size modification:
Code: [Select]
return if(SegmentXRole==4, 50, 10);Which means, if segment is in evenly input, make it 50 units tall, if not- 10 units tall.



It is possible to print debug values with print command, but it wont always be super helpful all the time, especially when those statements include railclone parameters.
I generally like to change some segments Z size depending on the expression i am writing to get a sense of what is going on.

Hope this helps.
Rokas

cc8boy

  • Sr. Member
  • ****
  • Posts: 286
  • I'll do my best.Welcome to www.c7design.cn .
    • C7design
This is really help. Thank you very much Rokas.
We are working hard in virtual effects in 3DSMAX. Welcome to our website in China.

cc8boy

  • Sr. Member
  • ****
  • Posts: 286
  • I'll do my best.Welcome to www.c7design.cn .
    • C7design
Hi

OR is | operator
AND is & operator
More about arithmetic operator You can find in our documentation page.

There are no loop statements.

segmentxRole can be used on segments before passing them to macro, when in that macro it is used multiple times.
Example there is a macro in which the same segment is used 3 times- on start, end and in evenly.
On Top Level style editor, before passing this segment to the macro I have added this Z size modification:
Code: [Select]
return if(SegmentXRole==4, 50, 10);Which means, if segment is in evenly input, make it 50 units tall, if not- 10 units tall.



It is possible to print debug values with print command, but it wont always be super helpful all the time, especially when those statements include railclone parameters.
I generally like to change some segments Z size depending on the expression i am writing to get a sense of what is going on.

Hope this helps.
Did you mean if I leave the 'Start input'  and 'End input' empty (nothing connect to these two inputs)  of one Linear 1S generator, this 'segmentxRole' will not find the first and the last segments of the 'Defaut Input' ?
We are working hard in virtual effects in 3DSMAX. Welcome to our website in China.

Rokas

  • Hero Member
  • *****
  • Posts: 3324
Did you mean if I leave the 'Start input'  and 'End input' empty (nothing connect to these two inputs)  of one Linear 1S generator, this 'segmentxRole' will not find the first and the last segments of the 'Defaut Input' ?
No I have not meant that.
I meant that in this RailClone style if segment goes to generators evenly input, it gets scaled to 50 units high, if not- 10 units high.
So if You disconnect start and end inputs, You will have 3 tall boxes standing in the middle of the spline:
Rokas

cc8boy

  • Sr. Member
  • ****
  • Posts: 286
  • I'll do my best.Welcome to www.c7design.cn .
    • C7design
OK, Now I understand this 'segmentxRole' is for finding 'Start input'  and 'End input' segments not for finding the first segments and the last segments of 'default Input'.

Now I have very simple question. How to find the actual the first and the last of 'evenly input' or 'default input' in one section of the spline ?
Especailly the first and the last in the  'evenly input'.

I tried to analysis the macro named 'Scale final X seg'. It seems that it can only compare the length of the remain position of the segment to the size of the segment to judge if it is the end segment
Is there a straight forward way to find the first and the last default or evenly segment in one section ?
We are working hard in virtual effects in 3DSMAX. Welcome to our website in China.

Rokas

  • Hero Member
  • *****
  • Posts: 3324
Now I have very simple question. How to find the actual the first and the last of 'evenly input' or 'default input' in one section of the spline ?
Especailly the first and the last in the  'evenly input'.
I don't know.
Rokas