[Paraview] exporting VRML files with python script

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Jun 17 10:30:38 EDT 2010


Here's a sample script:

exporters = servermanager.createModule("exporters")
vrml = exporters.VRMLExporter(FileName="/tmp/foo.vrml")
vrml.View = GetActiveView()
vrml.Write()


Utkarsh



2010/6/17 Yann-Hervé Hellouvry <yannherve.hellouvry at gmail.com>:
> Hi everyone,
>
> I am a new user of Paraview and I'm quite interested in using Python script
> for Paraview
>
> My goal is to import VTK series files, apply a contour to all of them and
> finally export the contours in VRML format. This is my first script :
>
> #--------------------------------------------------
> from paraview.simple import *
>
> reader = servermanager.sources.LegacyVTKReader()
> reader.FileNames = [ "/.../1.vtk" , "/.../2.vtk" ]
> reader.UpdatePipeline()
>
> SetActiveSource(reader)
>
> aContour = Contour(Input = reader)
> aContour.ContourBy = "alpha1"
> aContour.Isosurfaces = [0.5]
>
> Show(aContour)
> Render()
>
> #from this point it doesn't work
> exporters = servermanager.createModule("exporters")
> VRMLExporter = servermanager.exporters.VRMLExporter( ? , FileName=
> "/.../output_1.vrml ")
> #--------------------------------------------------
>
> Can anyone help me, I'm totally lost with the export part ? (but if you see
> others problems please tell me!)
>
> Regards,
>
> Yann
>
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>


More information about the ParaView mailing list