tkeskita / BVtkNodes

Create and execute VTK pipelines in Blender Node Editor
GNU General Public License v3.0
117 stars 20 forks source link

colormapper negative values not colored correclty #99

Closed argapost closed 1 year ago

argapost commented 1 year ago

Hi again,

I try to put a custom range to my scalar from -5 to 5 and map the colours blue to red, as seen below: blender_screenshot

But I get the following result: blender_2

Whereas in Paraview I get: paraview

Do I do something wrong?

Thank you in advance!

tkeskita commented 1 year ago

Hi, does it help if you disable "GenerateCutScalars" on the vtkCutter node?

argapost commented 1 year ago

No, it doesn't seem to change anything :/

tkeskita commented 1 year ago

OK, thanks for testing and reporting! It seems that there is a bug, which turns negative data values into positive, I'll look into it.

tkeskita commented 1 year ago

Hi, I found and fixed a bug, can you please upgrade and try to see is it fixed for you? Thanks!

argapost commented 1 year ago

Hi, yes, it works! Thank you very much for your quick fix!

P.S. If I want to set the position and the colours of the colour ramp programmatically with blender python script or custom code, how would you suggest doing it?

tkeskita commented 1 year ago

Hi, great! Custom Code can't be used for editing color ramp elements. For that, you need to modify bpy.data.textures['your_texture_name'].color_ramp.elements. See colormap.py.

argapost commented 1 year ago

Perfect thanks I ll have a look!