Itoo Software Forum

Author Topic: if condition  (Read 677 times)

RB2300

  • Newbie
  • *
  • Posts: 47
    • DEVconstruction
if condition
« on: February 12, 2021, 06:49:32 AM »
Please how can i write condition, i cant find anywhere any example :(

IF ( XSplineMatID> 10 && XSplineMatID!= 15 )

-------------
i am trying modify this :(

return
if(XSplineMatID>Input1,Input1,
if(XSplineMatID != 5,1,
0));

Thank you so much for help

Rokas

  • Hero Member
  • *****
  • Posts: 3324
Re: if condition
« Reply #1 on: February 12, 2021, 07:30:07 AM »
here is full example, You almost got it.

return if(XSplineMatID> 10 && XSplineMatID!= 15,1,2);


Rokas

RB2300

  • Newbie
  • *
  • Posts: 47
    • DEVconstruction
Re: if condition
« Reply #2 on: February 12, 2021, 08:15:24 AM »
thank you so much,it works perfect, i see... it was problem on my side...
Thank you so much Rokas for response

RB2300

  • Newbie
  • *
  • Posts: 47
    • DEVconstruction
Re: if condition
« Reply #3 on: February 14, 2021, 01:54:09 AM »
Hi Rokas,
Please i believe it is my fault but i dont know what is wrong regard programming.. But there is chance it is a bug.... Please could someone point where is problem please or it is bug?

The script just ignoring and do not foreach/while all sections of spline .... (what i think)

Thanks best regards P.

------------------
return
if (Input1>100 && Input2 < 200 , Input3,
if (XSplineMatID>0 && XSplineMatID < 10 , Input4,
0))
;

input1, input2 define on which IDspline will be object transofrmed object in our case it is on spline id "3" but unfortunately it doesn't work
The spline has two section 1st is id 133 and second spline section has id 3.
« Last Edit: February 14, 2021, 08:20:47 AM by RB2300 »

Dragan

  • Hero Member
  • *****
  • Posts: 1419
Re: if condition
« Reply #4 on: February 14, 2021, 04:56:06 AM »
Hi, can you downgrade the file to max2018 so I can take a look?
But as I can see from PrintScreen you are connecting the arithmetic output straight to the Segments exported parameters. Usually, this is not a good idea and I think RC should warn you about not doing that.
The first step will be to add the Transform node and export X/Y/Z Fixed Size.
Second, you are dealing with && conditions and more parameters should be taken into consideration. I cant tell just from the image. Although your Syntax should be fine.

If the first condition is true you can expect all block size to be the same (input3 value) through all the splineID since it will not check the second condition.
If the second condition is true you can expect a combination of Original Blok Size (Since one value will be 0) and block size for Input4 value.

 
« Last Edit: February 14, 2021, 05:07:25 AM by Dragan »

RB2300

  • Newbie
  • *
  • Posts: 47
    • DEVconstruction
Re: if condition
« Reply #5 on: February 14, 2021, 06:16:56 AM »
Hey Dragan you are right,
it works through transform how you mention,... interesting.... it seems that transform is separate function that goes through while/foreach... otherwise no

thanks I will test this stuff... I have with RC more problems in different situations... When i will have anything again black and white i will ask...

Please where can I suggest for add feature (permanently open "Style editor" through some button/check box....) I think this is really major stuff if you do complex stuff, then that loading 25sec is really nightmare. I have got also some scripts from other people and it seems everyone who is working in 3D industry then will face same problem and i dont think it is really difficult let us keep editor open if we really wish that one windows at least "just one window"

Best rergards Pavol and thanks for help me out
« Last Edit: February 14, 2021, 06:51:54 AM by RB2300 »

Rokas

  • Hero Member
  • *****
  • Posts: 3324
Re: if condition
« Reply #6 on: February 18, 2021, 08:08:16 AM »
Please where can I suggest for add feature (permanently open "Style editor" through some button/check box....) I think this is really major stuff if you do complex stuff, then that loading 25sec is really nightmare. I have got also some scripts from other people and it seems everyone who is working in 3D industry then will face same problem and i dont think it is really difficult let us keep editor open if we really wish that one windows at least "just one window"

Thanks for suggestion, I agree it would be useful feature to have style editor always open. However our style editor is not designed in that way and this can't be enabled easily.
We will investigate this in the future.

Anyway, upon opening Your file we found that You have been infected with 3dsmax virus.
Please read through this information.
Rokas