Is it possible to write a .glance file using Python? In the following image,I see that a scalar is selected in the drop down menu when the file is loaded. I believe this behaviour comes from a saved state in the glance file. I would like to know if it’s possible to define a .glance file that I can use to load several files using the same settings.
I would think so. But the glance file capture which url/file needs to be loaded with which settings. So you can not reuse a glance file with other files unless you rely on a template for the Python generator to properly generate several glance files, 1 for each file you want to load.
You can unzip the file from here to see the syntax of such file.
This is good. I am generating similar files using a vtk python package. Now the question is, Can I generate .glance file from vtk python package? If not then, I will have to swap the polydata in a sample glance file. Is that correct?
Is there a schema for state.json files?
No defined schema but mostly match source/representation/view logic with props values of the various proxies.
Hi @jourdain,
Is there a class in vtk that writes the props that we see in a glance(state.json) file?
This is the output of servermanager.getState()
but you don’t have a servermanager on your side and most of its content is driven by configuration files that dictate which properties that you expose from the vtk objects. So no class will handle that since is will be based on Glance configs. But generating it by hand should be trivial since only few props needs to be provided. All the defaults values can be ignored.
Thank you again for answering my questions on several threads @jourdain. It seems that replacing props in state.json using some script is the option I have left since there’s no other way to directly generate the source/dataset for a vtk/vtp file that I can directly use in state.json. Is my understanding correct?
yes, but you can use a template and just replace the part that you want to change (url, colorBy field)