-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from nfa-vfxim/feature/issue-1/update-to-render…
…man-25 Further bugfixes for RenderMan 25 update
- Loading branch information
Showing
5 changed files
with
86 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import os.path | ||
|
||
from Deadline.Scripting import * | ||
|
||
|
||
def __main__(*args): | ||
deadline_plugin = args[0] | ||
|
||
job = deadline_plugin.GetJob() | ||
task = deadline_plugin.GetCurrentTask() | ||
|
||
output_directories = job.OutputDirectories | ||
output_filenames = job.OutputFileNames | ||
|
||
for i in range(0, len(output_directories)): | ||
output_directory = output_directories[i] | ||
output_filename = output_filenames[i] | ||
|
||
if not output_directory.endswith("denoise"): | ||
continue | ||
|
||
start_frame = task.GetStartFrame() | ||
end_frame = task.GetEndFrame() | ||
|
||
for frame_num in range(start_frame, end_frame + 1): | ||
output_filename = output_filename.replace("%04d", f"{frame_num:04}") | ||
from_path = os.path.join( | ||
output_directory, output_filename.replace("_denoise_", "_beauty_") | ||
) | ||
to_path = os.path.join(output_directory, output_filename) | ||
|
||
if os.path.exists(from_path): | ||
if not os.path.exists(to_path): | ||
os.rename(from_path, to_path) | ||
deadline_plugin.LogInfo(f"Renamed denoised frame {frame_num}") | ||
else: | ||
deadline_plugin.LogWarning( | ||
f"Renamed denoise frame {frame_num} already found: {to_path}" | ||
) | ||
else: | ||
deadline_plugin.FailRender( | ||
f"Can't find frame {frame_num} to denoise: {from_path}" | ||
) |