Itoo Software Forum

Author Topic: Expression evaluator  (Read 660 times)

Rokas

  • Sr. Member
  • ****
  • Posts: 401
Expression evaluator
« on: July 11, 2017, 02:04:39 PM »
I certainly didn't expect to see "OK" in value evaluation field.
This is big step backwards. Or how we are expected to see numeric results in this version?

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3076
    • iToo Software
Re: Expression evaluator
« Reply #1 on: July 11, 2017, 05:15:17 PM »
Use the "print" command instead. It lets you to print several values, as shown below.



Previously, we used the Max expressions evaluator, which just evaluates and returns one value.
Now we use the same engine of Forest Effects, which works as a language and opens new possibilities for next updates.

Carlos Quintero
iToo Software

Rokas

  • Sr. Member
  • ****
  • Posts: 401
Re: Expression evaluator
« Reply #2 on: July 11, 2017, 05:19:25 PM »
Use the "print" command instead. It lets you to print several values, as shown below.

Previously, we used the Max expressions evaluator, which just evaluates and returns one value.
Now we use the same engine of Forest Effects, which works as a language and opens new possibilities for next updates.

Thank You!
This is huge improvement then. I have to sleep on this info to sink in the possibilities.
« Last Edit: July 11, 2017, 05:25:37 PM by Rokas »

Rokas

  • Sr. Member
  • ****
  • Posts: 401
Re: Expression evaluator
« Reply #3 on: July 11, 2017, 07:11:23 PM »
Hi I continue this thread..
I found instances of new interpreter erroring me in these cases, and thus breaking old styles:
my old operation:
Code: [Select]
return Input1*(-1/2);
now should be:
Code: [Select]
return -Input1/2;
OR
return Input1*(-0.5);

even simplest
Code: [Select]
return Input*-1 is bad.

more examples:
Code: [Select]
was bad
real c= sqrt(2*(Input1)^2);
now good:
real c= sqrt(2*((Input1)^2));
« Last Edit: July 12, 2017, 08:14:40 AM by Rokas »

Rokas

  • Sr. Member
  • ****
  • Posts: 401
Re: Expression evaluator
« Reply #4 on: July 11, 2017, 07:11:34 PM »
Also more bugs:
1. If arithmetic has output connected- no printing in debug field;(
2 .For some reason variable e gives error
==============================
Compile error. Duplicated variable "e" at line 6:
==============================


iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3076
    • iToo Software
Re: Expression evaluator
« Reply #5 on: July 12, 2017, 01:15:27 PM »
Ok thanks, i'm checking it...
Carlos Quintero
iToo Software

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3076
    • iToo Software
Re: Expression evaluator
« Reply #6 on: July 12, 2017, 03:46:05 PM »
my old operation:
Code: [Select]
return Input1*(-1/2);
now should be:
Code: [Select]
return -Input1/2;
qrt(2*((Input1)^2));

We must check the other issues, but this specifically is due to the support for integer values:

Code: [Select]
return 1/2;

is evaluated as 0, because the numbers are considered integers. Just use this, to evaluate as float:

Code: [Select]
return 1.0/2.0;
Both Maxscript and Python work in this way, and Max expressions are the exception. For this reason, we choosed this approach.

I will check if it's possible to convert the RC2 expressions automatically to fix the constant values, but it seems difficult.

Carlos Quintero
iToo Software

Rokas

  • Sr. Member
  • ****
  • Posts: 401
Re: Expression evaluator
« Reply #7 on: July 12, 2017, 05:49:27 PM »
Thank You for an answer.
Well it breaks my old styles. So user caution is necessary converting RC2 -> RC3 styles. Note. Hope You can find a workaround.

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3076
    • iToo Software
Re: Expression evaluator
« Reply #8 on: July 14, 2017, 03:59:45 PM »
We had to release a quick update to fix a problem with Update Manager (RC 3.0.7), and i took the opportunity to include some fixes (i continue working on that):

"1*-1" now is evaluated correctly.
"^" operator now has higher precedence. This should works fine: 1*2^3, but this is wrong yet: 1^2^3 (use parenthesis for this case).

Carlos Quintero
iToo Software

Rokas

  • Sr. Member
  • ****
  • Posts: 401
Re: Expression evaluator
« Reply #9 on: July 14, 2017, 04:25:35 PM »
Thanx for update. My styles still doesn't perform as expected.

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3076
    • iToo Software
Re: Expression evaluator
« Reply #10 on: July 17, 2017, 10:53:01 AM »
1. If arithmetic has output connected- no printing in debug field;(
2 .For some reason variable e gives error
==============================
Compile error. Duplicated variable "e" at line 6:
==============================

1. I cannot reproduce this. Please can you upload a test scene ?
2. 'e' is a built-in constant:  2.71828. Same case as  'pi'

Thanks,
Carlos Quintero
iToo Software