Try GetRenderView() instead of GetActiveView(). GetRenderView will get the active render view or create one if one does not already exist.<br><br>Pat<br><br><div class="gmail_quote">On Wed, Jun 8, 2011 at 12:16 PM, Nico Schlömer <span dir="ltr"><<a href="mailto:nico.schloemer@gmail.com">nico.schloemer@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">What do you mean by "v"?<br>
<br>
I took a wild guess and did<br>
<br>
============== *snip* ==============<br>
from paraview.simple import *<br>
reader = ExodusIIReader(FileName="solution.e")<br>
view = GetActiveView()<br>
view.UseOffscreenRenderingForScreenshots = 0<br>
Show()<br>
Render()<br>
WriteImage("test.png")<br>
============== *snap* ==============<br>
<br>
but merely got<br>
<br>
============== *snip* ==============<br>
Traceback (most recent call last):<br>
File "screenshot.py", line 12, in <module><br>
view.UseOffscreenRenderingForScreenshots = 0<br>
AttributeError: 'NoneType' object has no attribute<br>
'UseOffscreenRenderingForScreenshots'<br>
============== *snap* ==============<br>
<br>
Something seems to go wrong with GetActiveView().<br>
<br>
--Nico<br>
<br>
<br>
<br>
On Wed, Jun 8, 2011 at 6:04 PM, Utkarsh Ayachit<br>
<div><div></div><div class="h5"><<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>> wrote:<br>
> Try setting:<br>
><br>
> v.UseOffscreenRenderingForScreenshots = 0<br>
><br>
> before calling WriteImage.<br>
> Does that help?<br>
><br>
> Utkarsh<br>
><br>
><br>
> On Wed, Jun 8, 2011 at 12:01 PM, Nico Schlömer <<a href="mailto:nico.schloemer@gmail.com">nico.schloemer@gmail.com</a>> wrote:<br>
>> Yeah, render works fine.<br>
>><br>
>> --Nico<br>
>><br>
>><br>
>><br>
>> On Wed, Jun 8, 2011 at 6:01 PM, Utkarsh Ayachit<br>
>> <<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>> wrote:<br>
>>> Does simply calling "Render()" work?<br>
>>><br>
>>> Utkarsh<br>
>>><br>
>>> On Wed, Jun 8, 2011 at 11:22 AM, Nico Schlömer <<a href="mailto:nico.schloemer@gmail.com">nico.schloemer@gmail.com</a>> wrote:<br>
>>>> Hi,<br>
>>>><br>
>>>> everytime I call<br>
>>>><br>
>>>> WriteImage("test.png")<br>
>>>><br>
>>>> from on the python interface, no screenshot is created and instead the<br>
>>>> error message<br>
>>>><br>
>>>> ================== *snip* ==================<br>
>>>> X Error of failed request: BadRequest (invalid request code or no<br>
>>>> such operation)<br>
>>>> Major opcode of failed request: 0 ()<br>
>>>> Serial number of failed request: 67<br>
>>>> Current serial number in output stream: 69<br>
>>>> ================== *snap* ==================<br>
>>>><br>
>>>> is issued on the command line.<br>
>>>><br>
>>>> This is with ParaView 3.10.1 on GNU/Linux on xorg-server 1.10.1.<br>
>>>><br>
>>>> Anyone else with this?<br>
>>>><br>
>>>> Cheers,<br>
>>>> Nico<br>
>>>> _______________________________________________<br>
>>>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>>><br>
>>>> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>>><br>
>>>> Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
>>>><br>
>>>> Follow this link to subscribe/unsubscribe:<br>
>>>> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
>>>><br>
>>><br>
>><br>
><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
</div></div></blockquote></div><br>