[Paraview] Paraview Python Script with PVFWrap
pat marion
pat.marion at kitware.com
Wed Jan 26 10:42:40 EST 2011
Hi Fabian,
Please remember to include the paraview mailing list when you reply.
What you report is a bug, but you can avoid it- when you open your openfoam
dataset you should check each block that you want to load *before you hit
apply for the first time*
The problem is the first time you load your data and click apply, paraview
sees a multiblock dataset containing only unstructured grid data, so it
creates an unstructured grid display. This display has properties related
to volume rendering, and these properties are recorded in the trace script.
Later you must have enabled more blocks, so that multiblock dataset now
contains unstructured grid and polydata. When the trace script is replayed,
paraview sees the unstructured grid and polydata datasets, so it creates a
geometry display instead of an unstructured grid display. The geometry
display lacks the volume rendering properties.
Pat
On Tue, Jan 25, 2011 at 2:33 PM, Fabian Braennstroem
<f.braennstroem at gmx.de>wrote:
> Hi to you both,
>
> I just checked it with 3.8.1... a new trace_state file. There I got theses
> error messages (one after another), each time I got the errro I just
> commented out the lines in the python file, which I attached (I attached the
> openfoam case, if you need it):
>
>
>
> >>>
> Traceback (most recent call last):
> File "<string>", line 198, in <module>
> File
> "/home/kitware/Kitware/ParaView-3.8.1/build/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",
> line 201, in __setattr__
>
> AttributeError: Attribute SelectedMapperIndex does not exist. This class
> does not allow addition of new attributes to avoid mistakes due to typos.
> Use add_attribute() if you really want to add this attribute.
> >>>
> Traceback (most recent call last):
> File "<string>", line 225, in <module>
> File
> "/home/kitware/Kitware/ParaView-3.8.1/build/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",
> line 201, in __setattr__
> AttributeError: Attribute ScalarOpacityUnitDistance does not exist. This
> class does not allow addition of new attributes to avoid mistakes due to
> typos. Use add_attribute() if you really want to add this attribute.
>
> >>>
> Traceback (most recent call last):
> File "<string>", line 232, in <module>
> File
> "/home/kitware/Kitware/ParaView-3.8.1/build/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",
> line 201, in __setattr__
> AttributeError: Attribute ScalarOpacityFunction does not exist. This class
> does not allow addition of new attributes to avoid mistakes due to typos.
> Use add_attribute() if you really want to add this attribute.
>
> >>>
> Traceback (most recent call last):
> File "<string>", line 241, in <module>
> File
> "/home/kitware/Kitware/ParaView-3.8.1/build/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",
> line 201, in __setattr__
> AttributeError: Attribute ExtractedBlockIndex does not exist. This class
> does not allow addition of new attributes to avoid mistakes due to typos.
> Use add_attribute() if you really want to add this attribute.
> >>>
>
> It works very nice, after commenting these lines out!
>
> Best Regards!
> Fabian
>
>
>
> On 01/24/2011 09:45 PM, pat marion wrote:
>
>> You are using 3.8.0, not 3.8.1. If you use 3.8.1 to generate the trace
>> script you will not receive these errors.
>>
>>
>> Your script can also be fixed by hand- editing test_trace.py and move
>> the lines at the very bottom modifying Slice1, Slice2 and Slice3.
>> Moving the lines up so they appear after the constructors of Slice1,
>> Slice2, and Slice3.
>>
>> Pat
>>
>> On Mon, Jan 24, 2011 at 3:08 PM, Fabian Braennstroem
>> <f.braennstroem at gmx.de <mailto:f.braennstroem at gmx.de>> wrote:
>>
>> Hi,
>>
>> thanks. I get this error message:
>>
>>
>> Traceback (most recent call last):
>> File "<string>", line 382, in <module>
>> File
>>
>> "/home/gcae504/HOME/Dissertation/simulation_calc/OpenFOAM/ThirdParty-1.7.x/platforms/linux64Gcc/paraview-3.8.0/lib/paraview-3.8/paraview/servermanager.py",
>> line 201, in __setattr__
>> "to add this attribute.")
>> AttributeError: Attribute SelectedMapperIndex does not exist. This
>> class does not allow addition of new attributes to avoid mistakes
>> due to typos. Use add_attribute() if you really want to add this
>> attribute.
>>
>> I attached two pictures (test.png is the one create manually and
>> test2.png the one create with the script) and the script. Thanks for
>> your help!
>>
>> Best Regards!
>> Fabian
>>
>>
>> On 01/24/2011 08:57 PM, pat marion wrote:
>>
>> Hi Fabian,
>>
>> Regarding your issue of python trace state not replicating your
>> paraview
>> state exactly, I believe both issues you quote (camera position
>> and cut
>> filter's slice property) have been addressed in the latest
>> version of
>> paraview. If not, can you list the steps required to repeat the
>> problem? I can't find bug reports for these issues, but below I
>> have
>> copied the git logs for the commits the addressed the issues.
>>
>> Pat
>>
>> commit f3f73df79fe4ca377297885c4c71bcba661b165d
>> Author: Pat Marion <pat.marion at kitware.com
>> <mailto:pat.marion at kitware.com> <mailto:pat.marion at kitware.com
>>
>> <mailto:pat.marion at kitware.com>>>
>>
>> Date: Tue May 18 14:50:17 2010 -0400
>>
>> BUG: Add method to disable the first render ResetCamera.
>>
>> Added python method
>> paraview.simple._DisableFirstRenderResetCamera()
>> and included it at the top of all generated trace scripts.
>> This is
>> tested by PythonSMTraceTest1 since I removed the extra
>> 'Render()'
>> call from the test which was there to work around the issue.
>>
>> commit d9119f6be4b10b97b18fc2a2d5232788363d3fc9
>> Author: Pat Marion <pat.marion at kitware.com
>> <mailto:pat.marion at kitware.com> <mailto:pat.marion at kitware.com
>>
>> <mailto:pat.marion at kitware.com>>>
>>
>> Date: Fri Apr 30 13:35:03 2010 -0400
>>
>> BUG: Group helper proxies with the proxy using the helper.
>>
>> For example, now 'my_slice.SliceType.Normal' is mapped to
>> my_slice
>> instead of the SliceType helper proxy. Now when you trace
>> state,
>> the helper proxy's properties are grouped with the parent
>> proxy.
>> Previously all helper proxy properties were listed at the very
>> end of the trace, and that was incorrect.
>>
>>
>> On Mon, Jan 24, 2011 at 2:39 PM, Fabian Braennstroem
>> <f.braennstroem at gmx.de <mailto:f.braennstroem at gmx.de>
>> <mailto:f.braennstroem at gmx.de <mailto:f.braennstroem at gmx.de>>>
>>
>> wrote:
>>
>> Hello,
>>
>> thanks for the info!
>> Is my impression correct, that in version 3.8.1 the python
>> trace
>> state process is not as 'complete' as using the old state
>> file approach?
>> For my case setup, e.g. there is not always the correct camera
>> position and the correct slices...
>>
>> Best Regards!
>> Fabian
>>
>>
>> On 01/24/2011 08:13 PM, David E DeMarle wrote:
>>
>> That page is ancient.
>>
>> I think PVFWrap was the predecessor to paraview.simple
>> which
>> since 3.6
>> is the standard way to do ParaView python scripting (see
>> python
>> trace).
>> The comments about paraview state files being too
>> verbose have been
>> addressed since then as well.
>>
>> Or did you mean something else?
>>
>> David E DeMarle
>> Kitware, Inc.
>> R&D Engineer
>> 28 Corporate Drive
>> Clifton Park, NY 12065-8662
>> Phone: 518-371-3971 x109
>>
>>
>>
>> On Mon, Jan 24, 2011 at 2:02 PM, Fabian Braennstroem
>> <f.braennstroem at gmx.de <mailto:f.braennstroem at gmx.de>
>> <mailto:f.braennstroem at gmx.de <mailto:f.braennstroem at gmx.de>>>
>>
>> wrote:
>>
>>
>> Hi,
>>
>> I just found this page and wonder, if this will be a
>> new
>> approach for python
>> scripting:
>>
>>
>> http://www.paraview.org/ParaView3/index.php/Visualization_Script_Examples#Paraview_Python_Script_with_PVFWrap
>>
>> In addition, there are comments about the VisIt
>> way... do
>> you plan something
>> like this!?
>>
>> Best Regards!
>> Fabian
>> _______________________________________________
>> Powered by www.kitware.com <http://www.kitware.com>
>> <http://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
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com <http://www.kitware.com>
>> <http://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
>>
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20110126/8aab340c/attachment-0001.htm>
More information about the ParaView
mailing list