yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #20163
Re: [Question #682159]: output picture from saved results using saveSnapshot
Question #682159 on Yade changed:
https://answers.launchpad.net/yade/+question/682159
Status: Needs information => Open
gaoxuesong gave more information on the question:
I find that there is a delay for the window to render the image. So maybe the codes are not executed by the original order. The codes to snapshot the window may be executed before the window renders the image.
I find the debug sentence can be used to make them synchronization. The modified codes is as followings,
import os
from yade import qt
import pdb
path = os.getcwd()
os.mkdir(path+'/plot')
qtr = qt.Renderer()
qtr.bgColor = [1,1,1]
v = qt.View()
outpath = path+'/plot/'
for file in os.listdir(path):
if os.path.isdir(file):
continue
O.load(file)
pdb.set_trace()
v.saveSnapshot(str(O.time)[:4]+'.jpg')
When it pauses at the break point, just enter 'c' to make it continue.
--
You received this question notification because your team yade-users is
an answer contact for Yade.