Hi,
I was adapting the template scripts for Shotgun version submission from deadline for our firm and everything was brilliant ,but then one of the guys submitted with option(s) different than “First To Last (Forward)” (3ds max 2014) and the version submission failed.The problem was that in the CreateShotgunVersion.py the frame list was taken with job.JobFrames which when not submitted with the default option mentioned above is giving insane list with elements : >.I fixed it by just using job.JobFramesList first and last element and creating my own from there,but its kinde a hacky still works tho xD. My question is if theres better way of doing or is it random bug or is there any update : >?
Best wishes.
Veselin Georgiev.
Hey Veselin,
Thanks for reporting this! Can you clarify what the actual error was? Does Shotgun just not like dealing with lengthy frame strings? Or was it something in our own code that was failing to parse the long string?
I think the way you’re changing it is definitely the simplest way – job.JobFramesList does sort the frames, so the lowest frame is guaranteed to be the first element, and the highest frame is guaranteed to be the last element. The only time this would be incorrect, is if you have a ‘gap’ in the frames (e.g., if you’re rendering “0-50,100-150”, the way you’re doing would return “0-150”, which isn’t quite right).
If you’re concerned about that ‘gap’, you could use the FrameUtils.ToFrameString function, which takes in a list of frames and returns the ‘proper’ frame string. Assuming the only thing that caused the lengthy frame string was the ordering, you should be able to get a condensed frame string by doing:
frameString = FrameUtils.ToFrameString( job.JobFramesList )
I suppose this might actually make it longer, though, if the original frame string was something like “0-100x2”. So maybe the best way to do this is something like this:
frameString = FrameUtils.ToFrameString( job.JobFramesList )
if len( frameString ) > len( job.FramesList ):
frameString = job.FramesList
I’ll make this change to our internal version, so that this fix can get pushed out to other clients who might be periodically running into this issue.
Cheers,
Jon
Hi,
thank you for the fast replay Jon.I will add that “gap” fix you wrote : >.
The problem was in the CreateShotgunVersion function in the CreateShotgunVersion.py , in the 2nd try test that creates the version,so the error was that it cant create the version in shotgun. The line was->newVersion = ShotgunUtils.AddNewVersion( userName, taskId, projectId, entityId, entityType, version, description, frameList, frameCount, outputPath, shotgunPath, job.JobId )
I printed the length of the frameList list that was created with job.jobFrames by default and it was 1394, in my case ,where with job.JobFramesList was 279 which was the correct frames total. I guess since that dont give you correct frame list for shotgun you cant create the version and it fails the try test.
Thank you for the gap fix code and have a great day : >.
Veselin Georgiev.