I was trying to setup a server with VTK and wslink and connect to it via vtk.js, but I am getting several errors in the web application. For example:
“TypeError(‘updateCamera() takes 5 positional arguments but 6 were given’)”
Is it possible that the Protocol, defined in vtk.js/Sources/IO/Core/ImageStream/DefaultProtocol.js is not compatible with the one in VTK/Web/Python/vtkmodules/web/protocols.py ?
If so: why is that, and is there a fix planned? Or did I use it wrong?
Thanks for reporting the issue. The fix is here but ideally if you need also to use a parallel camera, you will need to use the useCameraParameters option on the image stream which will push to viewport.camera.update.params RPC that does not exist but that you can implement this way minus the difference between VTK and ParaView since the code below is for ParaView.
@exportRpc("viewport.camera.update.params")
def updateCameraParamters(self, viewId, params, forceUpdate = True):
view = self.getView(viewId)
if 'focalPoint' in params:
view.CameraFocalPoint = params['focalPoint']
if 'viewUp' in params:
view.CameraViewUp = params['viewUp']
if 'position' in params:
view.CameraPosition = params['position']
if 'parallelProjection' in params:
view.CameraParallelProjection = params['parallelProjection']
if 'viewAngle' in params:
view.CameraViewAngle = params['viewAngle']
if 'parallelScale' in params:
view.CameraParallelScale = params['parallelScale']
if forceUpdate:
self.getApplication().InvalidateCache(view.SMProxy)
self.getApplication().InvokeEvent('UpdateEvent')
Hello Sebastien,
thank you for your quick reply and fix! I have no more errors in my client / server setup but something is still wrong. I have basically just taken the server script from the paraview example and tried to connect to it with the [vtk.js](http://vtk.js ImageStream example).
The mouse interactions are streamed correctly, but only white images are streamed to the client:
For every mouse click only one white jpeg is uploaded
On this note, I would like to draw attention to the questions asked by bekos in the support channel:
The reason I am trying to change from a paraview client to ImageStream is that it enables binary image transfers. But I would also like to know what your roadmap for paraviewweb and vtk.js looks like.