[Paraview] help with a simple script?

Sebastien Jourdain sebastien.jourdain at kitware.com
Mon Nov 19 13:37:28 EST 2012


Hi Celia,

I think you found a bug, but I think I have something for you.
The following method should clear the view/layouts.

Seb

$ def clearLayout():
... pxm = servermanager.ProxyManager()

... for layout in GetLayouts():

...   pxm.UnRegisterProxy("layouts", layout[0], GetLayouts()[layout])



On Fri, Nov 16, 2012 at 2:28 PM, Celia Bremer <fuwsle at hotmail.com> wrote:

>
> Seb,
>
> When I say that the OpenGL window freezes, I mean the window is
> unresponsive in that I can't minimize it, and Windows task manager says
> "Not Responding". There's nothing in the window except for the purple
> background, even when there should be something, e.g. if I did Show(o)
> before calling Render(), where o is one of the pipeline objects.
>
> The thing I called layout windows, and I suppose it's really called
> something else (view layouts?), happens when I run the script from the
> Python shell that comes with the GUI. I'm referring to the tabs, "Layout
> #1", "Layout #2", etc. Here:
>
> >>> paraview version 3.14.1, Date: 2012-02-17
> from paraview.simple import *
> >>> GetLayouts()
> {('ViewLayout1', '275'): <paraview.servermanager.ViewLayout object at
> 0x0000000010FB4748>}
> >>> servermanager.LoadState("testpipeline.pvsm")
> >>> GetLayouts()
> {('ViewLayout1', '275'): <paraview.servermanager.ViewLayout object at
> 0x0000000010FB4748>, ('ViewLayout5', '2353'):
> <paraview.servermanager.ViewLayout object at 0x0000000010FB47B8>}
> >>> servermanager.LoadState("testpipeline.pvsm")
> >>> GetLayouts()
> {('ViewLayout1', '275'): <paraview.servermanager.ViewLayout object at
> 0x0000000010FB4748>, ('ViewLayout5', '3972'):
> <paraview.servermanager.ViewLayout object at 0x0000000012EC3240>,
> ('ViewLayout5', '2353'): <paraview.servermanager.ViewLayout object at
> 0x0000000010FB47B8>}
>
> This happens even if I use an empty state file, i.e. what I get when I
> open Paraview GUI, save state, save as empty.pvsm. If I load this state
> from the GUI, it opens in the original layout window, ViewLayout1, without
> any craziness. If I open it from the shell as above, the first tab splits
> into 2 views, the right view looks all weird (attached), a new tab opens
> and the state file is loaded into a second tab. If I load the state file
> again, then the second tab splits like the first (and if there was any
> content, it stays on the left hand side), a third tab opens, and the
> content shows up in the third tab. And so on. The names of these new tabs
> depend on the state file (above: 1 5 5, it might be 3 1 3 3, or if I use an
> empty state file, then it's 1 1 1 1), so I don't know what's the deal with
> that, but as long as I can close them before moving on to the next state
> file, I don't think it'll cause problems.
>
> Celia
>
> ________________________________
> > Date: Fri, 16 Nov 2012 13:40:36 -0500
> > Subject: Re: [Paraview] help with a simple script?
> > From: sebastien.jourdain at kitware.com
> > To: fuwsle at hotmail.com
> > CC: dave.demarle at kitware.com; paraview at paraview.org
> >
> > Hi Celia,
> >
> > I'm not sure to follow what you mean by "it freezes" and "new layout
> window".
> >
> > When you render something from Python, the window is not interactive,
> > so maybe that's what you call freeze. And you need to manually call
> > Render() to update its content.
> > Regarding the layout window, I don't really have a clue what that could
> be.
> >
> > So I let you explain a bit more.
> >
> > Thanks,
> >
> > Seb
> >
> >
> > On Fri, Nov 16, 2012 at 1:21 PM, Celia Bremer
> > <fuwsle at hotmail.com<mailto:fuwsle at hotmail.com>> wrote:
> >
> > Thank you. That worked but I still have problems: as soon as the OpenGL
> > window opens to render, it freezes, even if all the objects are hidden.
> > I think I'll have to do it from the Python shell from PV instead. I
> > have just one more question.
> >
> > When I load a state using LoadState(), that automatically opens a new
> > layout window. If I open the same state file from the GUI, no new
> > window is opened, so I don't think it's a property stored in the state
> > file. If I'm going to loop through 60 state files, I imagine all these
> > windows would become a problem. How do I either close the window, or
> > prevent it from opening in the first place?
> >
> > Celia
> >
> > ----------------------------------------
> >> From: dave.demarle at kitware.com<mailto:dave.demarle at kitware.com>
> >> Date: Fri, 16 Nov 2012 10:52:45 -0500
> >> Subject: Re: [Paraview] help with a simple script?
> >> To: fuwsle at hotmail.com<mailto:fuwsle at hotmail.com>
> >> CC:
> > sebastien.jourdain at kitware.com<mailto:sebastien.jourdain at kitware.com>;
> > paraview at paraview.org<mailto:paraview at paraview.org>
> >>
> >>> from paraview import servermanager
> >>> from paraview.simple import *
> >>> servermanager.LoadState("test.pvsm")
> >>
> >> SetActiveView(GetRenderView()) #you are missing this
> >>
> >>> view = GetActiveView()
> >>> view.ViewTime
> >>>
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20121119/0da140cc/attachment-0001.htm>


More information about the ParaView mailing list