AWS Thinkbox Discussion Forums

Maya Submitter preview job option bug

Hi, I am wanting to make mandatory the “Render Preview Job First” option in the Maya submitter, but the functionality of the “number of preview frames” field is compromised. For example, you input 3, the expected outcome would be to render 3 frames total from the job. But what actually happens is that it renders every 3rd frame (so 1,4,7,10…). I wish I was code savvy enough to fix this myself, but alas mel is beyond me.

Then a second question would be, what would be the best method to implement mandatory preview frames, a custom sanity check?

Thank you!

Deadline Client Version: 10.0.21.5 Release (7cef63955)
Repository Version: 10.0.21.5 (7cef63955)

Hey, I was confused by this “number of preview frames” thing, too, so I changed a few lines in the submitter to make it do what the tooltip says.

For anyone who stumbles upon this thread, here’s what I did:

In the SubmitMayaToDeadline.mel I found the lines:

if ($previewEnabled == 1)
{
	//We need to make a preview job. The preview job needs to be a dependency of the rest of frames if that is enabled
	
	//Some checks to make things are cool
	$numFrames = size($frameRange);
	if ($numFrames > $previewFrames)
	{
		$gap = $numFrames/$previewFrames;
		
		//Build the new frame lists
		for( $i = 0; $i < $numFrames; $i++ )
		{
			if( $i % $previewFrames == 0)
			{
				$previewFrameRange[size($previewFrameRange)]=$frameRange[$i];
			}
			else
			{
				$newFrameRange[size($newFrameRange)]=$frameRange[$i];
			}
		}
		$frameRange=$newFrameRange;
	}
	else
	{
		print("Preview frame is larger or equal to the number of frames in the Job, does not make any sense to create a preview Job.");
		$previewEnabled = 0;
	}
}

and replaced it with:

if ($previewEnabled == 1)
{
	//We need to make a preview job. The preview job needs to be a dependency of the rest of frames if that is enabled
	
	//Some checks to make things are cool
	$numFrames = size($frameRange);
	if ($numFrames/2 > $previewFrames-1)
	{
		if ($previewFrames == 1)
		{
			$gap = $numFrames/2;

			//Build the new frame lists
			for( $i = 0; $i < $numFrames; $i++ )
			{
				if( $i == $gap)
				{
					$previewFrameRange[size($previewFrameRange)]=$frameRange[$i];
				}
				else
				{
					$newFrameRange[size($newFrameRange)]=$frameRange[$i];
				}
			}

		}
		else
		{
			$gap = $numFrames/($previewFrames-1);
			
			//Build the new frame lists
			for( $i = 0; $i < $numFrames; $i++ )
			{
				if( $i % $gap == 0 || $i == $numFrames-1)
				{
					$previewFrameRange[size($previewFrameRange)]=$frameRange[$i];
				}
				else
				{
					$newFrameRange[size($newFrameRange)]=$frameRange[$i];
				}
			}
		}
		$frameRange=$newFrameRange;
	}
	else
	{
		print("Preview frame is larger or equal to the number of frames in the Job, does not make any sense to create a preview Job.");
		$previewEnabled = 0;
	}
}

It’s a bit longer because I included the case where the number of preview frames equals 1, which results in only the middle frame of the frame range to be submitted.
If the number of preview frames is greater than 1, I also made sure the first and last frames are always submitted.

If this is too fancy, you can get away with changing just one line. It’s not as accurate as the block of code above, but it still makes more sense than leaving it the way it is. Change:

if( $i % $previewFrames == 0)

into:

if( $i % $gap == 0)

It was probably just a typo initially.

I hope the devs can implement an official fix in one of the upcoming updates.

Thanks for the fix! Finally implementing this after months…

Hello!

Fortunately your reply bumped this up to the latest posts list so I saw it!

Unfortunately this is still broken in the latest Deadline release, but I’ve raised the issue to the folks in development, so there are eyes on it!

Privacy | Site terms | Cookie preferences