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] correction of the texture serialization #355

Merged
merged 3 commits into from Apr 2, 2019

Conversation

xavArtley
Copy link
Collaborator

fixes : #350

However when renderding the vtkjs panel the texture does not appear unless an interaction is done
I tried to export the vtkjs file into the official scene explorer (https://kitware.github.io/vtk-js/examples/SceneExplorer.html) and the same issue arise

ezgif com-video-to-gif (5)

May be we need to open an issue on the main repo

@codecov-io
Copy link

codecov-io commented Apr 1, 2019

Codecov Report

Merging #355 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #355   +/-   ##
=======================================
  Coverage   86.99%   86.99%           
=======================================
  Files          88       88           
  Lines        7746     7746           
=======================================
  Hits         6739     6739           
  Misses       1007     1007
Impacted Files Coverage Δ
panel/pane/vtk.py 30.32% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 963f4ce...67b90c4. Read the comment docs.

@jourdain
Copy link

jourdain commented Apr 1, 2019

I guess a call to render is missing when images have been downloader+decoded and connected to the pipeline. You could solve that issue, by triggering a render() call via a timeout.

@xavArtley
Copy link
Collaborator Author

How long should be the timeout?

I guess a call to render is missing when images have been downloader+decoded and connected to the pipeline. You could solve that issue, by triggering a render() call via a timeout.

@jourdain
Copy link

jourdain commented Apr 1, 2019

Can you point me to the section of code that do the loading. I might be able to provide a better solution than a timeout with a more appropriate callback.

Otherwise you can simply do:

setTimeout(rw.render, 100);
setTimeout(rw.render, 500);
setTimeout(rw.render, 1000);

@xavArtley
Copy link
Collaborator Author

@jourdain
Copy link

jourdain commented Apr 1, 2019

The onReady will be called several time (on for each dataset) so this could be good.
The setURL also return a promise, although image loading/decoding is indeed trickier to properly capture when everything is ready.

Can you try that?

const fn = macro.debounce(() => setTimeout(this._rendererEl.getRenderWindow().render, 100), 100);
sceneImporter.setUrl('index.json').then(fn);
sceneImporter.onReady(fn);

@xavArtley
Copy link
Collaborator Author

Uncaught (in promise) TypeError: Cannot read property 'then' of undefined
at Object.callback (:663:57)
at VM57184 vtk.js:7

setUrl return undefined apparently. However if I use just

const fn = macro.debounce(() => setTimeout(this._rendererEl.getRenderWindow().render, 100), 100);
sceneImporter.setUrl('index.json')
sceneImporter.onReady(fn);

it seems to work

@jourdain
Copy link

jourdain commented Apr 1, 2019

Great!

@banesullivan
Copy link
Contributor

This is awesome, thanks @xavArtley!

Once this is merged could there be a release staged for panel? As soon as this is available on conda, I could update all of these examples and get the vtki examples on Binder to utilize all your work!

@banesullivan banesullivan mentioned this pull request Apr 1, 2019
@philippjfr
Copy link
Member

Once this is merged could there be a release staged for panel?

I'm happy to cut a dev release, a real release is still waiting on a new bokeh release which should be very soon.

@philippjfr philippjfr merged commit 8ab6a57 into master Apr 2, 2019
@philippjfr
Copy link
Member

Thanks for the fix @xavArtley!

@philippjfr philippjfr deleted the vtk_texture_correction branch September 9, 2019 16:38
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 this pull request may close these issues.

VTK textures broken
5 participants