Skip to content

Commit

Permalink
Error handling around the batch file
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Hughes <[email protected]>
  • Loading branch information
Ahuge committed Dec 11, 2024
1 parent 38e8303 commit b67edc5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/deadline/ae_submitter/Imports.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#include "data/InitData.jsx"

#include "data/RenderScript.jsx"

#include "submission/AssetReferenceTemplate.jsx"

#include "submission/DataTemplate.jsx"
Expand Down
12 changes: 3 additions & 9 deletions src/deadline/ae_submitter/UI/SubmitButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,9 @@ function __generateSubmitButton() {
stepsTemplate[0].name = itemName;
stepsTemplate[0].parameterSpace.taskParameterDefinitions[0].range = "{{Param." + itemName + "_FrameStart}} - {{Param." + itemName + "_FrameEnd}} : {{Param." + itemName + "_ChunkSize}}";
stepsTemplate[0].parameterSpace.taskParameterDefinitions[1].range = "{{Param." + itemName + "_FrameStartPlusChunkSizeMinusOne}}-{{Param." + itemName + "_FrameEndMinusOne}}:{{Param." + itemName + "_ChunkSize}},{{Param." + itemName + "_FrameEnd}}";
if(itemName != compNameToCheck)
{
stepsTemplate[0].script.embeddedFiles[0].data = "\"%AFTEREFFECTS_ADAPTOR_AERENDER_EXECUTABLE%\" -project \"{{Param.AfterEffectsProjectFile}}\" -comp \"{{Param." + itemName + "_CompName}}\" -s {{Task.Param.FrameChunkStart}} -e {{Task.Param.FrameChunkEnd}} || exit /b 1 \n"
// stepsTemplate[0].taskParameterDefinitions[2].range = ["{{Param." + compNameToCheck + "_CompName}}"];
}
else {
stepsTemplate[0].script.embeddedFiles[0].data = "\"%AFTEREFFECTS_ADAPTOR_AERENDER_EXECUTABLE%\" -project \"{{Param.AfterEffectsProjectFile}}\" -comp \"{{Param." + itemName + "_CompName}}\" -s {{Task.Param.FrameChunkStart}} -e {{Task.Param.FrameChunkEnd}} || exit /b 1 \n"
// stepsTemplate[0].taskParameterDefinitions[2].range = ["{{Param." + itemName + "_CompName}}"];
}

stepsTemplate[0].script.embeddedFiles[0].data = dcRenderScript.generateRenderCommand("{{Param." + itemName + "_CompName}}")

basicTemplate.steps[stepID-1] = stepsTemplate[0];
// logger.debug("[generateStep] basicTemplate: " + JSON.stringify(basicTemplate), _submitButtonFileName);
return basicTemplate;
Expand Down
2 changes: 1 addition & 1 deletion src/deadline/ae_submitter/data/RenderScript.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ function __generateRenderScriptTemplate(compParameterName) {

dcRenderScript = {
"generateRenderCommand": __generateRenderScriptTemplate,
};
};
12 changes: 11 additions & 1 deletion src/deadline/ae_submitter/submission/JobTemplate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,17 @@ var OPENJD_TEMPLATE = {
"filename": "aerender.bat",
"type": "TEXT",
"runnable": true,
"data": "\"%AFTEREFFECTS_ADAPTOR_AERENDER_EXECUTABLE%\" -project \"{{Param.AfterEffectsProjectFile}}\" -comp \"{{Task.Param.Comp}}\" -s {{Task.Param.FrameChunkStart}} -e {{Task.Param.FrameChunkEnd}} || exit /b 1 \n"
"data": "@ECHO OFF\n" +
"IF \"%AFTEREFFECTS_ADAPTOR_AERENDER_EXECUTABLE%\" == \"\" (\n" +
" set AFTEREFFECTS_ADAPTOR_AERENDER_EXECUTABLE=aerender.exe\n" +
")\n" +
"\n" +
"\"%AFTEREFFECTS_ADAPTOR_AERENDER_EXECUTABLE%\" -project \"{{Param.AfterEffectsProjectFile}}\" -comp \"{{Task.Param.Comp}}\" -s {{Task.Param.FrameChunkStart}} -e {{Task.Param.FrameChunkEnd}}\n" +
"IF %ERRORLEVEL% NEQ 0 (\n" +
" echo \"Return code: %ERRORLEVEL%\"\n" +
" exit %ERRORLEVEL%\n" +
")\n" +
"exit 0\n",
}
]
}
Expand Down

0 comments on commit b67edc5

Please sign in to comment.