Open tddaniel opened 5 years ago
I forked the project and change some stuff in record() function Tose may solve your problem (the last commit i did introduce wait between each screenshot for fine render) I didn't compiled it for windows so i can't confirm. https://github.com/3dsman/pptk
I get the same error periodically without the record function using one of the basic tutorials:
import numpy as np import pptk
s = np.linspace(0.0, 2 * np.pi, 1000)[None, :] t = np.linspace(-1.0, 1.0, 50)[:, None]
x = (1 + 0.5 t np.cos(0.5 s)) np.cos(s) y = (1 + 0.5 t np.cos(0.5 s)) np.sin(s) z = 0.5 t np.sin(0.5 * s) P = np.stack([x, y, z], axis=-1)
N = np.cross(np.gradient(P, axis=1), np.gradient(P, axis=0)) N /= np.sqrt(np.sum(N ** 2, axis=-1))[:, :, None]
v = pptk.viewer(P) v.attributes(0.5 * (N.reshape(-1, 3) + 1)) v.set(point_size=0.001)
@nigeljw1 try using v = pptk.viewer(P,debug=True)
it seemed to help as a temporary fix.
@3dsman Thanks I will give it a try this weekend to see if that fixes things.
In the mean time, as mention above, I did find that setting debug=True
when creating the viewer seems to fix it as well.
I guess that means that the stderr output on windows has issues when a pipe is used? As far as I can tell the debug flag only affects the following line in the viewer.py file
self._process = subprocess.Popen(
[os.path.join(_viewer_dir, 'viewer'), str(s.getsockname()[1])],
stdout=subprocess.PIPE,
stderr=(None if debug else subprocess.PIPE))
I haven't had time to look into why the stderr ouput being a pipe causes this issue and it might be a week or two until I can spend anymore time on it.
When I try and use the record method on windows I get this error after 52 frames.
I think it has to do with how many/how rapidly new tcp connections are being made to save the screen shots and windows not liking/handling things correctly. it works as long as I don't try and save more than 52 frames. I don't know about very much about sockets etc so any help is appreciated.
It works fine on my linux machine.
Minimal code to reproduce.