Meshroom: [question] New cli node without --options?

Created on 8 Nov 2019  路  6Comments  路  Source: alicevision/meshroom

Describe the problem
I tried to create a new node for https://github.com/sp4cerat/Fast-Quadric-Mesh-Simplification
The problem is, that the exe does not use options for input/output and parameters, the expected cli input is:

simplify.exe c:\dir\in.obj c:\dir\out.obj 0.2

When I run my node I get the following error: File --input not found!

_Is it possible to pass only the paths and parameters from the node to the cli?_

Log

[1/1] msimplify
 - commandLine: alicevision_msimplify  --input "C:/Users/natowi/AppData/Local/Temp/MeshroomCache/Meshing/852d4042ef8b75b8cf021b9cadaad1d86d0b5c00/mesh.obj" --ratio 0.5 --agressiveness 7.0 --output "C:/Users/natowi/AppData/Local/Temp/MeshroomCache/msimplify/b9453cffbe84470ee083c155e4773c69afd76361/mesh.obj"
 - logFile: C:/Users/natowi/AppData/Local/Temp/MeshroomCache/msimplify/b9453cffbe84470ee083c155e4773c69afd76361/log
 - elapsed time: 0:00:00.092263
ERROR:root:Error on node computation: Error on node "msimplify_1":
Log:
Mesh Simplification (C)2014 by Sven Forstmann in 2014, MIT License (64-bit)
File --input not found!

How to reproduce
OS: Win10
latest Meshroom (not compiled), pre-compiled alicevision+plugins

.py file to place in meshroom\nodes\aliceVision
https://gist.github.com/natowi/b42329c8104e88edc4357c9c1bd0a94d

.exe file to place in aliceVision\bin
bin.Windows (rename from simplify.exe to alicevision_msimplify.exe)

.bat to place in Meshroom folder to start the gui

set MESHROOM_INSTALL_DIR=%cd%
set PYTHONPATH=%CD% && python meshroom/ui

sim

question

All 6 comments

because the exe does only take positional arguments (no --paramName)
https://github.com/sp4cerat/Fast-Quadric-Mesh-Simplification/blob/master/src.cmd/Main.cpp#L24

u can have a simple python executable script named alicevision_msimplify that takes those arguments and makes the proper call to the exe without the parameter names

Thank you, I will give this a try. Could you provide a simple example or point me to one? That would be a huge help, am new to python ;)

Actually I don't know how python works on windows, if you can call the script directly like in linux.
You can also simply create a batch script file that remaps the input parameters properly for the exe to launch:
https://stackoverflow.com/a/26702/1107548
Your alicevision_msimplify will be something like

alicevision_msimplify %2 %4

where %X is the parameter in position X, you want to skip the odd numbers as they are the --paramName, just reorder the others according to the exe.

No, just change in your node description.

class MeshDecimate(desc.CommandLineNode):
    commandLine = 'alicevision_msimplify {inputValue} {outputValue} {factorValue}' ### HERE: change the command line

    inputs = [
        desc.File(
            name='input',
            ...)
        desc.FloatParam(
            name='factor',
            ...
...

Thank you, I have learned a lot and it now works.
https://gist.github.com/natowi/b42329c8104e88edc4357c9c1bd0a94d

Was this page helpful?
0 / 5 - 0 ratings

Related issues

raphael2692 picture raphael2692  路  3Comments

mobarre picture mobarre  路  5Comments

NorthernXY picture NorthernXY  路  3Comments

SBCV picture SBCV  路  3Comments

ethansu1992 picture ethansu1992  路  3Comments