3DLIRIOUS / MeshLabXML

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

Can't find filter: Parametrization: Trivial Per-Triangle #29

Closed Ethanol10 closed 3 years ago

Ethanol10 commented 3 years ago

Hi, so i've started using this as a way to automate vertex color to texture operations, but when performing Parametrization: Trivial Per-Triangle filter and filter Vertex Color to Texture, it can't find the filters and halts.

When using the Vertex Color to Texture:

`(base) PS C:\coding\meshlabxmltesting> python main.py
meshlabserver cmd = meshlabserver -i "quatrefoil_color.ply" -o "final.ply" -m vc vn wt -s "C:\Users\ethan\AppData\Local\Temp\tmpuv09xnii.mlx"
START OF MESHLAB STDOUT & STDERR
Loading Plugins:
Current Plugins Dir is: C:/Program Files/VCG/MeshLab/plugins
"Cannot load library C:\Program Files\VCG\MeshLab\plugins\filter_sketchfab.dll: The specified module could not be found."
Total 265 filtering actions
Total 13 io plugins
Opening a file with extension ply
Mesh C:/coding/meshlabxmltesting/quatrefoil_color.ply loaded has 368640 vn 737280 fn
output mesh C:/coding/meshlabxmltesting/final.ply
vertex color, vertex normals, wedge tex coords, Apply FilterScript: 'C:/Users/ethan/AppData/Local/Temp/tmpuv09xnii.mlx'
FilterScript
Reading filter with name Vertex Color to Texture
Starting Script of 1 actionsfilter: Vertex Color to Texture
filter Vertex Color to Texture not foundFailed to apply script file C:/Users/ethan/AppData/Local/Temp/tmpuv09xnii.mlx

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 -i "quatrefoil_color.ply" -o "final.ply" -m vc vn wt -s "C:\Users\ethan\AppData\Local\Temp\tmpuv09xnii.mlx""
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:`

When using the Parametrization: Trivial Per-Triangle:

(base) PS C:\coding\meshlabxmltesting> python main.py
meshlabserver cmd = meshlabserver -i "quatrefoil_color.ply" -o "final.ply" -m vc vn wt -s "C:\Users\ethan\AppData\Local\Temp\tmpdi7j29b6.mlx"
START OF MESHLAB STDOUT & STDERR
Loading Plugins:
Current Plugins Dir is: C:/Program Files/VCG/MeshLab/plugins
"Cannot load library C:\Program Files\VCG\MeshLab\plugins\filter_sketchfab.dll: The specified module could not be found."
Total 265 filtering actions
Total 13 io plugins
Opening a file with extension ply
Mesh C:/coding/meshlabxmltesting/quatrefoil_color.ply loaded has 368640 vn 737280 fn
output mesh C:/coding/meshlabxmltesting/final.ply
vertex color, vertex normals, wedge tex coords, Apply FilterScript: 'C:/Users/ethan/AppData/Local/Temp/tmpdi7j29b6.mlx'
FilterScript
Reading filter with name Parametrization: Trivial Per-Triangle
Reading filter with name Vertex Color to Texture
Starting Script of 2 actionsfilter: Parametrization: Trivial Per-Triangle
filter Parametrization: Trivial Per-Triangle not foundFailed to apply script file C:/Users/ethan/AppData/Local/Temp/tmpdi7j29b6.mlx

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 -i "quatrefoil_color.ply" -o "final.ply" -m vc vn wt -s "C:\Users\ethan\AppData\Local\Temp\tmpdi7j29b6.mlx""
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:

Here is the snippet of code I used, it's based off the example in the folder, hence why there are some similar variable names:

def main():
    os.chdir(THIS_SCRIPTPATH)
    #ml_version = '1.3.4BETA'
    ml_version = '2016.12'

    # Add meshlabserver directory to OS PATH; omit this if it is already in
    # your PATH
    #meshlabserver_path = 'C:\\Program Files\\VCG\\MeshLab'
    #"""
    if ml_version == '1.3.4BETA':
        meshlabserver_path = 'C:\Program Files\VCG\MeshLab'
    elif ml_version == '2016.12':
        meshlabserver_path = 'C:/Program Files/VCG/MeshLab'
    #"""
    os.environ['PATH'] = meshlabserver_path + os.pathsep 

    file_color = 'quatrefoil_color.ply'
    # Cross section parameters
    length = math.radians(360)
    tube_size = [10, 10, length]
    segments = [64, 64, 720*2]
    inner_radius = 2.0

    quatrefoil_color = mlx.FilterScript(file_in=file_color, file_out="final.ply", ml_version=ml_version)
    mlx.texture.per_triangle(quatrefoil_color, sidedim = 0, textdim = 4096, border = 0.1, method = 0)
    mlx.transfer.vc2tex(quatrefoil_color, tex_name="final.png", tex_width=4096, tex_height=4096, assign_tex=True, fill_tex=True)
    # mlx.create.cube_open_hires(quatrefoil_color, size=tube_size, x_segments=segments[0], y_segments=segments[1], z_segments=segments[2], center=True)
    quatrefoil_color.run_script()

The commented out command "mlx.create.cube_open_hires()" works fine, but when using the other functions in texture, it mentions it can't find the filter.

Sorry for the multiple edits, I was figuring out the formatting.

3DLIRIOUS commented 3 years ago

Which version of MeshLab are you using? It's likely that the upstream filter name has changed and I haven't updated MLX yet.

Ethanol10 commented 3 years ago

MeshLab 2020.07 I believe.

3DLIRIOUS commented 3 years ago

Are you able to use the older 2016.12 release? This is the last release MLX was regularly tested with.

Ethanol10 commented 3 years ago

I'll try grab a copy of that tomorrow when I get back on.

Ethanol10 commented 3 years ago

Hi, I found a copy of MeshLab 2016.12 and ran the following code again. This is the output.

(base) PS C:\coding\meshlabxmltesting> python main.py
meshlabserver cmd = meshlabserver -i "quatrefoil_color.ply" -o "final.ply" -m vc vn wt -s "C:\Users\ethan\AppData\Local\Temp\tmpu73a21bb.mlx"
***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
Opening a file with extention ply
Mesh C:/coding/meshlabxmltesting/quatrefoil_color.ply loaded has 368640 vn 737280 fn
output mesh  C:/coding/meshlabxmltesting/final.ply
vertex color, vertex normals, wedge tex coords, Apply FilterScript: 'C:/Users/ethan/AppData/Local/Temp/tmpu73a21bb.mlx'
FilterScript
Reading filter with name Parametrization: Trivial Per-Triangle
    Reading Param with name sidedim : RichInt
    Reading Param with name textdim : RichInt
    Reading Param with name border : RichInt
    Reading Param with name method : RichEnum
Reading filter with name Vertex Color to Texture
    Reading Param with name textName : RichString
    Reading Param with name textW : RichInt
    Reading Param with name textH : RichInt
    Reading Param with name overwrite : RichBool
    Reading Param with name assign : RichBool
    Reading Param with name pullpush : RichBool
Starting Script of 2 actionsfilter: Parametrization: Trivial Per-Triangle
filter Parametrization: Trivial Per-Triangle  not foundFailed to apply script file C:/Users/ethan/AppData/Local/Temp/tmpu73a21bb.mlx

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 -i "quatrefoil_color.ply" -o "final.ply" -m vc vn wt -s "C:\Users\ethan\AppData\Local\Temp\tmpu73a21bb.mlx""
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:
3DLIRIOUS commented 3 years ago

Ok, this should be fixed in 2ae3974fc46dfef80af57da4f0ed2fd14bb101db. If it still doesn't work please let me know.

3DLIRIOUS commented 3 years ago

Forgot that Vertex Color to Texture needed fixing as well; this is now corrected in 2a26c1ff8b1ff14086eb96b54f8fde340cf55f36.