Hi
Im trying to modify the Vray spawner plugin to start the vray standalone that comes with Vray for c4D. Vrayc4d is now at version 1.8 (Vray 2.4) and now supports DR. As there is no spawner app (osx) included with the Vrayc4d, i usually start the server with this argument to use DR with Cinema: “/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray -server”. But if i use that as a predefined executable in my custom Vray spawner plugin, i get this error:
Error in RenderExecutable: Cinema4D VRay Spawner executable was not found in the semicolon separated list "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray -server".
If i just point to ./vray without the “-server” argument, the job starts but the server is not started on the slave.
In VraySpawner.py, you need to add a callback for RenderArgument, and then return “-server” as your render argument. See the code below.
Cheers,
Ryan
from System.IO import *
from Deadline.Scripting import *
from Deadline.Plugins import *
def GetDeadlinePlugin():
return VraySpawnerPlugin()
def CleanupDeadlinePlugin( deadlinePlugin ):
deadlinePlugin.Cleanup()
class VraySpawnerPlugin(DeadlinePlugin):
def __init__(self):
self.InitializeProcessCallback += self.InitializeProcess
self.RenderExecutableCallback += self.RenderExecutable
self.RenderArgumentCallback += self.RenderArgument
def Cleanup(self):
for stdoutHandler in self.StdoutHandlers:
del stdoutHandler.HandleCallback
del self.InitializeProcessCallback
del self.RenderExecutableCallback
del self.RenderArgumentCallback
def InitializeProcess(self):
self.SingleFramesOnly=False
self.StdoutHandling=False
def RenderExecutable(self):
version = self.GetPluginInfoEntry( "Version" )
vrayExeList = self.GetConfigEntry("VRaySpawnerExecutable_" + version)
vrayExe = FileUtils.SearchFileList( vrayExeList )
if( vrayExe == "" ):
self.FailRender( version + " VRay Spawner executable was not found in the semicolon separated list \"" + vrayExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." )
return vrayExe
def RenderArgument(self):
return "-server"
Hi
Thanks, thats great!
Should Deadline automatically quit the Vray standalone when i set the job to complete? As it is now the vray.bin process i still running after the jobs is set to complete.
Yes the slaves are idle but the vray.bin is still running on the machines. It might have something to do with the way Vray is started. The executable on osx is:
But the "“vray” executable just points to another executable called vray.bin like this:
#!/bin/bash
export DYLD_LIBRARY_PATH=/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/lib/snow_leopard_x64/gcc-4.2
export PYTHONHOME=/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/Python
export PYTHONPATH=/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/Python/lib/python2.6/site-packages:$PYTHONPATH
/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray.bin $*
If i set the executable to vray.bin in Deadline it errors out because it cant find the gcc-4.2 lib
So it might be that Deadline only has control of the first executable and has no notion of the vray.bin process.
Strange… Deadline should be aware of the entire process tree.
Can you post the log from the slave when it was working on this job? From the Slave menu, just select Help -> Explore Log Folder, and find the corresponding slave log.
So just to confirm, after this error occurs, vray.bin is still running? Or was that maybe an existing instance that is continuing to run?
Also, which version of Deadline 6.1 are you running? It seems to be a Python-related issue, and we’ve resolved some general issues like these during the beta. If you’re on the RC1, you may need to make some additional changes to the plugin.
No the previous log is what happens if i use “vray.bin” as executable instead of just “vray”.
Heres the slave log when using “vray -server” as executable. Deadline is RC1. After this job is set to complete and the slave is idle, the vray.bin process is still running:
Scheduler Thread - Synchronizing job auxiliary files from /Volumes/DeadlineRepository6/jobs/52cedbefbd659398979fdc92
Scheduler Thread - All job files are already synchronized
Scheduler Thread - Synchronizing plugin files from /Volumes/DeadlineRepository6/custom/plugins/VraySpawner
Scheduler Thread - Synchronization time for plugin files: 21.024 ms
Constructor: VraySpawner
0: Task timeout is disabled.
0: Loaded job: Untitled (52cedbefbd659398979fdc92)
0: INFO: Executing plugin script /Users/bonsak/Library/Application Support/Thinkbox/Deadline6/slave/Bonsak-work/plugins/52cedbefbd659398979fdc92/VraySpawner.py
0: INFO: About: VRay Spawner Plugin for Deadline
0: INFO: The current environment will be used for rendering
0: Plugin rendering frame(s): 0
0: INFO: Stdout Handling Enabled: False
0: INFO: Popup Handling Enabled: False
0: INFO: Using Process Tree: True
0: INFO: Hiding DOS Window: True
0: INFO: Creating New Console: False
0: INFO: Executable: "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray"
0: INFO: Argument: -server -verboseLevel=3
0: INFO: Startup Directory: "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2"
0: INFO: Process Priority: BelowNormal
0: INFO: Process Affinity: default
0: INFO: Process is now running
0: STDOUT: [2014/Jan/9|18:27:59] Reading configuration from "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2//vrayconfig.xml"
0: STDOUT: [2014/Jan/9|18:27:59] ===============================================
0: STDOUT: [2014/Jan/9|18:27:59] V-Ray Standalone, version 2.25.01 for x64
0: STDOUT: [2014/Jan/9|18:27:59] Copyright (C) 2000-2012 Chaos Group Ltd. All rights reserved.
0: STDOUT: [2014/Jan/9|18:27:59] Use -credits option for additional third-party copyright notices.
0: STDOUT: [2014/Jan/9|18:27:59]
0: STDOUT: [2014/Jan/9|18:27:59] Build from Oct 7 2013, 18:16:04
0: STDOUT: [2014/Jan/9|18:27:59] Compiled with GCC-compatible compiler, version 4.2
0: STDOUT: [2014/Jan/9|18:27:59] Operating system is Mac OS X
0: STDOUT: [2014/Jan/9|18:27:59]
0: STDOUT: [2014/Jan/9|18:27:59] V-Ray core version is 2.00.02
0: STDOUT: [2014/Jan/9|18:27:59] ===============================================
0: STDOUT: [2014/Jan/9|18:27:59]
0: STDOUT: [2014/Jan/9|18:27:59] Loading plugins from "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_*.so"
0: STDOUT: [2014/Jan/9|18:27:59] warning: Open of shared library `/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_MtlGLSL.so' failed because:
0: STDOUT: [2014/Jan/9|18:27:59] warning: dlopen(/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_MtlGLSL.so, 5): Library not loaded: ./lib/snow_leopard_x64/gcc-4.2/libglslang.dylib
0: STDOUT: Referenced from: /Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_MtlGLSL.so
0: STDOUT: Reason: image not found
0: STDOUT: [2014/Jan/9|18:27:59] warning: Duplicate plugin IDs: MtlVismat and MtlVRmat
---- 2014/01/09 18:28 ----
0: STDOUT: [2014/Jan/9|18:27:59] 132 plugin(s) loaded successfully
0: STDOUT: [2014/Jan/9|18:27:59] Loading plugins from "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libstd_*.so"
0: STDOUT: [2014/Jan/9|18:27:59] Finished loading plugins.
0: STDOUT: [2014/Jan/9|18:27:59] Entering server mode - waiting for render requests on port 20207. Press Ctrl+C to exit.
Connecting to slave log: Bonsak-work
Scheduler Thread - Task "0_0-0" could not be found because task has been modified:
current status = Rendering, new status = Completed
current slave = Bonsak-work, new slave = Bonsak-work
current frames = 0-0, new frames = 0-0
Scheduler Thread - Cancelling task...
0: In the process of canceling current task: ignoring exception thrown by PluginLoader
Scheduler Thread - In the process of canceling current tasks: ignoring exception thrown by render thread 0
Thanks! Let’s try one thing before we attempt using vray.bin directly. Here is some updated plugin code:
from System.IO import *
from Deadline.Scripting import *
from Deadline.Plugins import *
def GetDeadlinePlugin():
return VraySpawnerPlugin()
def CleanupDeadlinePlugin( deadlinePlugin ):
deadlinePlugin.Cleanup()
class VraySpawnerPlugin(DeadlinePlugin):
def __init__(self):
self.InitializeProcessCallback += self.InitializeProcess
self.RenderExecutableCallback += self.RenderExecutable
self.RenderArgumentCallback += self.RenderArgument
def Cleanup(self):
for stdoutHandler in self.StdoutHandlers:
del stdoutHandler.HandleCallback
del self.InitializeProcessCallback
del self.RenderExecutableCallback
del self.RenderArgumentCallback
def InitializeProcess(self):
self.SingleFramesOnly=False
self.StdoutHandling=False
self.AddStdoutHandlerCallback(".*Entering server mode.*").HandleCallback += self.Testing
def RenderExecutable(self):
version = self.GetPluginInfoEntry( "Version" )
vrayExeList = self.GetConfigEntry("VRaySpawnerExecutable_" + version)
vrayExe = FileUtils.SearchFileList( vrayExeList )
if( vrayExe == "" ):
self.FailRender( version + " VRay Spawner executable was not found in the semicolon separated list \"" + vrayExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." )
return vrayExe
def RenderArgument(self):
return "-server"
def Testing(self):
self.LogInfo( "PROCESS IDS:" )
for pid in self.GetProcessIDs():
self.LogInfo( " " + str(pid) )
It should print the IDs for the processes that Deadline is aware of. You can then run ps -A in a terminal to compare them to all currently running processes and see if the vray.bin one is one of the processes that Deadline is aware of.
Thank you!
The slave log doesn’t print any “PROCESS IDS:” statements with the updated code though, but the “vray.bin” is being started when running the script. And its still running after job is completed. ps -A only lists one vray process (vray.bin)
Constructor: VraySpawner
0: Task timeout is disabled.
0: Loaded job: Untitled (52cf30538147e1de16a3d904)
0: INFO: Executing plugin script /Users/bonsak/Library/Application Support/Thinkbox/Deadline6/slave/Bondes/plugins/52cf30538147e1de16a3d904/VraySpawner.py
0: INFO: About: VRay Spawner Plugin for Deadline
0: INFO: The current environment will be used for rendering
0: Plugin rendering frame(s): 0
0: INFO: Stdout Handling Enabled: False
0: INFO: Popup Handling Enabled: False
0: INFO: Using Process Tree: True
0: INFO: Hiding DOS Window: True
0: INFO: Creating New Console: False
0: INFO: Executable: "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray"
0: INFO: Argument: -server
0: INFO: Startup Directory: "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2"
0: INFO: Process Priority: BelowNormal
0: INFO: Process Affinity: default
0: INFO: Process is now running
0: STDOUT: [2014/Jan/10|00:27:43] Reading configuration from "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2//vrayconfig.xml"
0: STDOUT: [2014/Jan/10|00:27:43] ===============================================
0: STDOUT: [2014/Jan/10|00:27:43] V-Ray Standalone, version 2.25.01 for x64
0: STDOUT: [2014/Jan/10|00:27:43] Copyright (C) 2000-2012 Chaos Group Ltd. All rights reserved.
0: STDOUT: [2014/Jan/10|00:27:43] Use -credits option for additional third-party copyright notices.
0: STDOUT: [2014/Jan/10|00:27:43]
0: STDOUT: [2014/Jan/10|00:27:43] Build from Oct 7 2013, 18:16:04
0: STDOUT: [2014/Jan/10|00:27:43] Compiled with GCC-compatible compiler, version 4.2
0: STDOUT: [2014/Jan/10|00:27:43] Operating system is Mac OS X
0: STDOUT: [2014/Jan/10|00:27:43]
0: STDOUT: [2014/Jan/10|00:27:43] V-Ray core version is 2.00.02
0: STDOUT: [2014/Jan/10|00:27:43] ===============================================
0: STDOUT: [2014/Jan/10|00:27:43]
0: STDOUT: [2014/Jan/10|00:27:43] Loading plugins from "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_*.so"
0: STDOUT: [2014/Jan/10|00:27:43] warning: Open of shared library `/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_MtlGLSL.so' failed because:
0: STDOUT: [2014/Jan/10|00:27:43] warning: dlopen(/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_MtlGLSL.so, 5): Library not loaded: ./lib/snow_leopard_x64/gcc-4.2/libglslang.dylib
0: STDOUT: Referenced from: /Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_MtlGLSL.so
0: STDOUT: Reason: image not found
0: STDOUT: [2014/Jan/10|00:27:44] warning: Duplicate plugin IDs: MtlVismat and MtlVRmat
0: STDOUT: [2014/Jan/10|00:27:44] 132 plugin(s) loaded successfully
0: STDOUT: [2014/Jan/10|00:27:44] Loading plugins from "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libstd_*.so"
0: STDOUT: [2014/Jan/10|00:27:44] Finished loading plugins.
0: STDOUT: [2014/Jan/10|00:27:44] Entering server mode - waiting for render requests on port 20207. Press Ctrl+C to exit.
---- 2014/01/10 00:29 ----
0: STDOUT: [2014/Jan/10|00:29:24] Starting DR session from 127.0.0.1
0: STDOUT: [2014/Jan/10|00:29:24] Receiving DR scene from 127.0.0.1
0: STDOUT: [2014/Jan/10|00:29:24] Reading scene file "/tmp/vrscene_20207.txt"
0: STDOUT:
[2014/Jan/10|00:29:24] /tmp/vrscene_20207.txt: done [ 0h 0m 0.0s]
0: STDOUT: [2014/Jan/10|00:29:24] Scene file parsed successfully in 0.0 s.
0: STDOUT: [2014/Jan/10|00:29:24] Scene created successfully.
0: STDOUT: [2014/Jan/10|00:29:24] Objects in scene: 34
0: STDOUT: [2014/Jan/10|00:29:24] Starting render sequence.
0: STDOUT: [2014/Jan/10|00:29:24] Preparing renderer...
0: STDOUT:
Preparing scene for rendering...: 0.00% [ 0h 1m 40.3s] [ 0h 0m 0.0s est]
[2014/Jan/10|00:29:24] Preparing scene for rendering...: done [ 0h 0m 0.0s]
0: STDOUT: [2014/Jan/10|00:29:24] warning: Subpixel color mapping is on: rendered result may have incorrect brightness.
0: STDOUT: [2014/Jan/10|00:29:24] warning: The 'linear workflow' option is deprecated and will be removed. Consider turning it off.
0: STDOUT: [2014/Jan/10|00:29:24] ========================
0: STDOUT: [2014/Jan/10|00:29:24] Starting frame 0.
0: STDOUT:
Preparing scene for frame...: 0.00% [ 0h 1m 40.3s] [ 0h 0m 0.0s est]
[2014/Jan/10|00:29:24] Preparing scene for frame...: done [ 0h 0m 0.0s]
0: STDOUT:
Compiling geometry...: 0.00% [ 0h 1m 40.3s] [ 0h 0m 0.0s est]
[2014/Jan/10|00:29:24] Compiling geometry...: done [ 0h 0m 0.0s]
0: STDOUT:
Building static raycast accelerator...: 0.00% [ 0h 1m 40.3s] [ 0h 0m 0.0s est]
[2014/Jan/10|00:29:24] Building static raycast accelerator...: done [ 0h 0m 0.0s]
0: STDOUT: [2014/Jan/10|00:29:24] SDTree statistics:
0: STDOUT: [2014/Jan/10|00:29:24] Total number of faces stored: 812
0: STDOUT: [2014/Jan/10|00:29:24] Max tree depth: 13
0: STDOUT: [2014/Jan/10|00:29:24] Average tree depth: 9.18412
0: STDOUT: [2014/Jan/10|00:29:24] Number of tree nodes: 553
0: STDOUT: [2014/Jan/10|00:29:24] Number of tree faces: 2060
0: STDOUT: [2014/Jan/10|00:29:24] Number of tree leafs: 277
0: STDOUT: [2014/Jan/10|00:29:24] Average faces/leaf: 7.43682
0: STDOUT: [2014/Jan/10|00:29:24] Memory usage: 1.70 MB
0: STDOUT:
Rendering image...: 0.00% [ 0h 1m 40.3s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 0.2s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 0.4s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 0.6s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 0.8s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 1.0s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 1.2s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 1.4s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 1.6s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 1.8s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 2.0s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 2.2s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 2.4s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 2.6s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 2.8s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 3.0s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 3.2s] [ 0h 0m 0.0s est]
Rendering image...: 0.00% [ 0h 0m 3.4s] [ 0h 0m 0.0s est]
[2014/Jan/10|00:29:27] Rendering image...: done [ 0h 0m 3.5s]
0: STDOUT: [2014/Jan/10|00:29:27] Number of raycasts: 421960
0: STDOUT: [2014/Jan/10|00:29:27] Camera rays: 299603
0: STDOUT: [2014/Jan/10|00:29:27] Shadow rays: 122357
0: STDOUT: [2014/Jan/10|00:29:27] GI rays: 0
0: STDOUT: [2014/Jan/10|00:29:27] Reflection rays: 0
0: STDOUT: [2014/Jan/10|00:29:27] Refraction rays: 0
0: STDOUT: [2014/Jan/10|00:29:27] Unshaded rays: 0
0: STDOUT: [2014/Jan/10|00:29:27] Number of intersectable primitives: 812
0: STDOUT: [2014/Jan/10|00:29:27] SD triangles: 812
0: STDOUT: [2014/Jan/10|00:29:27] MB triangles: 0
0: STDOUT: [2014/Jan/10|00:29:27] Static primitives: 0
0: STDOUT: [2014/Jan/10|00:29:27] Moving primitives: 0
0: STDOUT: [2014/Jan/10|00:29:27] Infinite primitives: 0
0: STDOUT: [2014/Jan/10|00:29:27] Closing DR session from 127.0.0.1
---- 2014/01/10 00:30 ----
Connecting to slave log: Bondes
Scheduler Thread - Task "0_0-0" could not be found because task has been modified:
current status = Rendering, new status = Completed
current slave = Bondes, new slave = Bondes
current frames = 0-0, new frames = 0-0
Scheduler Thread - Cancelling task...
0: In the process of canceling current task: ignoring exception thrown by PluginLoader
Scheduler Thread - In the process of canceling current tasks: ignoring exception thrown by render thread 0
Update timeout has been set to 300 seconds
Stdout Handling Enabled: False
Popup Handling Enabled: False
Using Process Tree: True
Hiding DOS Window: True
Creating New Console: False
Executable: "/Applications/Thinkbox/Deadline6/Resources/deadlinecommand"
Thanks for trying that. Give this plugin code a try with vray.bin as the executable:
from System import *
from System.IO import *
from Deadline.Scripting import *
from Deadline.Plugins import *
def GetDeadlinePlugin():
return VraySpawnerPlugin()
def CleanupDeadlinePlugin( deadlinePlugin ):
deadlinePlugin.Cleanup()
class VraySpawnerPlugin(DeadlinePlugin):
def __init__(self):
self.InitializeProcessCallback += self.InitializeProcess
self.RenderExecutableCallback += self.RenderExecutable
self.RenderArgumentCallback += self.RenderArgument
def Cleanup(self):
for stdoutHandler in self.StdoutHandlers:
del stdoutHandler.HandleCallback
del self.InitializeProcessCallback
del self.RenderExecutableCallback
del self.RenderArgumentCallback
def InitializeProcess(self):
self.SingleFramesOnly=False
self.StdoutHandling=False
def RenderExecutable(self):
version = self.GetPluginInfoEntry( "Version" )
vrayExeList = self.GetConfigEntry("VRaySpawnerExecutable_" + version)
vrayExe = FileUtils.SearchFileList( vrayExeList )
if( vrayExe == "" ):
self.FailRender( version + " VRay Spawner executable was not found in the semicolon separated list \"" + vrayExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." )
vrayPath = Path.GetDirectoryName( vrayExe )
pythonHome = Path.Combine( vrayPath, "Python" )
pythonSitePackages = Path.Combine( pythonHome, "lib/python2.6/site-packages" )
self.SetEnvironmentVariable( "DYLD_LIBRARY_PATH", vrayPath )
self.SetEnvironmentVariable( "PYTHONHOME", pythonHome )
pythonPath = Environment.GetEnvironmentVariable( "PYTHONPATH" )
if pythonPath != None and pythonPath != "":
self.SetEnvironmentVariable( "PYTHONPATH", pythonSitePackages + Path.PathSeparator + pythonPath )
else:
self.SetEnvironmentVariable( "PYTHONPATH", pythonSitePackages )
return vrayExe
def RenderArgument(self):
return "-server"
Note that I haven’t tested this, so hopefully there aren’t any syntax errors.
What we’re doing is setting up the environment in the same way that the “vray” shell script was. So in theory, this should fix those errors about missing libraries that you were getting before.
from System import *
from System.IO import *
from Deadline.Scripting import *
from Deadline.Plugins import *
def GetDeadlinePlugin():
return VraySpawnerPlugin()
def CleanupDeadlinePlugin( deadlinePlugin ):
deadlinePlugin.Cleanup()
class VraySpawnerPlugin(DeadlinePlugin):
def __init__(self):
self.InitializeProcessCallback += self.InitializeProcess
self.PreRenderTasksCallback += self.PreRenderTasks
self.RenderExecutableCallback += self.RenderExecutable
self.RenderArgumentCallback += self.RenderArgument
def Cleanup(self):
for stdoutHandler in self.StdoutHandlers:
del stdoutHandler.HandleCallback
del self.InitializeProcessCallback
del self.PreRenderTasksCallback
del self.RenderExecutableCallback
del self.RenderArgumentCallback
def InitializeProcess(self):
self.SingleFramesOnly=False
self.StdoutHandling=False
def PreRenderTasks( self ):
vrayExe = self.RenderExecutable()
vrayPath = Path.GetDirectoryName( vrayExe )
pythonHome = Path.Combine( vrayPath, "Python" )
pythonSitePackages = Path.Combine( pythonHome, "lib/python2.6/site-packages" )
self.LogInfo( "Setting DYLD_LIBRARY_PATH to: " + vrayPath )
self.SetEnvironmentVariable( "DYLD_LIBRARY_PATH", vrayPath )
self.LogInfo( "Setting PYTHONHOME to: " + pythonHome )
self.SetEnvironmentVariable( "PYTHONHOME", pythonHome )
pythonPath = Environment.GetEnvironmentVariable( "PYTHONPATH" )
if pythonPath != None and pythonPath != "":
newPythonPath = pythonSitePackages + Path.PathSeparator + pythonPath
self.LogInfo( "Setting PYTHONPATH to: " + newPythonPath )
self.SetEnvironmentVariable( "PYTHONPATH", newPythonPath )
else:
self.LogInfo( "Setting PYTHONPATH to: " + pythonSitePackages )
self.SetEnvironmentVariable( "PYTHONPATH", pythonSitePackages )
def RenderExecutable(self):
version = self.GetPluginInfoEntry( "Version" )
vrayExeList = self.GetConfigEntry("VRaySpawnerExecutable_" + version)
vrayExe = FileUtils.SearchFileList( vrayExeList )
if( vrayExe == "" ):
self.FailRender( version + " VRay Spawner executable was not found in the semicolon separated list \"" + vrayExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." )
return vrayExe
def RenderArgument(self):
return "-server"
I moved the environment setting into the PreRenderTasks callback, because it looks like it wasn’t getting applied from the RenderExecutable callback. I also added some debug logging so we can see what’s happening.
Give it a try and send us the new log if it fails again.
One more test. This time, it only uses the vray python path for PYTHONPATH, instead of prefixing it to the existing PYTHONPATH variable. If this doesn’t work, I’m stumped…
from System import *
from System.IO import *
from Deadline.Scripting import *
from Deadline.Plugins import *
def GetDeadlinePlugin():
return VraySpawnerPlugin()
def CleanupDeadlinePlugin( deadlinePlugin ):
deadlinePlugin.Cleanup()
class VraySpawnerPlugin(DeadlinePlugin):
def __init__(self):
self.InitializeProcessCallback += self.InitializeProcess
self.PreRenderTasksCallback += self.PreRenderTasks
self.RenderExecutableCallback += self.RenderExecutable
self.RenderArgumentCallback += self.RenderArgument
def Cleanup(self):
for stdoutHandler in self.StdoutHandlers:
del stdoutHandler.HandleCallback
del self.InitializeProcessCallback
del self.PreRenderTasksCallback
del self.RenderExecutableCallback
del self.RenderArgumentCallback
def InitializeProcess(self):
self.SingleFramesOnly=False
self.StdoutHandling=False
def PreRenderTasks( self ):
vrayExe = self.RenderExecutable()
vrayPath = Path.GetDirectoryName( vrayExe )
pythonHome = Path.Combine( vrayPath, "Python" )
pythonSitePackages = Path.Combine( pythonHome, "lib/python2.6/site-packages" )
self.LogInfo( "Setting DYLD_LIBRARY_PATH to: " + vrayPath )
self.SetEnvironmentVariable( "DYLD_LIBRARY_PATH", vrayPath )
self.LogInfo( "Setting PYTHONHOME to: " + pythonHome )
self.SetEnvironmentVariable( "PYTHONHOME", pythonHome )
self.LogInfo( "Setting PYTHONPATH to: " + pythonSitePackages )
self.SetEnvironmentVariable( "PYTHONPATH", pythonSitePackages )
def RenderExecutable(self):
version = self.GetPluginInfoEntry( "Version" )
vrayExeList = self.GetConfigEntry("VRaySpawnerExecutable_" + version)
vrayExe = FileUtils.SearchFileList( vrayExeList )
if( vrayExe == "" ):
self.FailRender( version + " VRay Spawner executable was not found in the semicolon separated list \"" + vrayExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." )
return vrayExe
def RenderArgument(self):
return "-server"
Hi
I think using “vray.bin” is a dead end, as the last one also errors out. But thank you very much for all the great suggestions!
I went back to the second version (with vray only and correct render arguments) and modified the Quicktime Event Plugin (KillVraySpawner) to launch after any VraySpawner job is completed and kill the hanging vray.bin process. This is rather brute force but it works
How can get the slave names that was used in the job that triggers the event plugin? Can i get them from the job object that is passed in to the event plugin? That way i could write a whitelist into the Job Info File and only run the “KillVraySpawner” event plugin on the slaves that needs it?
I don’t think you can. Since (I’m assuming) the job is manually marked as complete when the render is done, the information about the slaves that were rendering the tasks for the job will be lost.
An alternative could be to convert your plugin into an advanced plugin, wrap the vray spawner in a ManagedProcess class, and then start the process in the RenderTasks() callback. Then in the EndJob() callback, you can kill vray.bin because EndJob will always be called.
You can take a look at the Nuke plugin for an example of this. When BatchMode is disabled, all we’re doing in RenderTasks() is starting the Nuke ManagedProcess and waiting for it to complete using RunManagedProcess(). You shouldn’t need to do anything in StartJob(), and in EndJob(), you would simply kill any vray.bin processes kicking around.
It’s still a bit of brute force, but at least it’s all self-contained in the plugin. Less moving parts is always good.