ParaView/Python/Loading and saving state

From KitwarePublic
< ParaView
Revision as of 20:51, 22 May 2009 by Berk (talk | contribs) (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 ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Loading state

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

  1. Load the state

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

  1. Make sure that the view in the state is the active one

>>> SetActiveView(GetRenderView())

  1. 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() >>> servermanager.SaveState("/Users/berk/pythonstate.pvsm") </source>