Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/python
- import glob, string, os, commands
- from paraview.simple import *
- #help(servermanager)
- # vtp files are inside the local subdir DISPLAY
- files = (commands.getoutput("ls DISPLAY/data-*.vtp | grep -v contacts")).split()
- # process each file
- for filename in files:
- fullfn = commands.getoutput("ls $PWD/" + filename).replace('/','\/')
- fn = filename.replace('DISPLAY/', '')
- #os.system("cp ../dem_git/addons/paraview_state.pvsm tmp.pvsm")
- os.system("cp ~/Desktop/state.pvsm tmp.pvsm")
- os.system("sed -i.bck 's/DATA.vtp/" + fullfn + "/1' tmp.pvsm") # replace first intance with full path
- os.system("sed -i.bck 's/DATA.vtp/" + fullfn + "/1' tmp.pvsm") # replace second intance with full path
- os.system("sed -i.bck 's/DATA.vtp/" + fn + "/1' tmp.pvsm") # replace third with just the filename path
- servermanager.LoadState("tmp.pvsm")
- pm = servermanager.ProxyManager()
- #reader = pm.GetProxy("sources",fullfn)
- #reader.FileNames = fullfn
- #reader.FileNameChanged()
- #reader.UpdatePipeline()
- SetActiveView(GetRenderView())
- Render()
- WriteImage(fn + "-image.png")
- os.system("rm -f tmp.pvsm")
- #servermanager.Finalize()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement