Hi
I’m just starting to set up a event plugin for cinema4d:
[code]from Deadline.Events import *
from Deadline.Scripting import *
######################################################################
This is the function that Deadline calls to get an instance of the
main DeadlineEventListener class.
######################################################################
def GetDeadlineEventListener():
return TestEvent()
######################################################################
This is the function that Deadline calls when the event plugin is
no longer in use so that it can get cleaned up.
######################################################################
def CleanupDeadlineEventListener( deadlinePlugin ):
deadlinePlugin.Cleanup()
######################################################################
This is the main DeadlineEventListener class for TestEvent.
######################################################################
class TestEvent (DeadlineEventListener):
def __init__( self ):
# Set up the event callbacks here
self.OnJobSubmittedCallback += self.OnJobSubmitted
self.OnJobFinishedCallback += self.OnJobFinished
self.OnJobStartedCallback += self.OnJobStarted
self.OnSlaveRenderingCallback += self.OnSlaveRendering
self.OnJobRequeuedCallback += self.OnJobRequeued
def Cleanup( self ):
del self.OnJobSubmittedCallback
del self.OnJobFinishedCallback
del self.OnJobStartedCallback
del self.OnSlaveRenderingCallback
del self.OnJobRequeuedCallback
def OnJobRequeued( self, job ):
if job.JobPlugin != "Cinema4D":
return
else:
ClientUtils.LogText( "!!!!!!!!!!!!!!!! C4D Requed" )
def OnJobStarted( self, job ):
if job.JobPlugin != "Cinema4D":
return
else:
ClientUtils.LogText( "!!!!!!!!!!!!!!!! C4D Started" )
def OnSlaveRendering( self, job ):
if job.JobPlugin != "Cinema4D":
return
else:
ClientUtils.LogText( "!!!!!!!!!!!! C4D Job Rendering" )
def OnJobSubmitted( self, job ):
if job.JobPlugin != "Cinema4D":
return
else:
ClientUtils.LogText( "!!!!!!!!!!!! C4D Job Submitted" )
def OnJobFinished( self, job ):
if job.JobPlugin != "Cinema4D":
return
else:
ClientUtils.LogText( "!!!!!!!!!!!! C4D Job Finished" )[/code]
But when i run it i get this error:
2015-05-21 14:52:04: An error occurred in the "OnSlaveRendering" function in events plugin 'TestEvent': TypeError : OnSlaveRendering() takes exactly 2 arguments (3 given) (Python.Runtime.PythonException)
In the Scripting reference it says that the “OnSlaveRenderingCallbak” takes 2 parameters:
GenericDelegate2< string, Job > OnSlaveRenderingCallback
What is the string parameter supposed to be?
I can’t figure out what i’m doing wrong here
Any help appreciated.
Cheers
Bonsak