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

Updating to latest vtk.js version #108

Open
knopkem opened this issue Aug 21, 2020 · 9 comments · May be fixed by #131 or #155
Open

Updating to latest vtk.js version #108

knopkem opened this issue Aug 21, 2020 · 9 comments · May be fixed by #131 or #155

Comments

@knopkem
Copy link

knopkem commented Aug 21, 2020

First of all, great work, so far everything works very well. I'm toying with creating a sample viewer that consumes the react-vtkjs-viewport directly (which works now).
My only concern is that updating to the latest vtk.js version isn't currently possible (and how to handle such cases in the future).
When using the latest vtk.js (14.11.4 currently) there is one breaking change that creates an error when using together with this library: in View2D.js Ln 77: handle.rotateFromDirections(handle.getDirection(), normal);
Apparently the api has changed and rotateFromDirections is now in vtkMatrixBuilder.
Unfortunately I also have a problem using the new api, replacing with:
vtkMatrixBuilder.buildfromDegree().matrix.rotateFromDirections(handle.getDirection(), normal);
and including the vtkMatrixBuilder:
import vtkMatrixBuilder from 'vtk.js/Sources/Common/Core/MatrixBuilder';
compiles but I get scope issues with webpack later running the example:
Uncaught TypeError: vtk_js_Sources_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_19__.default.buildfromDegree is not a function
Here is my fork with the changes: https://github.com/knopkem/react-vtkjs-viewport
Thanks

@floryst
Copy link
Member

floryst commented Aug 21, 2020

vtkPaintWidget changed API slightly. You should no longer need the method updatePaintbrush, as vtkPaintWidget now handles the paintbrush orientation internally.

@manjebrinkhuis
Copy link

manjebrinkhuis commented Sep 23, 2020

As floryst was suggesting, would it be sufficient to just update the updatePaintbrush method? To modify anything only if rotateFromDirections exists? I've tested this with the newest vtk.js and have encountered no issues. I could create a PR if that's desired.

@FezVrasta
Copy link

I get this error when I try to import this library:

./node_modules/vtk.js/Sources/Filters/General/PaintFilter/PaintFilter.worker.js
ValidationError: Invalid options object. Worker Loader has been initialized using an options object that does not match the API schema.
 - options has an unknown property 'fallback'. These properties are valid:
   object { worker?, publicPath?, filename?, chunkFilename?, inline?, esModule? }
 - options.inline should be one of these:
   "no-fallback" | "fallback"

is this because I'm using vtk.js 15?

@floryst
Copy link
Member

floryst commented Dec 8, 2020

vtk.js v15 updates to webpack 5, and with it worker-loader options object changed. Assuming react-vtkjs-viewport is using the vtk dependency file, that shouldn't be happening. Can you print out the whole webpack config?

@tamaynard
Copy link

tamaynard commented Dec 12, 2020

As floryst was suggesting, would it be sufficient to just update the updatePaintbrush method? To modify anything only if rotateFromDirections exists? I've tested this with the newest vtk.js and have encountered no issues. I could create a PR if that's desired.

@manjebrinkhuis +1 for this. Would be appreciated to see this accepted as it's causing us some grief right now. If you don't have time at the moment however I can take it on myself.

@tamaynard
Copy link

tamaynard commented Jan 6, 2021

@Punzo @floryst or @JamesAPetts just wondering if there was any word on getting the PR approved. If there are any issues just let me know and I'll address them as best as I can.

@manjebrinkhuis
Copy link

Hi @tamaynard, sorry I didn't manage to do create the PR for this. Thanks for that!

@dougyau
Copy link

dougyau commented Oct 19, 2021

Additionally to the changes mentioned on this thread, the rendering profile must be included since v18.0.0

@hqdung99
Copy link

Please accept change, this issue open too long

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