AWS Thinkbox Discussion Forums

Debugging submit scripts

I’ve customized the Maya python submission script but I’m having issues with it. The problem is that I get no error feedback when calling the script within Maya. I’ve attempted to write a basic script to call from the Monitor that has hard coded variables and calls my submission script using the deadlinecommandbg.exe. This didn’t work. So I’m hoping for some better guidance as to a better way to debug my submission scripts.

Try using “deadlinecommand.exe” instead of “deadlinecommandbg.exe”

Hey Mike!

So I gave that a try, it seemed like it was going to work because a command line window came up. But It’s still erroring out with:

2017-01-13 12:32:21: File “DeadlineUI/Commands/ScriptCommands.py”, line 110, in InnerExecute
2017-01-13 12:31:33: PythonNetException: AttributeError : ‘module’ object has no attribute ‘main

This is actually the same error I get when I am using “deadlinecommandbg.exe”

Have you declared a main function in your script?

Yes sir! I just grabbed the MayaSubmission.py and added some functionality and UI changes. But the basic structure was left unchanged…save for adding *args to the __main__function. I’m pretty sure there is some funkiness going on with my additional code, but I can’t really debug it properly.

i.e.

[code]def main( *args ):
global scriptDialog
global settings
global defaultLocation
global outputBox
global sceneBox

defaultLocation = ""

scriptDialog = DeadlineScriptDialog()
scriptDialog.SetTitle( "Submit Maya Job To Deadline" )
scriptDialog.SetIcon( scriptDialog.GetIcon( 'MayaBatch' ) )[/code]

You seem to be missing any import statements at the top of the script. Critically, you will need to import the Deadline Scripting namespace. You can see how that looks if you take a peek at any of our other monitor submitter scripts.

Oh I just didn’t copy and paste those over. Like I said, I’m pretty much using the basic Maya submit script from the repository.

I’ve attached my customized MayaSubmission.py and the test script I’m using to try and launch it from the Monitor.
Maya.rar (11.4 KB)

Hi,

So usually the Inner execution occurs (in most of my cases) when trying to set data methods are used.
in your case, when i run this in DL, 7.2, it looks like no args are being passed to the ui, and nothing is checking to see if its set.
in: VISMO_MayaRenderSubmission.py

if you search for:

scriptDialog.SetValue( "SceneBox", args[0] )

and then comment out all the lines until you reach:

scriptDialog.SetValue( "NameBox", jobName )

your code will load in the monitor.

If you put a print statement above, to print the args, it is returning an empty list.
Not sure why dl thinks its a tuple…

Hope this helps.

So I missed the part where I needed to put a def__main__() function in my script that I’m calling from the Monitor (which is calling my maya submit script). It’s running now but I’m not getting any results still.

@kwatts - How are you running my submit script in the Monitor and passing arguments into it? That’s really what I’m trying to do so I can get some sort of error logging. When I run the submit script via the command line with deadlinecommandbg.exe it doesn’t provide any feedback from Deadline.

Hello,

So if you drop the script:
VISMO_MayaRenderSubmission.py

into your repository folder structure in either here:
\scripts\Submission
or here (we use this so we have clean un edited versions of the original subitters to compare to.):
\custom\scripts\Submission

Then in The deadline monitor, your submission script *should show up o the Submit menu. * if it does not, then run Tools > Synchronize scripts and plugins.
It should then show up.

The i will also have a console panel open, to see why the scripts fail.
This workflow allows me to iterate the fastest, while writing monitor scripts.

*Edit, i have made the changes that allow me to run this in the monitor without the tuple editor. This should run for you.

Cheers
Kym
VISMO_MayaRenderSubmission.zip (11 KB)

Ah yes, I do know about that. But my issue is that I need to pass along arguments to the submission script itself. I am doing this by writing my own launcher script that calls the submit script and passes along arguments to it. In my launcher script I am building a command for the deadlinecommandbg.exe and using the subprocess module to run that command.

[code]import subprocess

launchDeadline = [deadlinecommandbg, ‘-executescript’, script, sceneFileFull, frameRange, outputPath, fileTypeBox, projectCode, projectPhase, mayaVersion, frameSize, projectPath, cameraNamesString]

process = subprocess.Popen(launchDeadline, stdout=subprocess.PIPE)[/code]

But this won’t provide me with any error feedback. So I’m trying to find a way to run the submit script in the Monitor and pass along arguments to it in the process. Then I could pinpoint where exactly my submit script is failing.

Sorry James, this is out side of my knowledge base.

Quick question thou, when you run this, are you expecting the submit panel to come up so the artist still configures the job, but for submitting, or are you hoping that this just submits to the job to deadline without the ui opening?

Our pipeline is this:

  • Launcher script. This runs from within the CG software the artist is using (i.e. Modo, Maya, Nuke). This script gathers the relevant scene information from the software package and compiles it in a way to be passed along as arguments to the Deadline submission script. The submission script is launched from within the software packages using the subprocess module in Python (as I showed in my last post).

  • Deadline submission script. This is a modified version of the base scripts that ship with Deadline. I modify it so that it accepts the arguments passed along. The reason for this is so that the artist doesn’t have to worry about filling in the submitter with scene information every time they launch a job. All they have to do is set pool, group, and priorities (but this is usually stored in an .ini file to remember past use).

I actually have this working for Modo and Nuke. It was a pretty simple matter for adapting it for Maya. So I’m kind of confused as to why it’s not working for me. The last time I did this for Modo, it was a silly little typo bug that delayed me for a few days. So I’m sure it’s something going on in my submitter modifications. But not having any error feedback makes debugging a pain.

I hope this answered your question. :slight_smile:

Hi James,

The Python syntax to run an in-app py submitter code but in the context of the Deadline Monitor is a bit different, as within Deadline’s Monitor environment we use the shipping Python inside of Deadline, whilst all our in-app submitters rely on whatever the DCC app is using. Looking at your Python snippet you posted earlier, you should be able to execute that inside of Maya’s built-in Python Script Editor as it is simply subprocess, right? (you could temporarily hard-code values for each of the variables you are passing to it, for testing purposes). I suspect trying to make your in-app submitter code run but within our Monitor is confusing things here for you (as Kim mentioned, you need to import py modules specific to Monitor) and ultimately, isn’t what you are trying to achieve anyway. Just to clarify, the difference between DeadlineCommand and DeadlineCommandBG if you weren’t already aware:

(Snippet from our docs):
docs.thinkboxsoftware.com/produc … d.html#faq

Hey Mike,

I was figuring my method wasn’t the right one. I have hard coded my values into my submitter script and I’m not getting any errors when I call it through the Monitor. So I’m suspecting that my code has a bug somewhere with the way I’m passing the arguments. But knowing the difference between deadlinecommand and deadlinecommandbg might be helpful. Although, if I use deadlinecommand, shouldn’t that give me exit code and output right there in my cmd window?

Any one have an idea as to where this temp directory lives?

EDIT:

I found it (%USERPROFILE%\AppData\Local\Thinkbox\Deadline8\temp). Unfortunately nothing is being written out to the logs so I’m still unable to get any error feedback.

Hi,
Could you provide some boilerplate code of what you are trying to execute here in the cmd shell and I’ll try it over here.

Hey Mike, here is the the foundation of what I am using to launch my scripts (sans passing any arguments). This is simply calling the default Maya submission script. When I run this it appears like the submission window pops up for less then a second.

[code]import os
import sys, string
import subprocess

def main():
deadlinebin = os.environ[‘DEADLINE_PATH’].split(os.pathsep)
deadlinebin = deadlinebin[0]
deadlinecommand = deadlinebin + “\” + “deadlinecommand.exe”
deadlinecommandbg = deadlinebin + “\” + “deadlinecommandbg.exe”

# Call DeadlineCommand to launch the monitor script file.
deadlinecmd = [deadlinecommand, '-getrepositoryroot']
p = subprocess.Popen(deadlinecmd, stdout=subprocess.PIPE)
root = p.stdout.read()
root = root.rstrip()
print ("Root: " + root)
script = root + "\scripts\Submission\MayaSubmission.py"

launchDeadline = [deadlinecommandbg, '-executescript', script]
print launchDeadline
process = subprocess.Popen(launchDeadline, stdout=subprocess.PIPE)

main()[/code]

Hey Mike, have you had a chance to test this out. I’m kind of spinning my wheels here so I’m hoping something comes from your tests.

James

EDIT: So as is typical, I found the solution to my problem minutes after I sent this. I failed to set this line to true:

scriptDialog.ShowDialog( False )

In the default MayaSubmission.py it’s set as false. But I needed to have it set as true in order to display the UI.

I’d still very interested in a better way of debugging these submission scripts.

Hi James,
Finally, getting a chance to loopback on this topic. Looks like you got yourself sorted it seems now. I still hold out some hope for some kind of script editor panel in Monitor, which I think would help answer many of your questions/request for easier code editing in the future.

Privacy | Site terms | Cookie preferences