If the render output filename is “test_002.jpg”, this will past the test (which is wrong, as we need to get rid of all integers to the left of the file extension), but “test_0002.jpg” will fail. Its my belief that the check should be working backwards from the file extension, checking that the last character is NOT an integer. I really don’t understand the need for the second test?
Bobo might know better, but I think that if Max sees 4 numbers at the end of a path, it will assume that’s the output padding, and will replace it with its own. If it’s a different amount of numbers, then it will just append 4 additional numbers at the end for padding. That would explain the second check.
I am not even sure I wrote that code, but it does exactly the opposite of what you say.
As Ryan explained, we are checking to see if there are 4 or more trailing digits (we check for 4) because Max will replace them automatically.
If you have “test_0002.jpg”, it does not complain. It does complain if you have “test_002.jpg”, because rendering to that will produce “test_0020000.jpg” when rendering frame 0, and your compositing app will think you are on frame 20K…
I tested all the above using the names you provided and SMTD 5.1 and it did complain about 3 digits but was cool with 4 and 5.
Rendering also produced wrong output when the file name had 3 digits, but correctly renumbered with 4 and 5.