Starting to write a custom submission for XSI (in Python) and I get a traceback that seems to stem from API internals...
The code is pretty much copied from the Perl example in the developer docs but ported for Python/XSI
import sys
sys.path.append(r'C:\Program Files\pfx\qube\api\python\qb')
import qb
xsi = Application
log = xsi.LogMessage
fn = xsi.ActiveProject.ActiveScene.FileName.Value
log(fn)
env = {}
frames = qb.genframes('1-100')
data = {
'env': env,
'cmdline': "echo testing"
}
job = {
'name': 'Echo Test Job',
'priority': 1,
'prototype': 'frame',
'branch': '/',
'cpus': 1,
'data': data,
'work': frames
}
ret = qb.submit(job)
for j in ret:
log('submitted job - id: %d\n' % j.id)
Gives the following traceback:
# ERROR : Traceback (most recent call last):
# File "<Script Block >", line 27, in <module>
# ret = qb.submit(job)
# File "C:\Program Files\pfx\qube\api\python\qb\__init__.py", line 1394, in submit
# return [Job(i) for i in _qb.submit(joblist)]
# File "C:\Program Files\pfx\qube\api\python\qb\__init__.py", line 173, in __init__
# self['subjobs'] = [Subjob(i) for i in data['subjobs']]
# TypeError: expected string or Unicode object, dict found
# - [line 27]