MFiX:24.1.1 vtk generates animation erro

Hello, I am a beginner and I am having some problems in using the suitable teaching tutorial, the following is my version information:

MFiX: 24.1.1
Python: 3.11.8 | packaged by conda-forge | (main, Feb 16 2024, 20:40:50) [MSC v.1937 64 bit (AMD64)]
gfortran: GNU Fortran (Rev5, Built by MSYS2 project) 5.3.0
openmpi: Unavailable
Qt wrapper: PyQt5
Qt: 5.15.8
qtpy: 2.4.1
numpy: 1.26.4
nodeworks: Unavailable
flask: 3.0.3
psutil: 5.9.8
VTK: 9.2.6
OpenGL backend: 2
System info: Windows-10-10.0.19045-SP0
Install location: D:\ProgramData\mambaforge\envs\mfix-24.1.1\share\mfix
Solver source: D:\ProgramData\mambaforge\envs\mfix-24.1.1\share\mfix\src

When I try to output video time through vtk, I get the following error:

Error: ‘CreateMoviePopUp’ object has no attribute ‘lineedit_path’

File “…\vtk_widgets\dialogs.py”, line 248, in browse

self.ui.lineedit_path.text())

^^^^^^^^^^^^^^^^^^^^^

I searched it. 248 lines of code is this line
“ self.ui.lineedit_path.text())”
Here are a few lines of his code
def browse(self):
filename = QtWidgets.QFileDialog.getExistingDirectory(
self,
“Save screenshot”,
self.ui.lineedit_path.text())
if isinstance(filename, (tuple, list)):
filename = filename[0]
if not filename:
return
self.ui.lineedit_path.setText(filename)

I just installed the latest version of the software, the code has not moved, the current problem do not know how to get the result, looking forward to your help

Hi @Hooya - thanks for the report and sorry for the trouble. We will fix this in the next MFiX release (24.2)

For now - if you do not click on the “folder” icon to change directory, you should be able to create an animation in the project directory.

Or, you can patch your copy of MFiX:

It looks like there is a small error in the code, the variable is called lineEdit_filename (capital E) and the code is looking for lineedit_filename (small e)

You should be able to open the file vtk_widgets/dialogs.py in an editor (back it up first!) and look for the function browse:

   244	    def browse(self):
   245	        filename = QtWidgets.QFileDialog.getExistingDirectory(
   246	            self,
   247	            "Save screenshot",
   248	            self.ui.lineedit_path.text())
   249	        if isinstance(filename, (tuple, list)):
   250	            filename = filename[0]
   251	        if not filename:
   252	            return
   253	        self.ui.lineedit_path.setText(filename)

We’re going to make 3 small changes:

On lines 248 and 253, change lineedit_path to lineEdit_path

And on line 247, change the text “Save screenshot” to something like “Select directory for movie”.

   244	    def browse(self):
   245	        filename = QtWidgets.QFileDialog.getExistingDirectory(
   246	            self,
   247	            "Select directory for movie",
   248	            self.ui.lineEdit_path.text())
   249	        if isinstance(filename, (tuple, list)):
   250	            filename = filename[0]
   251	        if not filename:
   252	            return
   253	        self.ui.lineEdit_path.setText(filename)

this should remedy the issue.

Please let us know if you have any further issues.

– Charles