[Paraview] Python interface: ExportView does not accept parameters
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Mon Feb 2 12:23:29 EST 2015
This is indeed a bug. I've reported it here [1]. Attached script shows
how to overcome this issue in 4.3. You'll need to add the following
stub to your code. Note this is only a workaround. Once the bug is
fixed, one should not use this hack.
#-----------------------------------------------
# HACK: Overcomes a bug# 15298
conn = servermanager.ActiveConnection
misc = conn.Modules.misc
servermanager.createModule("exporters", misc)
#-----------------------------------------------
[1] http://www.paraview.org/Bug/view.php?id=15298
On Mon, Feb 2, 2015 at 10:11 AM, Elias Pipping
<elias.pipping at fu-berlin.de> wrote:
> Dear list,
>
> I'm trying to export vector graphics through paraview's python interface(*).
> To that end, from within paraview, I start a python trace, use the UI to
> export to an embedded postscript file (via File->Export scene), and stop the
> trace again.
> The relevant lines of the trace look something like this:
>
> renderView1 = GetActiveViewOrCreate('RenderView')
> ExportView('test.eps', view=renderView1)
>
> Now I can open a python interpreter, paste these lines and get the expected
> result. So far, so good.
>
> Now let me retrace the above steps: After selecting a location to save to,
> I'm presented with a setting of export options. In the above scenario, I
> left everything as-is. I can choose among "rasterize 3d geometry", "draw
> background", etc. (the latter is an advanced option).
>
> If I change those options, they're passed to ExportView, yielding a line
> like the following in the trace:
>
> ExportView('test.eps', view=renderView1, Drawbackground=0,
> Rasterize3Dgeometry=0)
>
> While saving from the UI continues to work even in this case, running the
> above from within the python interpreter does not. Here's what I get:
>
> File
> "[..]/ParaView-4.3.1-Linux-64bit/lib/paraview-4.3/site-packages/paraview/simple.py",
> line 1350, in ExportView
> SetProperties(proxy, **params)
> File
> "[..]/ParaView-4.3.1-Linux-64bit/lib/paraview-4.3/site-packages/paraview/simple.py",
> line 449, in SetProperties
> raise AttributeError("object has no property %s" % param)
> AttributeError: object has no property Drawbackground
>
> Neither the field Drawbackground nor Rasterize3Dgeometry is recognised.
>
> Is the python interface currently incomplete in this respect? Is this easily
> fixed or is there a workaround for this issue?
>
>
> Best regards,
>
> Elias Pipping
>
> (*) All of this concerns a paraview 4.3.1 binary for linux
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample.py
Type: text/x-python
Size: 980 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150202/405150e1/attachment.py>
More information about the ParaView
mailing list