AWS Thinkbox Discussion Forums

Event plugin that fires a Nuke script - Errors on load

Hi,

I have an event plugin that is triggered after the Draft Tile Assembler puts an image back together.

It triggers properly, and creates a new nuke job on the farm which should then run a test nuke script, but it gives me an GetPluginInfoEntry error and doesn’t specify what the problem is.

Full log from the slave:

[code]=======================================================
Error

Error: GetPluginInfoEntry: Script accessed non-existent plugin info key Version (Deadline.Plugins.RenderPluginException)
at Deadline.Plugins.DeadlinePlugin.GetPluginInfoEntry(String key)
at Python.Runtime.Dispatcher.TrueDispatch(ArrayList args)
at Python.Runtime.Dispatcher.Dispatch(ArrayList args)
at Deadline.Plugins.DeadlinePlugin.StartJob()
at Deadline.Plugins.DeadlinePlugin.DoStartJob()
at Deadline.Plugins.PluginWrapper.StartJob(String& outMessage, AbortLevel& abortLevel)
at Deadline.Plugins.PluginWrapper.StartJob(String& outMessage, AbortLevel& abortLevel)

=======================================================
Type

RenderPluginException

=======================================================
Stack Trace

at Deadline.Plugins.SandboxedPlugin.a(DeadlineMessage A_0)
at Deadline.Plugins.SandboxedPlugin.StartJob(Job job)
at Deadline.Slaves.SlaveRenderThread.a(TaskLogWriter A_0)

=======================================================
Log

2017-12-15 10:25:31: 0: Loading Job’s Plugin timeout is Disabled
2017-12-15 10:25:32: 0: Executing plugin command of type ‘Sync Files for Job’
2017-12-15 10:25:32: 0: All job files are already synchronized
2017-12-15 10:25:32: 0: Plugin Nuke was already synchronized.
2017-12-15 10:25:32: 0: Done executing plugin command of type ‘Sync Files for Job’
2017-12-15 10:25:32: 0: Executing plugin command of type ‘Initialize Plugin’
2017-12-15 10:25:33: 0: INFO: Executing plugin script ‘C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\slave\wks15\plugins\5a33a30ff5105a57b8f9977b\Nuke.py’
2017-12-15 10:25:33: 0: INFO: About: Nuke Plugin for Deadline
2017-12-15 10:25:33: 0: INFO: Render Job As User disabled, running as current user ‘jaime’
2017-12-15 10:25:33: 0: INFO: The job’s environment will be merged with the current environment before rendering
2017-12-15 10:25:33: 0: Done executing plugin command of type ‘Initialize Plugin’
2017-12-15 10:25:33: 0: Start Job timeout is disabled.
2017-12-15 10:25:33: 0: Task timeout is disabled.
2017-12-15 10:25:33: 0: Loaded job: teapotdenoiser (Render) - Draft Tile Assembly (5a33a30ff5105a57b8f9977b)
2017-12-15 10:25:33: 0: Executing plugin command of type ‘Start Job’
2017-12-15 10:25:33: 0: INFO: Prepping OFX cache
2017-12-15 10:25:33: 0: INFO: Checking Nuke temp path: C:\Users\jaime\AppData\Local\Temp\nuke
2017-12-15 10:25:33: 0: INFO: Path already exists
2017-12-15 10:25:33: 0: INFO: OFX cache prepped
2017-12-15 10:25:33: 0: Done executing plugin command of type ‘Start Job’

=======================================================
Details

Date: 12/15/2017 10:25:35
Frames: 0
Elapsed Time: 00:00:00:05
Job Submit Date: 12/15/2017 10:25:18
Job User: jaime
Average RAM Usage: 5758337024 (34%)
Peak RAM Usage: 5758337024 (34%)
Average CPU Usage: 4%
Peak CPU Usage: 13%
Used CPU Clocks (x10^6 cycles): 655
Total CPU Clocks (x10^6 cycles): 16353

[/code]

And the simple event plugin:

[code]###############################################################

Imports

###############################################################
import re

from System.IO import *
from System.Text import *
from System import *

from Deadline.Events import *
from Deadline.Scripting import *

##################################################################################################

This is the function called by Deadline to get an instance of the Draft event listener.

##################################################################################################
def GetDeadlineEventListener():
return NukeDenoiseListener()

def CleanupDeadlineEventListener(eventListener):
eventListener.Cleanup()

###############################################################

The event listener class.

###############################################################
class NukeDenoiseListener (DeadlineEventListener):
def init(self):
self.OnJobFinishedCallback += self.OnJobFinished

def Cleanup(self):
    del self.OnJobFinishedCallback

def OnJobFinished(self, job):


    if job.JobPlugin != "DraftTileAssembler":
        return
    
    self.LogInfo("Event Plugin: Nuke is up to something...")

    

    # Create job info file.

    jobInfoFilename = Path.Combine( ClientUtils.GetDeadlineTempPath(), "nuke_job_info2dave2.job" )

    writer = StreamWriter( jobInfoFilename, False, Encoding.Unicode )
    writer.WriteLine( "Plugin=Nuke" )
    writer.WriteLine( "Name=%s" % job.JobName )
    writer.WriteLine( "Comment=Auto Nuke Denoiser" )
    # writer.WriteLine( "Group=%s" % scriptDialog.GetValue( "GroupBox" ) )
    # writer.WriteLine( "Priority=%s" % scriptDialog.GetValue( "PriorityBox" ) )
    writer.WriteLine( "Frames=%s" % job.JobFrames )

    writer.Close()


    # Create plugin info file.

    pluginInfoFilename = Path.Combine( ClientUtils.GetDeadlineTempPath(), "nuke_plugin_info.job2dave2" )

    writer = StreamWriter( pluginInfoFilename, False, Encoding.Unicode )
    writer.WriteLine( "SceneFile=%s" % r"\\****\Projects\2017\R_N_D\_nuke\nukecomper-test.nk" )
#   writer.WriteLine( "SceneFile=%s" % sceneFile )

    writer.WriteLine( "ContinueOnError=False" )
    writer.WriteLine( "GpuOverride=0" )
    writer.WriteLine( "NukeX=False" )
    writer.WriteLine( "PerformanceProfiler=False" )
    writer.WriteLine( "RamUse=0" )
    writer.WriteLine( "RenderMode=Use Scene Settings" )
    writer.WriteLine( "ScriptJob=False" )
    writer.WriteLine( "StackSize=0" )
    writer.WriteLine( "Threads=0" )
    writer.WriteLine( "UseGpu=True" )


    writer.Close()

    ClientUtils.ExecuteCommand( (jobInfoFilename,pluginInfoFilename) )


    self.LogInfo("Event Plugin: Complete")

[/code]

If I submit the Nuke job manually it will process fine.

Any ideas?

Thanks.

Hello,

With out seeing the Error, i would say the reason the nuke job is failing, is because you havent provided it a plugininfo attribute for the “Version”.
So the Nuke plugin, doesnt know what executable to use.

example:

[code]
pluginInfoFilename = Path.Combine( ClientUtils.GetDeadlineTempPath(), “nuke_plugin_info.job2dave2” )

    writer = StreamWriter( pluginInfoFilename, False, Encoding.Unicode )
    writer.WriteLine( "SceneFile=%s" % r"\\****\Projects\2017\R_N_D\_nuke\nukecomper-test.nk" )
#   writer.WriteLine( "SceneFile=%s" % sceneFile )

    writer.WriteLine( "Version=9.06" ) # version is required by the nuke plugin in deadline
    writer.WriteLine( "ContinueOnError=False" )
    writer.WriteLine( "GpuOverride=0" )
    writer.WriteLine( "NukeX=False" )
    writer.WriteLine( "PerformanceProfiler=False" )
    writer.WriteLine( "RamUse=0" )
    writer.WriteLine( "RenderMode=Use Scene Settings" )
    writer.WriteLine( "ScriptJob=False" )
    writer.WriteLine( "StackSize=0" )
    writer.WriteLine( "Threads=0" )
    writer.WriteLine( "UseGpu=True" )


    writer.Close()[/code]

Hope this helps.

Cheers
Kym

Hey squeakybadger,

Your error message states this:

Now, there should probably be another colon in that error message to make it more obvious, ie.

but what this means is that Nuke is expecting the plugin file to contain a Version parameter so that it knows which Nuke exe it needs to launch. An example would be:

# For Nuke 10.5
writer.WriteLine( "Version=10.5" )

You may or may not run into one more of these errors after you fix this one, but I don’t think you’ll go down those code paths. A quick search of the Nuke plugin file shows that ‘Version’, ‘ScriptFilename’ and ‘WriteNode’ are the only values that don’t specify defaults. Let me know how this goes!

Cheers

I lost out to kwatts by a singular minute, drat!

:laughing:

Well you were both correct, that seems to have sorted the error, thanks :slight_smile:

On another note, can the nuke scripts read node be generated from the deadline job output image? Or will that involve a bit of python-fu on the nukescript?

Thanks again.

Glad to hear!

I believe this would require some python-fu on your part, since you’d have to modify your scene file to look at the specific output file from all the different jobs, or you’d have to copy the output image to the filepath the read node is expecting (but that might get messy).

As long as the output path is known in the original job, you have that knowledge in the event plugin which means you can pass it to the Nuke scene. Could probably have a script node in that Nuke scene that looks for this value (stored in environment variable, file, etc.) and modifies the path that the read node expects. Just throwing ideas out here.

Let me know if you find something that works for you and feel free to post it here! Others might appreciate something like this.

Cheers

Thanks Morgan,

I wasn’t sure where to start with looking at the Python side, so thanks for the suggestions.

I’ll keep this topic updated If I find a working solution.

If you want to dynamically generate an output node or even an entire nuke comp, take a look at this thread:
https://forums.thinkboxsoftware.com/viewtopic.php?f=11&t=15384&p=70605&hilit=nuke+python#p70605

You can then have a nuke python job before a nuke render job, or launch the render from the python script.

Enjoy.

Privacy | Site terms | Cookie preferences