Artelia / NIMPHS

Blender add-on. Numerous Instruments to Manipulate and Post-process Hydraulic Simulations (OpenFOAM, TELEMAC).
https://Artelia.github.io/NIMPHS
GNU General Public License v3.0
13 stars 2 forks source link

Generated volume sequences may contain negative values (due to remap) #6

Closed Failxxx closed 2 years ago

Failxxx commented 2 years ago

Short description

Some generated volume sequences come with negative values.

Current behavior

When generating a volume sequence, some generated files contain negative values. This could generate several issues when rendering these volumes. This can be generated by wrong data manipulations during remapping of point data.

Expected behavior

For safer rendering and avoid issues, it would be nice to avoid generating negative values in the the generated sequence.

Steps to reproduce

Not needed.

System information

Add-on: v0.4.0 Blender: 3.2.2 Python: 3.10.2 OS: Ubuntu 22.04.1 LTS

Logs and screenshots

See : https://developer.blender.org/T100714

I think this part of the code is causing the issue.

# Get point data and remap data
if remap[0] is None or remap[1] is None:
    data = remap_array(mesh.get_point_data(point_data))
else:
    data = remap_array(mesh.get_point_data(point_data), in_min=remap[0], in_max=remap[1])