Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper --c and "--" syntax with rez env #98

Open
RafaelVillar opened this issue Dec 3, 2020 · 3 comments
Open

Proper --c and "--" syntax with rez env #98

RafaelVillar opened this issue Dec 3, 2020 · 3 comments

Comments

@RafaelVillar
Copy link

Hello!

Issue:

  • Commands issued after rez env x y z -- are stripped of quotation marks and can fail

You can see the command issued after the rez env is stripped of quotation marks and results in an error from the Maya render command.
image

Command supplied

rez env SEVEN-0.0.3 maya2018==2018.5.0 --exclude *.beta -- render -r arnold -ai:lve 2 -cam common_common_common_checkSetting_tooltest_v002_cam_modelCheck -s 1001 -e 1004 -b 1 -preRender "catch(preRenderHook); setAttr defaultRenderGlobals.putFrameBeforeExt 1; " -rd M:/hollywood/output M:/hollywood/projects/NINE/render_file.ma

Command executed after rez env

render -r arnold -ai:lve 2 -cam common_common_common_checkSetting_tooltest_v002_cam_modelCheck -s 1001 -e 1004 -b 1 -preRender catch(preRenderHook); setAttr defaultRenderGlobals.putFrameBeforeExt 1; -rd M:/hollywood/output M:/hollywood/projects/NINE/render_file.ma

But if you rez env x y z and issue the command manually, it is done it works.
image

This is perhaps more of an inquiry than an issue. But what is the correct syntax for a "complex" command such as this?

There is argument parsing done here but I think it is more a shell/sh/cmd issue, no?

Any advice would be appreciated on how to handle commands of this nature.

Actual production command with sensitive names omitted/replaced
rez env NINE-0.0.3 maya2018==2018.5.0 --exclude *.beta --time 1606913068 --paths "M:\common\users\rafael\packages;\\hollywood.local\Main\common\tools\packages\proj;\\hollywood.local\Main\common\tools\packages\app;\\hollywood.local\Main\common\tools\packages\td;\\hollywood.local\Main\common\tools\packages\int;\\hollywood.local\Main\common\tools\packages\ext;\\hollywood.local\Main\common\tools\packages\converted" -- render -r arnold -ai:lve 2 -cam common_common_common_checkSetting_tooltest_v002_cam_modelCheck -s 1001 -e 1004 -b 1 -preRender "catch(preRenderHook); setAttr defaultRenderGlobals.putFrameBeforeExt 1; " -preFrame "catch(preFrameHook); " -postLayer "catch(postLayerHook); " -postFrame "catch(postFrameHook); " -postRender "catch(postRenderHook); " -rd M:/hollywood/projects/NINE/tmp/maya_render/rafael/2020_1202_214812284000/output M:/hollywood/projects/NINE/tmp/maya_render/rafael/2020_1202_214812284000/chara_person_default_look_default-person_v074.ma

@mottosso
Copy link
Owner

mottosso commented Dec 3, 2020

These are problematic :/ The -- syntax is so complex it's hard to know where to look.

The most robust option I think would be to..

  1. Write the command after -- into a temporary command.bat or command.ps1
  2. Call rez env <your packages> -- command.bat
  3. Optionally delete it afterwards, or just keep overwriting it

The added benefit being that you can inspect the command.bat afterwards, and double-check quotation marks and newlines etc.

Next port to call would be to see whether nerdvegas/rez has a handle on this, I remember this being an issue way back when and it's possible they've got a solution that can be copy/pasted into here.

@RafaelVillar
Copy link
Author

Thank you for the quick response!

Yeah, I think I will just export it to a bat/sh file for simplicity sake. Maybe it's something we can auto generate in the tmp RXT dir? Just spit balling.

On mention of nerdvegas/rez -- that repo has taken off this last year with commits. Anything you've seen worth bringing over?

@mottosso
Copy link
Owner

mottosso commented Dec 3, 2020

Maybe it's something we can auto generate in the tmp RXT dir? Just spit balling.

Possibly..

On mention of nerdvegas/rez -- that repo has taken off this last year with commits. Anything you've seen worth bringing over?

Not sure, I haven't been keeping up, it's been a while. It's possible they've got Windows and Python 3 support under control by now, in which case you might be able to switch altogether. They should both work interchangeably with Allzpark, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants