Instead of <span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">exporters.</span><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">X3DExporter </span>try to use <span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">exporters.</span><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">X3DExporterBinary.</span><div>
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br></span></div><div>Seb<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 14, 2012 at 7:19 AM, Andrea Beck <span dir="ltr"><<a href="mailto:beck@iag.uni-stuttgart.de" target="_blank">beck@iag.uni-stuttgart.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everyone, hi Sebastien,<br>
I have a follow-up question about the exporting of X3D files via python. I noticed that the X3DExporter (see code below) works fine, but creates only ascii- X3D files, not the binary ones (*.X3Db). The binary export is available through the GUI, so I'm pretty sure there must a python way of doing it. I tried some obvious first guesses (renamed exporters.X3DExporter(<u></u>FileName="foo.x3d") to exporters.X3DBinaryExporter(<u></u>FileName="foo.x3d") for example ) , but couldn't find a way to do it. Is there some easy way to export as binary x3d, instead of ascii?<br>
<br>
Thanks for reading, best regards<span class="HOEnZb"><font color="#888888"><br>
Andrea</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
Sebastien Jourdain wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi guys,<br>
<br>
the solution is as follow:<br>
<br>
from paraview.simple import *<br>
exporters=servermanager.<u></u>createModule("exporters")<br>
source=Cone()<br>
view = GetActiveView()<br>
Show(view)<br>
render=Render()<br>
x3dExporter=exporters.<u></u>X3DExporter(FileName="foo.x3d"<u></u>)<br>
x3dExporter.SetView(view) # <===== NEW LINE<br>
x3dExporter.Write()<br>
<br>
The reason for that is SetView and Write are not Proxy properties but<br>
local methods on the current proxy implementation. Therefore, you must<br>
call them as is.<br>
<br>
Seb<br>
<br>
On Wed, May 9, 2012 at 3:28 PM, <<a href="mailto:shpatric@vt.edu" target="_blank">shpatric@vt.edu</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
I too have this issue. I did find that View and Write attributes of<br>
X3DExporter were removed from the<br>
ParaViewCore/<u></u>ServerImplementation/<u></u>Resources/utilities.xml but removing View<br>
does work but does not write the file.<br>
<br>
The updated python script looks like:<br>
<br>
<br>
from paraview.simple import *<br>
exporters=servermanager.<u></u>createModule("exporters")<br>
source=Cone()<br>
view = GetActiveView()<br>
Show(view)<br>
render=Render()<br>
x3dExporter=exporters.<u></u>X3DExporter(FileName="foo.x3d"<u></u>)<br>
x3dExporter.Write()<br>
<br>
If source, view, or render are added to the x3dexporter constructor such as<br>
<br>
x3dExporter=exporters.<u></u>X3DExporter(source,FileName="<u></u>foo.x3d")<br>
<br>
I get recursive errors:<br>
Exception exceptions.RuntimeError: 'maximum recursion depth exceeded' in<br>
<bound method X3DExporter.__del__ of <paraview.servermanager.<u></u>X3DExporter<br>
object at 0x2b8e69567f10>> ignored<br>
<br>
<br>
Hopefully this bug is fixed soon or someone with knowledge can provide the<br>
correct way to use it.<br>
<br>
Thanks,<br>
Pat<br>
<br>
<br>
Quoting Andrea Beck <<a href="mailto:beck@iag.uni-stuttgart.de" target="_blank">beck@iag.uni-stuttgart.de</a>>:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey folks,<br>
I'm looking for a way to export X3D files with a python script for<br>
Paraview version 3.14.<br>
In v 3.8, what worked was:<br>
<br>
from paraview.simple import *<br>
exporters=servermanager.<u></u>createModule("exporters")<br>
Cone()<br>
Show()<br>
SetActiveView(GetRenderView())<br>
Render()<br>
x3dExporter=exporters.<u></u>X3DExporter(View=view,<br>
FileName="/home/iagbeck/demo/<u></u>foo.x3d")<br>
x3dExporter.Write()<br>
<br>
but that won't work in any version > 3.8 (see also bug tracker report<br>
here: <a href="http://vtk.org/Bug/view.php?id=12738" target="_blank">http://vtk.org/Bug/view.php?<u></u>id=12738</a>).<br>
<<a href="http://vtk.org/Bug/view.php?id=12738" target="_blank">http://vtk.org/Bug/view.php?<u></u>id=12738</a>><br>
<br>
<br>
Is there anyone who knows how to do that? Alternatively, if you have some<br>
code snippets about exporting / importing files (tecplot bins) lying around,<br>
please let me know!<br>
<br>
Thanks for the help!<br>
<br>
Andrea<br>
<<a href="http://vtk.org/Bug/view.php?id=12738" target="_blank">http://vtk.org/Bug/view.php?<u></u>id=12738</a>><br>
<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<u></u>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at:<br>
<a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/<u></u>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/<u></u>mailman/listinfo/paraview</a><br>
</blockquote></blockquote>
<br>
</div></div></blockquote></div><br></div>