[Paraview] Export X3D Files via Python >version 3.8
shpatric at vt.edu
shpatric at vt.edu
Wed May 9 15:28:25 EDT 2012
Hi,
I too have this issue. I did find that View and Write attributes of
X3DExporter were removed from the
ParaViewCore/ServerImplementation/Resources/utilities.xml but removing
View does work but does not write the file.
The updated python script looks like:
from paraview.simple import *
exporters=servermanager.createModule("exporters")
source=Cone()
view = GetActiveView()
Show(view)
render=Render()
x3dExporter=exporters.X3DExporter(FileName="foo.x3d")
x3dExporter.Write()
If source, view, or render are added to the x3dexporter constructor such as
x3dExporter=exporters.X3DExporter(source,FileName="foo.x3d")
I get recursive errors:
Exception exceptions.RuntimeError: 'maximum recursion depth exceeded'
in <bound method X3DExporter.__del__ of
<paraview.servermanager.X3DExporter object at 0x2b8e69567f10>> ignored
Hopefully this bug is fixed soon or someone with knowledge can provide
the correct way to use it.
Thanks,
Pat
Quoting Andrea Beck <beck at iag.uni-stuttgart.de>:
> Hey folks,
> I'm looking for a way to export X3D files with a python script for
> Paraview version 3.14.
> In v 3.8, what worked was:
>
> from paraview.simple import *
> exporters=servermanager.createModule("exporters")
> Cone()
> Show()
> SetActiveView(GetRenderView())
> Render()
> x3dExporter=exporters.X3DExporter(View=view,
> FileName="/home/iagbeck/demo/foo.x3d")
> x3dExporter.Write()
>
> but that won't work in any version > 3.8 (see also bug tracker
> report here: http://vtk.org/Bug/view.php?id=12738).
> <http://vtk.org/Bug/view.php?id=12738>
>
> Is there anyone who knows how to do that? Alternatively, if you have
> some code snippets about exporting / importing files (tecplot bins)
> lying around, please let me know!
>
> Thanks for the help!
>
> Andrea
> <http://vtk.org/Bug/view.php?id=12738>
>
More information about the ParaView
mailing list