Those error just means that you did not register the protocol that implement those RPC endpoints.
Hi, Sebastetien:
Can you teach me how to regiser one of the method?
Attached is my vtk_server.py and client.vue code? They are mainly copied from vtk.js remote examples on kitware website.
How do I register the method? In python code, or in java script code? Can you show me one example?
Many thanks.
vtk_server.py (5.7 KB)
HelloWorld.vue (2.1 KB)
I finally figure out what to do, will update shortly.
@Sebastien_Jourdain , @YaoDongcai :
Thanks for all your help, I finally figured out to make vtk.js remote rendering work.
1, As Sebastien said, I need to register those mothod, so I add one line of code at vtk_server.py
self.registerVtkWebProtocol(protocols.vtkWebPublishImageDelivery())
-
somehow vtk.js (kitware.github.io)](vtk.js) don’t have this line of code in vtk_server.py
-
I really suggest whether kitware can improve the online example especially for remote rendering( which need to have client and rendering code). Simply post a code really so difficult to beginner to start.
-
I know there is one example, but that is too complex for the beginner.
-
dmreagan/vtk-remote-render: A simple example of a ParaViewWeb remote renderer. (github.com), in my opnion is a good example. For beginner, can download, compile and run.
2, need to say sorry for @YaoDongcai , he post python code here last week, but I did not realize that code is different from kitware website example, after add this protocol, I still got error:
- .env\lib\site-packages\vtkmodules\web\protocols.py", line 488, in stillRender
reply[“memsize”] = reply_image.GetDataSize() if reply_image else 0
AttributeError: ‘str’ object has no attribute ‘GetDataSize’
3, then I changed the vtkModulelibary code as below:
then it works. @Sebastien_Jourdain , can you let me know my change of libary will had further consequence?
The vtk_server.py does have that line
The code has always been there and working.
It is as simple as it can be.
that is my fault, I got from vtk-remote-render/server/vtk_server.py at master · dmreagan/vtk-remote-render (github.com)
By visually look, I thought they are same. If I used the correct vtk_server.py at beginning, I can immediately fix the no attribute errror.
reply[“memsize”] = reply_image.GetDataSize() if reply_image else 0
AttributeError: ‘str’ object has no attribute ‘GetDataSize’
The repository dmreagan/vtk-remote-render is not maintained by us and is relying on a library that has been deprecated since 2019.