Using RepositoryUtils.GetPluginConfig(pluginName) we can get an instance of PluginConfig() class.
PluginConfig() class allows us to query any Plugin Settings defined in Deadline Monitor > Tools > Configure Plugins.
For example, we can retrieve an information on what value is currently specified in After Effect plugin “Network Windows Font Folder” field.
Let’s say Maya rendering job could query Deadline to get an information where font folder is set for After Effects.
All we need is to declare PluginConfig instance:
aeSettings=RepositoryUtils.GetPluginConfig('AfterEffects')
Having aeSettings object we proceed by asking Deadline what “Network Windows Font Folder” field is (this field has API name: ’ FontFolderNetworkWindows’) using .GetConfigEntry() method:
fontFolder = aeSettings.GetConfigEntry(' FontFolderNetworkWindows')
This Deadline feature of delivering any data from anywhere is very powerful.
But when it comes time to query App Plugin Executable filepath (based on build, OS and etc) a simple .GetConfigEntry() request is not just enough. Every pluginName.py found in DeadlineRepository/PluginName/ folder has
a dedicated RenderExecutable() function to address this need by processing a filepaths it receives from.GetConfigEntry().
While writing Deadline Event I came across a need to query Plugin executables. But since I don’t want to copy/paste RenderExecutable() function definition into my Event script I thought it would be great if I could use the ones already defined in pluginName.py scripts.
So function responsible for querying Deadline for Plugin executable turned to be simple enough:
From Event running:
[code]pluginName=job.PluginName # get job’s Plugin name (you never know what it is going to be)
pluginsDir=RepositoryUtils.GetPluginsDirectory() # get Repository plugins directory
pluginFile=os.path.join(pluginsDir, pluginName, pluginName+’.py’) # build a filepath to plugin .py module
import plugin module by filepath
import imp
pluginModule=imp.load_source(pluginName, pluginFile)
methodCall=‘pluginModule.%sPlugin()’%pluginName
pluginObject=eval(methodCall) # declare Deadline Plugin Object instance
pluginExe=pluginObject.RenderExecutable() # call to get Plugin executable path[/code]
and instead of getting Plugin’s filepath to executable receiving nasty:
RenderPluginException – Error in PreRenderTasks: RenderExecutable() callback not assigned in ManagedProcess class
Another plugin gave different error message:
RenderPluginException:
RenderPluginException – Error in PreRenderTasks: This function can only be called after the DeadlinePlugin has been fully initilized, which is not until after the DeadlinePlugin object has been returned by the global GetDeadlinePlugin function. Please use this function from one of the available callbacks for the DeadlinePlugin
Any ideas how how to get it work?