Hey Justin, thanks a lot for suggesting this solution, I’m so glad I’ve got you on board, but unfortunately, after testing it extensively, it doesn’t work. I really wish it did, because it’s much easier to just paste a file instead of modifying lines of code.
Your script successfully does what it’s intended to do, but somehow the issue persists. First of all, without any changes, the script breaks the render command.
The job report:
2024-10-12 00:22:46: 0: INFO: Executable: "C:\Rez\Scripts\rez\rez.exe"
2024-10-12 00:22:46: 0: INFO: Argument: "C:\ProgramData\Thinkbox\Deadline10\workers\DESKTOP-D60IBSH\plugins\6709a51d6b51c065ee45cee0\hrender_dl.py" -f 1 2 1 -o "$HIP/render_REZ/rez_10/$HIPNAME.$OS.$F4.exr" -g -d /out/Redshift_ROP1 -tempdir "C:\ProgramData\Thinkbox\Deadline10\workers\DESKTOP-D60IBSH\jobsData\6709a51d6b51c065ee45cee0\0_tempF720x0" -arnoldAbortOnLicenseFail 1 "C:/Users/Xander/Desktop/DEADLINE_PLUGIN_DEV/SolarisRS_Test_Scene.hiplc" "C:/Users/Xander/Desktop/DEADLINE_PLUGIN_DEV/SolarisRS_Test_Scene.hiplc"
2024-10-12 00:22:46: 0: INFO: Full Command: "C:\Rez\Scripts\rez\rez.exe" env redshift-3.5.07 houdini-19.5.303 -- hython "C:\ProgramData\Thinkbox\Deadline10\workers\DESKTOP-D60IBSH\plugins\6709a51d6b51c065ee45cee0\hrender_dl.py" -f 1 2 1 -o "$HIP/render_REZ/rez_10/$HIPNAME.$OS.$F4.exr" -g -d /out/Redshift_ROP1 -tempdir "C:\ProgramData\Thinkbox\Deadline10\workers\DESKTOP-D60IBSH\jobsData\6709a51d6b51c065ee45cee0\0_tempF720x0" -arnoldAbortOnLicenseFail 1 "C:/Users/Xander/Desktop/DEADLINE_PLUGIN_DEV/SolarisRS_Test_Scene.hiplc" "C:/Users/Xander/Desktop/DEADLINE_PLUGIN_DEV/SolarisRS_Test_Scene.hiplc"
2024-10-12 00:22:46: 0: INFO: Startup Directory: "C:\Rez\Scripts\rez"
2024-10-12 00:22:46: 0: PYTHON: Single quoting Houdini
2024-10-12 00:22:46: 0: PYTHON: -----Modified Command Line-----
2024-10-12 00:22:46: 0: PYTHON: Executable: 'C:\Rez\Scripts\rez\rez.exe'
2024-10-12 00:22:46: 0: PYTHON: Arguments: 'env redshift-3.5.07 houdini-19.5.303 -- hython 'C:\ProgramData\Thinkbox\Deadline10\workers\DESKTOP-D60IBSH\plugins\6709a51d6b51c065ee45cee0\hrender_dl.py' -f 1 2 1 -o '$HIP/render_REZ/rez_10/$HIPNAME.$OS.$F4.exr' -g -d /out/Redshift_ROP1 -tempdir 'C:\ProgramData\Thinkbox\Deadline10\workers\DESKTOP-D60IBSH\jobsData\6709a51d6b51c065ee45cee0\0_tempF720x0' -arnoldAbortOnLicenseFail 1 'C:/Users/Xander/Desktop/DEADLINE_PLUGIN_DEV/SolarisRS_Test_Scene.hiplc' 'C:/Users/Xander/Desktop/DEADLINE_PLUGIN_DEV/SolarisRS_Test_Scene.hiplc''
2024-10-12 00:22:46: 0: PYTHON: Working Dir: 'C:\Rez\Scripts\rez'
2024-10-12 00:22:46: 0: PYTHON: -------------------------------
And here’s Hython output of hrender_dl.py
(an error):
2024-10-14 10:28:30: 0: STDOUT: python: can't open file 'C:\Rez\Scripts\rez\'C:\ProgramData\Thinkbox\Deadline10\workers\DESKTOP-D60IBSH\plugins\670cd60d1b4688c01e479eec\hrender_dl.py': [Errno 22] Invalid argument
Honestly, no idea why because the command looks good.
Meanwhile I’ve tried:
- changing
Houdini.py
script to "-o '%s'"
as sbisonnette0 suggested which did produce a single quoted path -o '$HIP/render_REZ/rez_11/$HIPNAME.$OS.$F4.exr'
, but didn’t solve the issue
- I’ve tried regex to achieve basically the same thing from the JobPreLoad.py script, but it also didn’t solve the issue
Despite the path being in single quotes, it ends up expanded:
# hython's print(sys.argv) output
2024-10-14 11:16:51: 0: STDOUT: ['C:\\ProgramData\\Thinkbox\\Deadline10\\workers\\DESKTOP-D60IBSH\\plugins\\670ce1774b202e92a1b51233\\hrender_dl.py', '-f', '1', '2', '1', '-o', "'/render_REZ/rez_11/...exr'", '-g', '-d', '/out/Redshift_ROP1', '-tempdir', 'C:\\ProgramData\\Thinkbox\\Deadline10\\workers\\DESKTOP-D60IBSH\\jobsData\\670ce1774b202e92a1b51233\\0_tempgtsAr0', '-arnoldAbortOnLicenseFail', '1', 'C:/Users/Xander/Desktop/DEADLINE_PLUGIN_DEV/SolarisRS_Test_Scene.hiplc', 'C:/Users/Xander/Desktop/DEADLINE_PLUGIN_DEV/SolarisRS_Test_Scene.hiplc']
Lastly, my layman’s investigation:
I find it suspicious how single quoted arguments end up having both single and double quotes in that sys.argv list "'/render_REZ/rez_11/...exr'"
.
After printing sys.argv with a python script and a batch script, I find it really weird how double quotes count as a single argument and single quotes don’t (using Windows Command Prompt):
C:\Users\Xander\Desktop\test>python myscript.py "first test path" 'second test path'
Args are:
['myscript.py', 'first test path', "'second", 'test', "path'"]
But in rez-env/Powershell, they do:
> $ print_args_python "first test path" 'second test path'
all args are:
['C:\\Scripts\\print_args_python.py', 'first test path', 'second test path']
But as we see, the single quoted argument doesnt get wrapped in additional double quotes, like it did earlier using Cmd.
Anyway, I submitted a new regular non Rez job with a space in its name $HIP/$HIPNAME $OS.$F4.exr
and without any changes to Deadline it works, but then I switched my -o
to be in single quotes and it completely broke (Rez is off at this point)
# part of the Hython's print(sys.argv)
# the space breaks the path into two arguments
'-o', "'$HIP/render_REZ/rez_11/$HIPNAME", "$OS.$F4.exr'",
Not sure if that’s relevant, but it feels wrong. Feels like it’s a part of this issue. It feels like we’re somehow getting both the CMD feature of not respecting single quotes and the Rez/Powershell feature of expanding dollar variables.