Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

addition, subtraction, multiplication, and division produce incorrect results.

New Here ,
Sep 18, 2024 Sep 18, 2024

在 Value Processor 和 FX-Map 中,使用 While 循环和 Distance_vec2 进行累积计算后,加法、减法、乘法和除法会产生不正确的结果。

Bug Unresolved
434
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
7 Comments
New Here ,
Sep 18, 2024 Sep 18, 2024

In the Value Processor and FX-Map, after using While Loop and Distance_vec2 for cumulative calculations, addition, subtraction, multiplication, and division produce incorrect results.

Translate
Report
Adobe Employee ,
Sep 19, 2024 Sep 19, 2024

Hello,


Thank you for reaching out, as well as providing files for assessing the problem accurately.

 

The use of Random nodes in the loops means each will provide a different result, which is expected.

If you need to produce 4 random values then use them in the loops, and those values should remain constant, then you may store them in a variable before executing the loops – the 'before' is ensured by using a Sequence node. Then, retrieve that variable in both loops:

 

random-4-constant-in-loops.png

 

 

Also, I do not recommend using the same variables in both loops with no Sequence node to control when these variables should be used and reset.

 

In other words, you have two loops which both initialize   and  l  variables to 0 then update them on every iteration. However you cannot be sure about when these loops will be computed. The Sequence node is there to provide that control over flow and order or computations.

 

To illustrate my point, I have modified the function in two different ways so we can compare the results:

  1. Each loop use different variables;
  2. Each loop use the same variables, but a Sequence node makes sure one is entirely computed before the other.

 

Both methods provide the same result for the same random seeds:

 

loop-fix-comparison.png

 

 

I hope this is helpful!

 

Best regards.

Luca Giarrizzo | Quality Engineer, 3D & Immersive | Adobe
Translate
Report
New Here ,
Sep 19, 2024 Sep 19, 2024

Apologies, using the Random node is not my actual intention. My real need is to calculate the length differences between different segments of a curve. I am using a While loop and Distance_vec2 for cumulative length calculations along the curve. When performing addition, subtraction, multiplication, and division on the cumulative results, incorrect outcomes occur. If you need the original project, I can send it to you via email.

Thank you very much for your help!

368480452z15_0-1726736219899.png

 

Translate
Report
Adobe Employee ,
Sep 23, 2024 Sep 23, 2024

Hello,

 

Thank you for the details! Indeed, feel free to send me a project file to I can assess your use case and the unexpected result.

You may send them to me over direct message.

 

Best regards.

Luca Giarrizzo | Quality Engineer, 3D & Immersive | Adobe
Translate
Report
New Here ,
Sep 24, 2024 Sep 24, 2024

I used the method you provided, setting the values as variables using the 'set' node and performing addition, subtraction, multiplication, and division operations with the 'sequence' node in the 'last' input. As a result, the correct outcome is displayed in the 'Value Processor' node, but the calculations in the FX Map are still incorrect.

I have sent my project to you via private message.

368480452z15_0-1727165335888.png

 

Translate
Report
New Here ,
Sep 24, 2024 Sep 24, 2024

I attempted to send the project file to you via private message, but I couldn't find where to attach the file. So, I uploaded the project to Google Drive. Please retrieve it from there.

https://drive.google.com/file/d/1mhQDKN9YbUfC5X48gViu2eZtJRz3PwiD/view?usp=sharing 

Translate
Report
Adobe Employee ,
Sep 27, 2024 Sep 27, 2024
LATEST

Hello,

 

Thank you for sharing the SBS file. I have received it and will let you know of my findings early next week.

The SBS file is missing some bitmap dependencies, are they necessary for reproducing the issue?

 

Best regards.

Luca Giarrizzo | Quality Engineer, 3D & Immersive | Adobe
Translate
Report