Skip to content

Commit

Permalink
[vtk] correction of the texture serialization (#355)
Browse files Browse the repository at this point in the history
* [vtk] correction of the texture serialization

* Add timeout render to correctly display texture

* Add timeout render to correctly display texture (2)
  • Loading branch information
xavArtley authored and philippjfr committed Apr 2, 2019
1 parent 963f4ce commit 8ab6a57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions panel/models/vtk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ export class VTKPlotView extends HTMLBoxView {
renderer: this._rendererEl.getRenderer(),
dataAccessHelper,
})
sceneImporter.setUrl('index.json');
sceneImporter.onReady(() => {
this._rendererEl.getRenderWindow().render()
})
const fn = this._vtk.macro.debounce(() => setTimeout(
this._rendererEl.getRenderWindow().render,
100), 100)
sceneImporter.setUrl('index.json')
sceneImporter.onReady(fn)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion panel/pane/vtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def _vtksjs_from_render_window(self, render_window):

# Save texture data if any
for key, val in textureToSave.items():
_write_data_set(val, None, newDSName=key, compress=doCompressArrays)
_write_data_set(scDirs, val, None, newDSName=key, compress=doCompressArrays)

activeCamera = renderer.GetActiveCamera()
background = renderer.GetBackground()
Expand Down

0 comments on commit 8ab6a57

Please sign in to comment.