VISTAS-IVES / pyvistas

VISualization of Terrestrial-Aquatic Systems
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Viz plugins that attempt to use None as nodata_value in shader uniform throws unhandled exception #70

Closed TaylorMutch closed 7 years ago

TaylorMutch commented 7 years ago

We should find a way to handle when None is passed to ShaderProgram.uniform* method.

MODIS dataset does not store a nodata value when read from the GeoTIFF data plugin, and when this layer is brought in to be used for coloring a terrain, the following unhandled exception occurs:

Traceback (most recent call last):
  File "C:/Users/taylo/Documents/pyvistas/source\vistas\ui\controls\gl_canvas.py", line 64, in OnPaint
    self.camera.render(*self.GetSize().Get())
  File "C:/Users/taylo/Documents/pyvistas/source\vistas\core\graphics\camera.py", line 134, in render
    self.scene.render(self)
  File "C:/Users/taylo/Documents/pyvistas/source\vistas\core\graphics\scene.py", line 48, in render
    obj.render(camera)
  File "C:/Users/taylo/Documents/pyvistas/source\vistas\core\graphics\mesh_renderable.py", line 38, in render
    self.mesh.shader.pre_render(camera)
  File "C:\Users\taylo\Documents\pyvistas\source\..\plugins\terrain_and_color\main.py", line 794, in pre_render
    self.uniform1f("minValue", self.min_value)
  File "C:/Users/taylo/Documents/pyvistas/source\vistas\core\graphics\shader.py", line 118, in uniform1f
    glUniform1f(self.get_uniform_location(name), value)
ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type
TaylorMutch commented 7 years ago

We likely can just fix this per viz plugin.

TaylorMutch commented 7 years ago

Fixed by #73.