Itoo Software Forum

Author Topic: Change multiple values with one Boolean Parameter  (Read 791 times)

suppenhuhn

  • Full Member
  • ***
  • Posts: 125
Change multiple values with one Boolean Parameter
« on: March 06, 2020, 04:55:45 PM »
    Hi!

    I'm trying to get it managed how to  trigger multiple changes within my RailClone object with only Boolean Parameter.

    By that bool-parameter i'd like to trigger:
    • Multiple Selector nodes to switch their index from 1 ( bool=false ) to 2 ( bool = true )
    • A Sequencenode  ( 2 Elements A + B ) order from A/B ( bool=false ) to B/A ( bool = true )
    • To "inverse" the bool for i.a turning on/off a object form object-on ( bool=false ) to object-off ( bool = true )
    • or instead of the point above: a conditional check when bool == true then turn off objects A, B, C and turn on objects D, E, F

    Best solution would be when the conditional operator could handle boolean inputs as well !!

    I'd appreciate any hint where i should look into or what tutorial should i check out ... or..or..or :)

« Last Edit: March 06, 2020, 05:16:54 PM by suppenhuhn »
iToo has probably the best support & community i know !!

I'm using it with Max 2019 & Vray 6

Dragan

  • Hero Member
  • *****
  • Posts: 1419
Re: Change multiple values with one Boolean Parameter
« Reply #1 on: March 06, 2020, 05:21:27 PM »
Hi
if I understand correctly, let's try this one for a start:




suppenhuhn

  • Full Member
  • ***
  • Posts: 125
Re: Change multiple values with one Boolean Parameter
« Reply #2 on: March 06, 2020, 05:57:43 PM »
Hi
if I understand correctly, let's try this one for a start:
You did !!
The arithmetic expression + sequence into a selector was the key!
Thank you very much  8)
iToo has probably the best support & community i know !!

I'm using it with Max 2019 & Vray 6

Dragan

  • Hero Member
  • *****
  • Posts: 1419
Re: Change multiple values with one Boolean Parameter
« Reply #3 on: March 06, 2020, 06:06:00 PM »
Glad to help.

suppenhuhn

  • Full Member
  • ***
  • Posts: 125
Re: Change multiple values with one Boolean Parameter
« Reply #4 on: March 06, 2020, 06:15:41 PM »
But one more question:
When i'd like to "inverse" the boolean value trying to use this expression i got a error:

Code: [Select]
if (Input1 == 0 ) {
  return
1;
}
if (Input1 == 1 ) {
  return
0;
}
iToo has probably the best support & community i know !!

I'm using it with Max 2019 & Vray 6

Dragan

  • Hero Member
  • *****
  • Posts: 1419
Re: Change multiple values with one Boolean Parameter
« Reply #5 on: March 06, 2020, 06:21:19 PM »
it should go like this:

RETURN
If(input1==0,1,0);

or

RETURN
if(input1==true,false,true);


suppenhuhn

  • Full Member
  • ***
  • Posts: 125
Re: Change multiple values with one Boolean Parameter
« Reply #6 on: March 06, 2020, 06:27:35 PM »
MERCI !!! Do i read it right:   if input1 is 0 -> return 1 else return 0

Would be awesome when the expressions could handle javascript code
« Last Edit: March 06, 2020, 06:31:56 PM by suppenhuhn »
iToo has probably the best support & community i know !!

I'm using it with Max 2019 & Vray 6

Dragan

  • Hero Member
  • *****
  • Posts: 1419
Re: Change multiple values with one Boolean Parameter
« Reply #7 on: March 06, 2020, 06:34:20 PM »
Yes, You are reading right.
Some useful documentation:
https://docs.itoosoft.com/railclone/style-editor/operators#Operators-Arithmetic