3DLIRIOUS / MeshLabXML

Create and run MeshLab XML scripts with Python
GNU Lesser General Public License v2.1
202 stars 43 forks source link

Importing osm-bundler output into MeshLabXML #23

Open ethansu1992 opened 4 years ago

ethansu1992 commented 4 years ago

Hi i am new to meshlabserver, can i ask how can i import several files into meshlab (bundler.OUT and list files) together with the .ply file and .mlx file?

Problem with filter: Parameterization + texturing from registered rasters Failed to apply script file C:/Users/MeshLabXML-master/MeshLabXML-master/testing.xml

3DLIRIOUS commented 4 years ago

Hi,

mlx.run (and by extension the FilterScript class) can accept multiple files as a list. For example, to load multiple meshes you would use file_in=[file1.ply, file2.stl]. bundler.OUT files are project files, so you could try loading these using the mlp_in parameter. I do not use bundler.OUT files and so I can't confirm that it works, but it should since it is just passing the list of filenames to meshlabserver. If you run into issues please let me know.

Tim

3DLIRIOUS commented 4 years ago

It would be great if you could provide a bundler.OUT file for testing purposes.

ethansu1992 commented 4 years ago

Hi Tim,

i am facing this problem:

meshlabserver cmd = meshlabserver -p "bundle.out" -i "final.ply" -i "bundle.out" -i "list.txt" -o "C:/Users/Desktop/final2.ply" -m fc vc vn -s "testing.xml"
***START OF MESHLAB STDOUT & STDERR***
Loading Plugins:
Current Plugins Dir is: C:/Program Files/VCG/MeshLab/plugins
Total 241 filtering actions
Total 12 io plugins
Project C:/Users/Desktop/MeshLabXML-master/MeshLabXML-master/bundle.out is not a valid 'mlp' file format. MeshLabServer application will exit.

Houston, we have a problem. 
MeshLab did not finish successfully. Review the log file and the input file(s) to see what went wrong.
MeshLab command: "meshlabserver -p "bundle.out" -i "final.ply" -i "bundle.out" -i "list.txt" -o "C:/Users/Desktop/final2.ply" -m fc vc vn -s "testing.xml""
Where do we go from here?
 r  - retry running MeshLab (probably after you've fixed any problems with the input files)
 c  - continue on with the script (probably after you've manually re-run and generated the desired output file(s)
 x  - exit, keeping the TEMP3D files and log
 xd - exit, deleting the TEMP3D files and log
Select r, c, x (default), or xd:

i did search and i found this, [https://stackoverflow.com/questions/55535457/how-to-convert-bundlers-bundle-out-format-into-meshlabs-project-format-mlp]

But i am not sure what do they mean. I will also provide you with a bundler.out file shortly:)

Ethan

ethansu1992 commented 4 years ago

It would be great if you could provide a bundler.OUT file for testing purposes.

Hi Tim,

The following attachments are the files i am using for the this function

testing.zip

3DLIRIOUS commented 4 years ago

The first troubleshooting step is to try to run the generated meshlabserver command directly from the command line. This will tell you if the problem is with meshlabxml or meshlabserver itself, and may put out more useful messages. The "file_in" and -i flag are only for meshes, so will not work for the bundler.out and list.txt files.

Thanks very much for the test files. After trying them, unfortunately I must conclude that meshlabserver does not support bundler.out files, even thought the MeshLab GUI does. The -p flag apparently only works with meshlab project (mlp) files.

I would recommend that you open an issue with MeshLab https://github.com/cnr-isti-vclab/meshlab requesting that bundler.out support be added to meshlabserver; I looked and there doesn't seem to be an existing issue for this.

I too found that stackoverflow question. While the author was kind enough to provide the recipe to convert bundler.out files to mlp files, unfortunately they did not share their code, so it would need to be recreated. I don't have the time to re-implement this right now, but if you have some python skills and want to code it up, I'd be happy to incorporate it into meshlabxml.

Another option may be to use the MeshLab GUI to manually convert the files to mlp files. You can then process them using meshlabxml and meshlabserver, although this isn't a fully automated solution. Yet another workflow could be to just use meshlabxml to create your mlx script file, then run that in the GUI after importing the bundler file.

3DLIRIOUS commented 4 years ago

Closing this issue since it is not an issue with MeshLabXML, but with upstream.

3DLIRIOUS commented 4 years ago

Re-opening. I will take a look at adding functionality to parse and convert bundler.out files to mlp.

This will most likely take the form of two new functions in mlx.py, one to read and parse bundler.out and list.txt files, and another to perform the matrix transformations to convert to mlp format. This can then be fed into the existing mlx.create_mlp function to create an mlp file, which can then be loaded into meshlabserver.

ethansu1992 commented 4 years ago

yes, thank you so much!