[Paraview] ParaView + Python: WriteImage screenshots broken?

Nico Schlömer nico.schloemer at gmail.com
Wed Jun 8 12:16:19 EDT 2011


What do you mean by "v"?

I took a wild guess and did

============== *snip* ==============
from paraview.simple import *
reader = ExodusIIReader(FileName="solution.e")
view = GetActiveView()
view.UseOffscreenRenderingForScreenshots = 0
Show()
Render()
WriteImage("test.png")
============== *snap* ==============

but merely got

============== *snip* ==============
Traceback (most recent call last):
  File "screenshot.py", line 12, in <module>
    view.UseOffscreenRenderingForScreenshots = 0
AttributeError: 'NoneType' object has no attribute
'UseOffscreenRenderingForScreenshots'
============== *snap* ==============

Something seems to go wrong with GetActiveView().

--Nico



On Wed, Jun 8, 2011 at 6:04 PM, Utkarsh Ayachit
<utkarsh.ayachit at kitware.com> wrote:
> Try setting:
>
> v.UseOffscreenRenderingForScreenshots = 0
>
> before calling WriteImage.
> Does that help?
>
> Utkarsh
>
>
> On Wed, Jun 8, 2011 at 12:01 PM, Nico Schlömer <nico.schloemer at gmail.com> wrote:
>> Yeah, render works fine.
>>
>> --Nico
>>
>>
>>
>> On Wed, Jun 8, 2011 at 6:01 PM, Utkarsh Ayachit
>> <utkarsh.ayachit at kitware.com> wrote:
>>> Does simply calling  "Render()" work?
>>>
>>> Utkarsh
>>>
>>> On Wed, Jun 8, 2011 at 11:22 AM, Nico Schlömer <nico.schloemer at gmail.com> wrote:
>>>> Hi,
>>>>
>>>> everytime I call
>>>>
>>>>   WriteImage("test.png")
>>>>
>>>> from on the python interface, no screenshot is created and instead the
>>>> error message
>>>>
>>>> ================== *snip* ==================
>>>> X Error of failed request:  BadRequest (invalid request code or no
>>>> such operation)
>>>>  Major opcode of failed request:  0 ()
>>>>  Serial number of failed request:  67
>>>>  Current serial number in output stream:  69
>>>> ================== *snap* ==================
>>>>
>>>> is issued on the command line.
>>>>
>>>> This is with ParaView 3.10.1 on GNU/Linux on xorg-server 1.10.1.
>>>>
>>>> Anyone else with this?
>>>>
>>>> Cheers,
>>>> Nico
>>>> _______________________________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>>
>>>> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://www.paraview.org/mailman/listinfo/paraview
>>>>
>>>
>>
>


More information about the ParaView mailing list