I have written a script in Python to automate some tasks in 3DsMax 2018. The script takes 2 parameters / arguments to work as needed. More specifically the name of the input and output path.
I run the script from CLI with the following command and everything works fine:
3dsmax.exe -U PythonHost C:Users\user\Desktop\Script.py
But when I pass arguments, they are not recognized by the script / 3DsMax:
3dsmax.exe -U PythonHost C:Users\user\Desktop\Script.py test
I checked the incoming arguments with print(sys.argv)
, but only the path to the python script is listed as an argument. Is there a way of passing arguments to the cli?
I figured it out myself, if anyone else has this problem, here is what I found out. To add parameters of any kind you have to use the 3dsmaxbatch.exe.
My example would look like this:
3dsmaxbatch.exe C:Users\user\Desktop\Script.py -mxsString string1:"test"
The documentation of 3dsMaxbatch was very helpful to find out the possible cli options.