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
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