SMTD General Sanity Check - CheckForRenderOutputTrail

Hi,

re: “CheckForRenderOutputTrail” general sanity check

I don’t understand why the following 3dsMax SMTD - general sanity check has been coded in its 2nd test the way it has?

(
if theFileName.count > 3 then
not (try((classof (execute (substring theFileName theFileName.count 1)) == Integer and classof (execute (substring theFileName (theFileName.count-3) 4)) != Integer ))catch(false))
else
true
)

ie: “classof (execute (substring theFileName (theFileName.count-3) 4)) != Integer”

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?

Thoughts?
Mike

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.

Again though, Bobo would likely know the reason. :slight_smile:

Cheers,

  • Ryan

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.

Hope this helps.

Thanks guys, this all makes sense now.
Mike