Forum Replies Created
-
18th September 2019 at 5:52 pm #22045Hello Leonardo,
thanks for your reply. The way with the multiple templates is what I ended up doing. To make it as simple as possible (for anyone interested), I derived the new templates with different license restrictions from the base template class, so it inherits everything. The only thing I do* then is to call setMaximumLicenses in the __init__() of the template (after a super() call, of course).
Works great.
Best
Claus* Of course, there are other things to do, like assign a different template name and ID to it, and set a different license group (depending on if the different versions have the same license group or not.
19th November 2015 at 12:46 pm #15275Hello nezus,
thanks for you answer. I use Eclipse with the PyDev plugin, which makes it a pretty strong IDE for python development, so I’m pretty sure the python code is ok as is, except from API errors that were in the default templates already. Maybe I’ll try to start with a clean template from scratch and see if I can get it to work then.
Also no sucess on my side with the Python output…

Strange thing is, “Confirm changes” does not seem to work for me, I need to soft restart the render nodes to make them update and use the new template…
19th November 2015 at 9:27 am #15273I made some progress, but I still can’t get it to work. No debug messages, no onCheckLog..
In Dispatcher Preferences > Logs and exit codes, I enabled Logs warnings > Enable Check and Logs errors > Enable check, and under Logs I set Redirect templates python output to: Logs.
To debug the templates, I used python’s print() as well as the following snippet to try to debug my templates, though still I can’t see any output.
Code:def write_log(self, msg):
try:
import MDispatcherAPI
MDispatcherAPI.logAddMessage(msg)
except:
pass
18th November 2015 at 4:27 pm #15272Hi nezus,
seems like I’m having kind of the same problems:
http://www.vvertex.com/forum/read.php?28,7335
http://www.vvertex.com/forum/read.php?28,7336Did you make any progress in your original problems,
– debugging/printing from template
– onBuildEnvironment not called
– what is neccesary to push templates to all nodes
?Thanks & kind regards,
claus
20th March 2014 at 10:56 am #15247Hello,
I had the same issue. Some of the environment vars are unicode strings. I didn’t really investigate in this issue, but a quick fix is to insert this code on line 880, right before the
Code:subprocess.Popen(…)call:
Code:import unicodedata
for key, val in environment.items():
if type(val) != type( “” ):
environment[key] = unicodedata.normalize(‘NFKD’, val).encode(‘ascii’,’ignore’)# p = subprocess.Popen(…)
this converts all unicode strings in the environment dict to default ascii strings, all warnings omitted. problem is of course that this might potentially break environment vars contiainint non-ascii characters.
claus
-

