ParaView/Python/Loading and saving state: Difference between revisions
From KitwarePublic
< ParaView
Jump to navigationJump to search
(New page: == Loading state == <source lang="python"> >>> from paraview.simple import * # Load the state >>> servermanager.LoadState("/Users/berk/myteststate.pvsm") # Make sure that the view in the ...) |
JPouderoux (talk | contribs) mNo edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
>>> from paraview.simple import * | >>> from paraview.simple import * | ||
# Load the state | # Load the state | ||
>>> | >>> LoadState("/Users/berk/myteststate.pvsm") | ||
# | # The above will set of the render views loaded in the state file as the active view. | ||
# Now render | # Now render | ||
>>> Render() | >>> Render() | ||
Line 25: | Line 24: | ||
>>> sph = Sphere() | >>> sph = Sphere() | ||
>>> Render() | >>> Render() | ||
>>> | >>> SaveState("/Users/berk/pythonstate.pvsm") | ||
</source> | </source> | ||
Back to [[ParaView/PythonRecipes]]. | |||
{{ParaView/Template/Footer}} |
Revision as of 18:36, 16 October 2018
Loading state
<source lang="python"> >>> from paraview.simple import *
- Load the state
>>> LoadState("/Users/berk/myteststate.pvsm")
- The above will set of the render views loaded in the state file as the active view.
- Now render
>>> Render()
- Get the list of sources
>>> GetSources() {('Sphere1', '5'): <paraview.servermanager.Sphere object at 0xaf80e30>, ('Shrink1', '11'): <paraview.servermanager.Shrink object at 0xaf80df0>, ('Cone1', '8'): <paraview.servermanager.Cone object at 0xaf80cf0>}
- Change the resolution of the cone and render again
>>> FindSource("Cone1").Resolution = 32 >>> Render() </source>
Saving state
<source lang="python"> >>> from paraview.simple import * >>> sph = Sphere() >>> Render() >>> SaveState("/Users/berk/pythonstate.pvsm") </source>
Back to ParaView/PythonRecipes.