ynput / ayon-deadline

Deadline addon for AYON
Apache License 2.0
3 stars 11 forks source link

Fix ValidateExpectedFiles RuntimeError #50

Closed TobiasPharos closed 1 month ago

TobiasPharos commented 1 month ago

Changelog Description

This is a quick fix for the bug, that replaces all occurrences of the frame number in the file name string. Will for sure need some proper refactoring. Solved by importing clique directly and not importing collect_frames from ayon_core, which generates code duplication.

Additional info

ayon_core.lib.path_tools.collect_frames() uses replace() to replace the frame number with the placeholder. If the file name contains the frame number at a different location too (e.g. sequence name), both get replaced, leading to an error.

BigRoy commented 1 month ago

@TobiasPharos I've taken the liberty to push a code change into this PR's branch. Could you check the updated code on your end and maybe give it a few test runs?

That whole string manipulation felt so extremely off even though we had the clique.Collection at our disposal already so it just made way more sense to just use the data we already have and manipulate that instead.

If this is worse - feel free to revert of course. But to me this makes more sense.

TobiasPharos commented 1 month ago

@BigRoy Your code update works for me. Thank you!

BigRoy commented 1 month ago

@TobiasPharos could you please provide "reproducable steps" / "testing step" to recreate the issue that existed before this PR that this PR intends to fix? Like how should we confirm or check on our end it does what it needs to?

TobiasPharos commented 1 month ago

Sure @BigRoy. The fix is related to #48. So when publishing an image sequence like "1001_010_comp.1001.exr, 1001_010_comp.1002.exr" from Nuke, ValidateExpectedFiles tried to find "1001_010_comp.1001.exr, 1002_010_comp.1002.exr" and genereated a RuntimeError.

File "...\ayon-deadline\client\ayon_deadline\plugins\publish\global\validate_expected_and_rendered_files.py", line 86, in process
RuntimeError: Missing expected files: ['1002_010_comp.1002.exr', '1003_010_comp.1003.exr']