ParaView/Python/Loading and saving state: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
Line 24: Line 24:
>>> sph = Sphere()
>>> sph = Sphere()
>>> Render()
>>> Render()
>>> servermanager.SaveState("/Users/berk/pythonstate.pvsm")
>>> SaveState("/Users/berk/pythonstate.pvsm")
</source>
</source>

Revision as of 14:37, 2 March 2016

Loading state

<source lang="python"> >>> from paraview.simple import *

  1. Load the state

>>> LoadState("/Users/berk/myteststate.pvsm")

  1. The above will set of the render views loaded in the state file as the active view.
  2. Now render

>>> Render()

  1. 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>}

  1. 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>