Custom Netsend pop-up notifications

Hi All,

Is it possible to customize the pop-up message, to have the extra buttons and functionality?

I have found the script to send a pop up message, but I’m unsure how i change the pop-up message itself.

Thanks

M

Hi,
The PopUpMessage Python scripts are essentially just executing “DeadlineCommand.exe” with the following options:

deadlinecommand.exe -SendPopupMessage machineName message

where

SendPopupMessage Sends a popup message to the Deadline running on the specified machine(s) [Machine Name(s)] The machine name, or a list of machine names separated by commas. [Message] The message to send. This can be a string, or a path to a file that contains a message. [Delete Message File] (optional) If the message is stored in a file, specify 'true' to delete the file after.

So, you can edit/enhance/customise the Python scripts to your needs. I would suggest taking a copy of any script you want to edit and placing it in the equivalent path location under your “…/repository/custom/…” directory structure, so that repo upgrades don’t overwrite any customisation you might make.

It sounds like you have already found the UI/Python script we ship with Deadline, so you can use any of our existing UI API to enhance it as you see fit:
docs.thinkboxsoftware.com/produc … ntrol.html

The actual messageBox in our UI is just a “MultiLineTextControl” which can be found here:
docs.thinkboxsoftware.com/produc … 8619786a41

HI Mike,

Thanks for the swift reply, but I think this might be a bit beyond me.

I think I’ll probably just get deadline to send an automated pop-up message to the original user, then rely on the user to do something in deadline (probably right click on the draft job>scripts) to execute the other bits I need, rather than have it build into the message box itself.

Once I have the functionality working, how hard would it be to attach the script to a button on the message box?

I wouldn’t know where to start with this.

M

Ah, sounds like the pop-up message might not be what your after? To put everything into context, could you explain what you’re trying to achieve? Feel free to provide screen-grabs/description/any notes to help explain the functionality you are after.

At the moment our system works as follows:
Nuke users submit to deadline using a custom submission script.
when its rendered, deadline makes a draft job to create a stamped movie, and copies it to a couple of locations within our project structure.
When this is done Deadline emails the project leads.

What I want to happen is:
Nuke user submits to deadline
draft makes the stamped movie, in a temporary network location
A pop-up appears on the original nuke users machine with some extra buttons (see attached mockup)

If the user presses “play movie”, the file in the message opens in the default viewer (without closing the dialogue)
If the user presses “publish”, the file is copied to the correct places in the project structure (and deleted from the temp location), and it emails the project leads.

What do you think? possible?

Thanks
M
CustomPopUp.jpg

Are you using Shotgun or Ftrack already? I ask, as this functionality is already handled by them and then Deadline plays nicely with either of these systems.

Unfortunately not .

ok, in that case, I would suggest you would need to built a custom solution just for your studio here. You could use our event plugins to hook into whenever your custom Draft job has completed and then execute a non-blocking python script on a remote machine (the original users submission machine), which creates a UI for the user to interact with. You will have to consider what happens when you have multiple jobs finish for a user, as they will receive multiple dialogs popping up and potentially handle any jobs which were submitted by a users with no gui based ‘machineName’ identified to them.

Event plugins:
docs.thinkboxsoftware.com/produc … ugins.html

Execute remote command:

deadlinecommand.exe -RemoteControl machineName ExecuteNoWait ""C:\Program Files\Thinkbox\Deadline7\bin\deadlinecommandbg.exe" -ExecuteScript "/path/to/python/script.py""

That sounds like it would do the trick.

I’ll have a bash and see if i can get it working.

Thanks

I tried to do the event script and I couldn’t get it to trigger the event for some reason.

So instead I added the lines:

MachineID = "JAMES_WS2" deadlinecommand.exe -RemoteControl MachineID ExecuteNoWait '"C:\Program Files\Thinkbox\Deadline7\bin\deadlinecommandbg.exe" -ExecuteScript "R:\Realtime_R&D\MattR\DeadlineApproval\ApprovalPopup.py"'

… to the end of the draft template that is making the draft movies.

But I just seem to get a syntax error:

0: STDOUT: deadlinecommand.exe -RemoteControl MachineID ExecuteNoWait '"C:\Program Files\Thinkbox\Deadline7\bin\deadlinecommandbg.exe" -ExecuteScript "R:\Realtime_R&D\MattR\DeadlineApproval\ApprovalPopup.py"' 0: STDOUT: ^ 0: STDOUT: SyntaxError: invalid syntax 0: INFO: Process exit code: 1

Any ideas?

How are you spawning the deadlinecommand process within the Draft script?

sorry… i totally missunderstood what i was supposed to do with that code.

I am trying to run it through python now using something like this:
[coderun = ‘“C:\Program Files\Thinkbox\Deadline6\bin\deadlinecommandbg.exe” -SendPopupMessage James_WS2 message’
import os
os.system(run)[/code]

but it doesn’t seem to want to work at the moment.

I made a bit of progress.

I didn’t realize that i needed to have the deadline path in the Path environment variable. (noob error!)
I’m happy with python inside a Nuke world, but this is my first attempt to do things outside.

So I have got my event to make a popup appear on my machine (i’ll need to pass the correct machine name as a variable at some point), but for some reason it wont run my deadline python UI script.
If you put the python script in deadline/custom/scripts/general and run it through the monitor it works, so I’ve definitely done something wrong and I’ve just made a deadline monitor python script, not a script in its own right.

I’ve attached the python UI i’m trying to run remotely.

Thanks for bearing with me.

M
ApprovalUI.zip (1.08 KB)

You shouldn’t need to add the DEADLINE_PATH sys env variable to your PATH as you can just feed the full path to where DeadlineCommand.exe resides under “Program Files”.
ie:

"C:/Program Files/Thinkbox/Deadline7/bin/DeadlineCommand.exe"

If you were to type “set” into a command prompt, you should see this variable listed:

DEADLINE_PATH=C:\Program Files\Thinkbox\Deadline7\bin

Your script looks pretty much fine. I made some tweaks but otherwise it works fine for me. It must be how you are remotely executing it? The remote machine needs to be able to resolve the path to where this script file is stored. ie: it can be local on your machine.

ApprovalUI.py.zip (1.47 KB)

I tried to replace the DeadlineCommand.exe with the full path (NB. we are running Deadline6):
ie.

C:\Program Files\Thinkbox\Deadline6\bin\deadlinecommand.exe

but it wouldn’t work.

But I did get it working in the end by using:

machine = "James_WS2" run = "deadlinecommand.exe -RemoteControl " + machine + ' ExecuteNoWait ""deadlinecommandbg.exe" -ExecuteScript "\\\\maxdaddy\DeadlineRepository6\custom\scripts\General\ApprovalUI.py""' os.system(run)

So now it successfully runs the script on the machine James_WS2.

The next bit is:
How to do I pass 2 variables from the Draft job to the event?
How do pass 1 of those variables from the event to the python script it executes?

Really appreciate all your help.

The event plugin already returns the job object in its “OnJobFinished” Callback, so you can access any of the props from your completed job. Let’s say you wanted the job plugin type to make sure you only touch MayaBatch jobs & only if an ExtraInfo0 property is equal to “True”

[code]def OnJobFinished( self, job ):

# Check if this is a completed MayaBatch Job, if not let's get out of here ASAP
if job.JobPlugin != "MayaBatch":
    return

specialProperty = bool(job.JobExtraInfo0)
if not specialProperty:
     return

# do stuff here, as we now know we have a completed MayaBatch job with our special ExtraInfo0 property set to True[/code]

When you pass the python script into the “-ExecuteScript” command you could pass it additional arguments and then pick them up in your Approval script.

“-ExecuteScript “…/path/to/your/Approval.py” arg1 arg2”

then in your script:

[code]#make sure you add “*args” to the main function
def main( *args ):

if len( args ) > 0:
    arg1 = args[0]
    arg2 = args[1]

if args[0] == "":
    scriptDialog.ShowMessageBox( "Arg1 is Missing!", "Error" )
    return[/code]

Thanks Mike,

that all works a treat!

this really is the last bit - i promise

is there a command to send email notifications?
like the automatic email notifications that are setup in the repository options, but with custom recipient addresses, email subject and message content?

No problem.

Sure, check out this “DeadlineCommand -SendEmail”:

SendEmail Sends an email [-to <Email>] TO email address [-subject <Subject>] The subject [-message <Message>] The message, or the path to the file that contains the message [-cc <Email>] CC email address (optional) [-attach <Attachment>] Attachment file (optional)

There’s a good example of it being used in the TransferJob plugin

I also stumbled across a manual example we have as well:
docs.thinkboxsoftware.com/produc … g-an-email

That’s great - all working now.

the only thing is there is a bit of a delay when you press the approval button (I guess its just connecting to the mail server etc).

But I’ll work on having a second dialogue to tell you to wait, that then closes when its complete.

Thanks again - great support as always