Migrate Application Plugins from v5 -> v6 essential info here: thinkboxsoftware.com/deadlin … ne.C2.AE_5
“Deprecated Mode” mode might be of use to you whilst you transition over to the v6 architecture.
Note the addition of both a new Standalone CPython API package & a RESTful http API - both new in v6.1. More v6.1 info here: thinkboxsoftware.com/deadlin … ar-videos/
You now have both “JobPreLoad.py” & “PluginPreLoad.py” functionality: thinkboxsoftware.com/deadlin … -_Optional
PluginPreLoad is executed first and then followed by JobPreLoad. More info in the link above.
Feel free to show any specific errors & related code and we can help fix/advise what is wrong between v5 -> v6 transition. It can feel like a lot has changed/broken between the 2 x versions, but it was limited to the absolute minimum and it does put us in a very strong position for the future and with that, a few changes did need to take place.
(You may also be interested in v6.2 beta, which is now very close to being production ready, as it includes a shed load of more cool stuff)
I’ve read a few of the docs as I had to, since I’m basically re-writing my tools here. but I’ll dive into your liks as well.
Thanks again, man, much appretiated!
Regarding what I had problems with, well, it started with the import of: from System import Environment as env throwing an error “Unknown class System”
My sync tools were based on IPy code where I first compared target and source files if there was a difference, if there was one, I overwrote them. Saved me a TON of traffic and time on my render farm.
I guess I’ll have to re-write this in CPy, which shouldn’t be such a problem, but it’s a bit time consuming and I just wanted to render a few things on my farm today.
maxVersion = Plugins.PluginConfig.GetIntegerConfigEntry( "Version" )
if maxVersion == 2009:
Scripting.DirectoryUtils.AddToPath(r'C:\duber\3ds Max\2009_x64\dlls')
if maxVersion == 2010:
Scripting.DirectoryUtils.AddToPath(r'C:\duber\3ds Max\2010_x64\dlls')
if maxVersion == 2011:
Scripting.DirectoryUtils.AddToPath(r'C:\duber\3ds Max\2011_x64\dlls')
if maxVersion == 2013:
Scripting.DirectoryUtils.AddToPath(r'c:\duber\3ds Max\2013_x64\dlls')
if maxVersion == 2014:
Scripting.DirectoryUtils.AddToPath(r'C:\duber\3ds Max\2014_x64\dlls')[/code]
However, I’m getting constatly such errors:
=======================================================
Error
=======================================================
Error in StartJob: Plugin preload script "C:\Users\loocas\AppData\Local\Thinkbox\Deadline6\slave\VFX01\plugins\536669c9170b1b0784d17ce8\PluginPreLoad.py": Python Error: TypeError : No method matches given arguments (Python.Runtime.PythonException)
Stack Trace:
[' File "none", line 39, in __main__\n']
(System.Exception)
at FranticX.Scripting.PythonNetScriptEngine.HandlePythonError(Exception e)
at FranticX.Scripting.PythonNetScriptEngine.CallFunction(String functionName, PyObject[] args)
at Deadline.Scripting.DeadlineScriptManager.CallFunction(String scopeName, String functionName)
at Deadline.Plugins.ScriptPlugin.InitializeLocalScope(String scopeName, String scriptName, String scriptFile)
at Deadline.Plugins.ScriptPlugin.InitializeLocalScope(String scopeName, String scriptName, String scriptFile)
at Deadline.Plugins.ScriptPlugin.InitializeLocalPlugin(Job job)
at Deadline.Plugins.ScriptPlugin.StartJob(Job job, String& outMessage, AbortLevel& abortLevel)
=======================================================
Type
=======================================================
RenderPluginException
=======================================================
Stack Trace
=======================================================
at Deadline.Plugins.Plugin.StartJob(Job job)
at Deadline.Slaves.SlaveRenderThread.RenderCurrentTask(TaskLogWriter tlw)
=======================================================
Full Log
=======================================================
0: Task timeout is disabled.
0: Loaded job: test 6 (536669c9170b1b0784d17ce8)
0: INFO: Executing plugin preload script: C:\Users\loocas\AppData\Local\Thinkbox\Deadline6\slave\VFX01\plugins\536669c9170b1b0784d17ce8\PluginPreLoad.py
=======================================================
Details
=======================================================
Date: 05/04/2014 18:26:08
Frames: 1
Elapsed Time: 00:00:00:02
Job Submit Date: 05/04/2014 18:24:41
Job User: loocas
Average RAM Usage: 3488783104 (28%)
Peak RAM Usage: 3488788480 (28%)
Average CPU Usage: 1%
Peak CPU Usage: 4%
=======================================================
Slave Information
=======================================================
Slave Name: VFX01
Version: v6.1.0.54665 R
Operating System: Windows 7 Professional (SP1)
Machine User: loocas
IP Address: 192.168.0.111
MAC Address: 00:1F:D0:DC:0B:71
CPU Architecture: x64
CPUs: 8
CPU Usage: 2%
Memory Usage: 3.2 GB / 12.0 GB (27%)
Free Disk Space: 1.024 TB (1.996 GB on C:\, 122.373 GB on D:\, 923.882 GB on E:\)
Video Card: NVIDIA GeForce GTX 285
Could you please let me know what is exactly bothering Deadline about my code? I’m having the scripting documentation open on the other monitor at all times and I can honestly say I have no idea why is Deadline 6 still complaining about this.
Stack Trace:
[' File "none", line 39, in __main__\n']
However, your example script code was only the first 23 lines, so I can’t see what might be the issue
The only thing I noticed is the comma “,” at the end of the last dict entry doesn’t need to be there, but otherwise the code looks fine.
I’m sorry, but that doesn’t make any sense! Why should I be accessing the variable/namespace “self” ? That’s not being used anywhere in the script and it is not inside a class.
Also, I am already importing the Plugins module and then referencing it in my script:
Hi,
Sorry about that! So, just need to check a couple of things here. The “Version” key is in the Deadline Plugin Info and not the Config Info in the 3dsMax plugin or have you added a custom “Version” key to your Plugin Configuration? Are you wanting to use a Plugin or Job PreLoad.py script?
Saving this as a “JobPreLoad.py” file into your 3dsMax plugin directory works for me:
Error in StartJob: Plugin preload script “C:\Users\loocas\AppData\Local\Thinkbox\Deadline6\slave\VFX01\plugins\5366c2ab170b1b0784d17d15\PluginPreLoad.py”: Python Error: NameError : global name ‘self’ is not defined (Python.Runtime.PythonException)
Stack Trace:
[’ File “none”, line 40, in main\n’]
(System.Exception)
at FranticX.Scripting.PythonNetScriptEngine.HandlePythonError(Exception e)
at FranticX.Scripting.PythonNetScriptEngine.CallFunction(String functionName, PyObject[] args)
at Deadline.Scripting.DeadlineScriptManager.CallFunction(String scopeName, String functionName)
at Deadline.Plugins.ScriptPlugin.InitializeLocalScope(String scopeName, String scriptName, String scriptFile)
at Deadline.Plugins.ScriptPlugin.InitializeLocalScope(String scopeName, String scriptName, String scriptFile)
at Deadline.Plugins.ScriptPlugin.InitializeLocalPlugin(Job job)
at Deadline.Plugins.ScriptPlugin.StartJob(Job job, String& outMessage, AbortLevel& abortLevel)[/code]
AH!!! Yes! That might be it, the PluginPreLoad.py might not have any clue about the plugin’s settings! I’ll try the JobPreLoad.py to see if it makes any difference.
We return the actual pluginObject currently being used by the Deadline plugin in the first line
def __main__( deadlinePlugin ):
and can then query it for information. We don’t actually need to use any “Deadline.Plugins” functions for this particular line of code. So we just need to say:
I’m sorry, I’m still confused, the “deadlinePlugin” variable is what? Where? The documentation mentions “DeadlinePlugin” variable (camel case) and I don’t really see the difference it should make.
I mean, the documentation clearly states this:
int Deadline.Plugins.DeadlinePlugin.GetIntegerConfigEntry ( string key )
When I use this line I’m getting the errors I’ve mentioned. This shouldn’t be. Either the documentation is wrong, the module is wrong or I am doing something not really that obvious to mee that is tripping Deadline’s CPython.
“The only requirement for the PreJobLoad.py script is that you define a main function, which is called by the Slave when it executes the script. It must accept a single parameter, which is the current instance of the DeadlinePlugin class.”
I didn’t read the last, important, note about the class instancing and I just blindly copied my code from Deadline 5.2, this makes a lot of sense actually.
Thank you, I’ll give it a try when I’m done rendering the current job.
Hi,
You need to rename the “PluginPreLoad.py” to “JobPreLoad.py”, as the “JobPreLoad” will be able to access the 3dsMax Plugin properties, whilst the PluginPreLoad hasn’t yet loaded the Plugin, so doesn’t know if your using the 3dsMax plugin or any other plugin. The PluginPreLoad is really only useful for messing with the Python environment. The docs give a bit more info:
thinkboxsoftware.com/deadlin … -_Optional
The PluginPreLoad.py file is an optional script that will be executed by the Slave prior to executing any python script for the plug-in (MyPlugin.py or JobPreLoad.py), and any pre or post job or task script for the current job. Note that in this case, the file does not share its name with the plug-in folder. This script can be used to set up the Python environment prior to running any other python script, including setting sys.path to control where additional modules will be loaded from.