trying to create animation (following documentation)

Hello,
I am trying to reproduce an example from the documentation to create an animation. (Windows10, Anaconda python 3.6.10 h9f7ef89_2, sfepy 2020.2 py36h7725771_0 conda-forge)
Inside a Jupyter-notebook, I have done:
!copy c:\ProgramData\Anaconda3\lib\site-packages\sfepy\examples\diffusion\time_poisson.py . !c:\ProgramData\Anaconda3\python.exe c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\simple.py time_poisson.py -s
#everything OK #I can view each individual vtk #But I cannot create the animation
!c:\ProgramData\Anaconda3\python.exe c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\postproc.py c:\ProgramData\Anaconda3\Scripts\NOTEBOOKS\cylinder.??.vtk -a mov
Traceback (most recent call last): File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\postproc.py", line 513, in <module> main() File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\postproc.py", line 503, in main view = view_file(filenames, filter_names, options) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\postproc.py", line 281, in view_file domain_specific=options.domain_specific) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\postprocess\viewer.py", line 919, in call_mlab offscreen=self.offscreen) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\postprocess\sources.py", line 68, in create_file_source return GenericFileSource(filename, **kwargs) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\postprocess\sources.py", line 212, in __init__ self.read_common(self.filename) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\postprocess\sources.py", line 218, in read_common self.mesh = Mesh.from_file(filename) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\discrete\fem\mesh.py", line 220, in from_file mesh = io.read(mesh, omit_facets=omit_facets) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\discrete\fem\meshio.py", line 535, in read fd = open(self.filename, 'r') OSError: [Errno 22] Invalid argument: 'c:\\ProgramData\\Anaconda3\\Scripts\\NOTEBOOKS\\cylinder.??.vtk'
#Same problem with (remplacing ?? by *) !c:\ProgramData\Anaconda3\python.exe c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\postproc.py c:\ProgramData\Anaconda3\Scripts\NOTEBOOKS\cylinder.*.vtk -a mov
#N.B. Python has no problem to find ffmpeg !ffmpeg -help #is OK
#same problem when I run the command from the terminal (cmd window) c:\ProgramData\Anaconda3\python.exe c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\postproc.py c:\ProgramData\Anaconda3\Scripts\NOTEBOOKS\cylinder.*.vtk -a mov
*meshio.py, line 535, fd = open(self.filename, 'r') does not want to open self.filename; there is a problem with the generic filename extraction ?*
Any help appreciated. F.K.
P.S. Of course, when I run python postproc.py -a mov on a specific file (say cylinder.00.vtk), I get an error: File "postproc.py", line 508, in main view.save_animation(options.filename) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\postprocess\viewer.py", line 345, in save_animation self.set_step.step = step AttributeError: 'Viewer' object has no attribute 'set_step'

Hello,
On 05. 07. 20 13:11, francoisbrest@hotmail.fr wrote:
Hello,
I am trying to reproduce an example from the documentation to create an animation. (Windows10, Anaconda python 3.6.10 h9f7ef89_2, sfepy 2020.2 py36h7725771_0 conda-forge)
Inside a Jupyter-notebook, I have done:
!copy c:\ProgramData\Anaconda3\lib\site-packages\sfepy\examples\diffusion\time_poisson.py . !c:\ProgramData\Anaconda3\python.exe c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\simple.py time_poisson.py -s
#everything OK #I can view each individual vtk #But I cannot create the animation
!c:\ProgramData\Anaconda3\python.exe c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\postproc.py c:\ProgramData\Anaconda3\Scripts\NOTEBOOKS\cylinder.??.vtk -a mov
Traceback (most recent call last): File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\postproc.py", line 513, in <module> main() File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\postproc.py", line 503, in main view = view_file(filenames, filter_names, options) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\postproc.py", line 281, in view_file domain_specific=options.domain_specific) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\postprocess\viewer.py", line 919, in call_mlab offscreen=self.offscreen) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\postprocess\sources.py", line 68, in create_file_source return GenericFileSource(filename, **kwargs) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\postprocess\sources.py", line 212, in __init__ self.read_common(self.filename) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\postprocess\sources.py", line 218, in read_common self.mesh = Mesh.from_file(filename) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\discrete\fem\mesh.py", line 220, in from_file mesh = io.read(mesh, omit_facets=omit_facets) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\discrete\fem\meshio.py", line 535, in read fd = open(self.filename, 'r') OSError: [Errno 22] Invalid argument: 'c:\\ProgramData\\Anaconda3\\Scripts\\NOTEBOOKS\\cylinder.??.vtk'
#Same problem with (remplacing ?? by *) !c:\ProgramData\Anaconda3\python.exe c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\postproc.py c:\ProgramData\Anaconda3\Scripts\NOTEBOOKS\cylinder.*.vtk -a mov
This look like the wildcards are not expanded to a list of files, assuming the path is correct.
#N.B. Python has no problem to find ffmpeg !ffmpeg -help #is OK
#same problem when I run the command from the terminal (cmd window) c:\ProgramData\Anaconda3\python.exe c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\postproc.py c:\ProgramData\Anaconda3\Scripts\NOTEBOOKS\cylinder.*.vtk -a mov
*meshio.py, line 535, fd = open(self.filename, 'r') does not want to open self.filename; there is a problem with the generic filename extraction ?*
Any help appreciated. F.K.
P.S. Of course, when I run python postproc.py -a mov on a specific file (say cylinder.00.vtk), I get an error: File "postproc.py", line 508, in main view.save_animation(options.filename) File "c:\ProgramData\Anaconda3\lib\site-packages\sfepy\postprocess\viewer.py", line 345, in save_animation self.set_step.step = step AttributeError: 'Viewer' object has no attribute 'set_step'
What if you try with several files:
c:\ProgramData\Anaconda3\python.exe c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\postproc.py c:\ProgramData\Anaconda3\Scripts\NOTEBOOKS\cylinder.00.vtk c:\ProgramData\Anaconda3\Scripts\NOTEBOOKS\cylinder.01.vtk -a mov
Note that saving animations (the ffmpeg call) is broken [1], but saving the individual frames should work. You can try calling postproc.py <files> (omit "-a mov") to launch the GUI, adjust the view as needed and then push the "make snapshots" button.
r.

Thank you for your quick reply.
c:\ProgramData\Anaconda3\python.exe c:\ProgramData\Anaconda3\lib\site-packages\sfepy\script\postproc.py c:\ProgramData\Anaconda3\Scripts\NOTEBOOKS\cylinder.00.vtk c:\ProgramData\Anaconda3\Scripts\NOTEBOOKS\cylinder.01.vtk
did the trick. It was, in deed, a problem with the wildcards expansion (specific to windows ?)
ffmpeg works after renaming the files view.x_0_00000e+00.png to view-x.png .
Thank you very much.
participants (2)
-
francoisbrest@hotmail.fr
-
Robert Cimrman