I am working out a batch script using
.bat MS Dos command to initiate FaceFX -exec %PYTHON_FILE% command but notice when I was able to error the command a pop-up window that exposed some additional command /1 --arg1, /2 arg2, ... etc
that says I can pass to my python script.
Does anyone have any sample script that shows how to use these "-arg1" command in a MS-Dos .bat file, AND how to capture/process them on the pythons script side ?
IE: a simple "hello_world.bat" and "hello_world.py" to set and retrieve in python multiple arg1, arg2, ... variables.
thx
Thanks for pointing this out. This was a new feature added in FaceFX 2021, but it was not documented. I've added documentation here.
The short answer is that you need to access the arguments from the sys.argv array:
import sys
print len(sys.argv), 'command line arguments: ', str(sys.argv)
Thx for the update, I ended up figuring it out...
In .BAT file I use:
%APP_EXE% -ogre_rendersystem="opengl" -exec %PYTHON_FILE% "-1" %CLIP_NAME% "-2" %AUDIO_FILE% "-3" %TEXT_FILE% ...
In .py script I use:
import sys
clip_name = sys.argv[1]
audio_file = sys.argv[2]
text_file = sys.argv[3]
...
Note: Array starts at [1] not [0]
Here is another option I would really like at the command line batch level.
When I am develloping tool and by default printing out all the processing that is happening is great.
But after I have setup and running my wrapper BAT/python script on batch jobs, it would be nice to have an otional flag I can submit to turn off all ( Non-Error/Non-Halt) messages ... as an additional optional flag ( eg -"silent" or "-noVerbose" ... )
Set the g_unattended console variable to “1”. That should do the trick.
set -name “g_unattended” -value “1”