Submit to modo question

So I’m trying to turn the PassGroup option box into a list box that contains all of the pass groups in my modo scene. I’ve modified the ModoSubmission.py to change it into a list box. I’m sending the variables to Deadline with this line of code:

launchDeadline = [‘C:\Program Files\Thinkbox\Deadline6\bin\deadlinecommandbg.exe’, ‘-executescript’, script, sceneFileFull, frameRange, outPath, fileName, fileFormat, modoVersion, projectCode, projectPhase, frameSize, fileType, passGroupNames]

passGroupNames is a list and when it gets passed into the PassBox is creates a list of every letter in that list. So it comes out like so:

t
e
s
t
1
t
e
s
t
2

This is the line of code i’m using in the ModoSubmission.py:

scriptDialog.SetValue( “PassBox”, args[10] )

I know this is kind of scatter shot since it’s the end of the day. If you guys need more info to help me out I can pass along my code files.

Thanks!

Sorry for the bump. I’d like to get this resolved today and I’m pretty much stumped on this. I’m beginning to think it’s not possible to pass a list through the DeadlineLauncher command.

I think you want to use SetItems here, not SetValue. For example:

passGroups = args[10].split(",")
scriptDialog.SetItems( "PassBox", passGroups )
scriptDialog.SetValue( "Passbox", passGroups[0] )

Note that this assumes you’re passing the list in the command line as a comma separate string. It then sets the items, and then sets the initial selection to the first pass group.

Cheers,
Ryan

Ah yes, sorry I was using setItems initially. But it’s the split that I was missing.

So when you say that it should be a comma separated string, what do you mean? I’m setting a list variable with a list I get from gathering the PassGroups in my modo scene. Then I’m inserting a “” in the front of the list to provide no choice option for the PassBox. That list variable is being sent to the LaunchDeadline command as is. When I do a print prior to calling the command I get a comma separated print out. But seeing that I am getting one big string in the list box I’m assuming I’m missing something else.

Thanks!

I’m sorry, I explained my methodology wrong. Since Modo gives me it’s own internal names for each passGroup, I’m looping through that list to get the name I gave it, then I’m appending those names into another list variable.

To elaborate on Ryan’s answer, he means that to use his particular code snippet (with the .split(",") call) you would need to format the argument you pass to the script (ie, ‘passGroupNames’) as a comma separated string, as opposed to a an array, something like this:

passGroupString = ",".join( passGroupNames ) #this turns a list of strings into a single string, separating items with commas
launchDeadline = ['C:\\Program Files\\Thinkbox\\Deadline6\\bin\\deadlinecommandbg.exe', '-executescript', script, sceneFileFull, frameRange, outPath, fileName, fileFormat, modoVersion, projectCode, projectPhase, frameSize, fileType, passGroupString ]

Alternatively, if you don’t want to do that for whatever reason, you could send each list item as its own argument, and assume anything in the ‘args’ list >= 10 is a pass group name:

launchDeadline = ['C:\\Program Files\\Thinkbox\\Deadline6\\bin\\deadlinecommandbg.exe', '-executescript', script, sceneFileFull, frameRange, outPath, fileName, fileFormat, modoVersion, projectCode, projectPhase, frameSize, fileType ]
launchDeadline.extend( passGroupNames )

And then in ModoSubmission.py:

passGroups = args[10:] #the colon here is important!
scriptDialog.SetItems( "PassBox", passGroups )
scriptDialog.SetValue( "Passbox", passGroups[0] )

Hope this helps!

  • Jon

Ahhh, that’s a concept that I wasn’t familiar with. Sweet, learning some new stuff today. Thanks!!