Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VTK textures broken #350

Closed
banesullivan opened this issue Apr 1, 2019 · 1 comment · Fixed by #355
Closed

VTK textures broken #350

banesullivan opened this issue Apr 1, 2019 · 1 comment · Fixed by #355

Comments

@banesullivan
Copy link
Contributor

Looks like there is a typo in the VTK render window converter code when handling textures:

import vtki
vtki.set_plot_theme('document')
from vtki import examples

def display(p):
    import panel
    panel.extension('vtk')
    from panel.pane import VTK as panel_display
    return panel_display(p.ren_win)

# Load some sample data that will render with a texture
data = examples.load_globe()

p = vtki.Plotter(notebook=False, off_screen=True)
p.add_mesh(data)
p.show(auto_close=False)
display(p)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~/anaconda3/envs/dev/lib/python3.7/site-packages/IPython/core/formatters.py in __call__(self, obj, include, exclude)
    968 
    969             if method is not None:
--> 970                 return method(include=include, exclude=exclude)
    971             return None
    972         else:

~/anaconda3/envs/dev/lib/python3.7/site-packages/panel/viewable.py in _repr_mimebundle_(self, include, exclude)
    254         doc = _Document()
    255         comm = state._comm_manager.get_server_comm()
--> 256         model = self.get_root(doc, comm)
    257         if config.embed:
    258             embed_state(self, model, doc,

~/anaconda3/envs/dev/lib/python3.7/site-packages/panel/pane/base.py in get_root(self, doc, comm)
    185         doc = doc or _curdoc()
    186         if self._updates:
--> 187             root = self._get_model(doc, comm=comm)
    188         else:
    189             root = self.layout._get_model(doc, comm=comm)

~/anaconda3/envs/dev/lib/python3.7/site-packages/panel/pane/vtk.py in _get_model(self, doc, root, parent, comm)
    354             VTKPlot = getattr(sys.modules['panel.models.vtk'], 'VTKPlot')
    355 
--> 356         data = self._get_vtkjs()
    357         props = self._process_param_change(self._init_properties())
    358         model = VTKPlot(data=data, **props)

~/anaconda3/envs/dev/lib/python3.7/site-packages/panel/pane/vtk.py in _get_vtkjs(self)
    376             vtkjs = base64.b64encode(self.object.read()).decode('utf-8')
    377         else:
--> 378             vtkjs = self._vtksjs_from_render_window(self.object)
    379         return vtkjs
    380 

~/anaconda3/envs/dev/lib/python3.7/site-packages/panel/pane/vtk.py in _vtksjs_from_render_window(self, render_window)
    542         # Save texture data if any
    543         for key, val in textureToSave.items():
--> 544             _write_data_set(val, None, newDSName=key, compress=doCompressArrays)
    545 
    546         activeCamera = renderer.GetActiveCamera()

TypeError: _write_data_set() missing 1 required positional argument: 'colorArrayInfo'
@banesullivan
Copy link
Contributor Author

Fixed in #355

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant