Does this still work in 6.1.1? I've been trying everything, but I can not get the email callback to work. Any tips? Attached my script as well.
import c4d, os, sys
from c4d import gui
"""
Sends a c4d-file to Qube
Copyright Oyvind Pettersen
"""
# Make sure that qb module is in the python path
if 'QBDIR' in os.environ:
sys.path.append('%s/api/python' % os.environ['QBDIR']);
elif os.uname()[0] == 'Darwin':
sys.path.append('/Applications/pfx/qube/api/python');
else:
sys.path.append('/usr/local/pfx/qube/api/python');
import qb
def main():
#ask for project name
pNameDefault = "Prosjektnavn"
pName = gui.InputDialog(pNameDefault) #pass it
print pName
pUserDefault = "Brukernavn (nXXXXX)"
pUser = gui.InputDialog(pUserDefault) #pass it
print pUser
rd=doc.GetActiveRenderData() #get the current renderdata
filePath=rd[c4d.RDATA_PATH] #get save path
print filePath
multiPath=rd[c4d.RDATA_MULTIPASS_FILENAME] #get multi path
print multiPath
multiPass=rd[c4d.RDATA_MULTIPASS_ENABLE]
print multiPass
ad=doc.GetDocumentPath() + "/" + doc.GetDocumentName() #get document path
print ad
frame = doc.GetTime().GetFrame(doc.GetFps())
print frame
#format=rd[c4d.RDATA_FORMAT]
#print format
frameFrom=rd[c4d.RDATA_FRAMEFROM].GetFrame(doc.GetFps())
print frameFrom
frameTo=rd[c4d.RDATA_FRAMETO].GetFrame(doc.GetFps())
print frameTo
#frameStep=rd[c4d.RDATA_FRAMESTEP]
#print frameStep
## BEGING QUBE ##
# Set basic job properties
job = {}
job['name'] = pName
job['cpus'] = 4
job['prototype'] = 'cmdrange'
job['requirements'] = ''
job['priority'] = '10'
if pUser:
print "Emailing"
job['triggers'] = 'done-job-self'
job['language'] = 'mail'
job['mailaddress'] = pUser + '@nrk.no'
job['callbacks'] = [{'triggers':'done-job-self', 'language':'mail'}]
# Set the package properties
job['package'] = {}
#job['package']['-render'] = '/Volumes/GrafiSAN/Qube/Cinema4D/Prosjekter/Royal_Wedding/wedding_part_2.c4d'
if multiPass:
job['package']['cmdline'] = '"/Applications/MAXON/CINEMA 4D R12/CINEMA 4D.app/Contents/MacOS/CINEMA 4D" -nogui -frame QB_FRAME_START QB_FRAME_END QB_FRAME_STEP -oimage "'+filePath+'" -omultipass "'+multiPath+'" -render "' + ad + '"'
else:
job['package']['cmdline'] = '"/Applications/MAXON/CINEMA 4D R12/CINEMA 4D.app/Contents/MacOS/CINEMA 4D" -nogui -frame QB_FRAME_START QB_FRAME_END QB_FRAME_STEP -oimage "'+filePath+'" -render "' + ad + '"'
# Calculate agenda from range
#agendaRange = '0-60x10'
agendaRange = str(frameFrom) + '-' + str(frameTo)
agenda = qb.genframes(agendaRange)
# Set the outputPaths in the resultpackage for each agenda item
#for i in agenda:
# i.resultpackage({'outputPaths': 'C:/YOUR/OUTPUT/PATH/GOES/HERE.tga'})
# Set the job agenda
job['agenda'] = agenda
# Submit
listOfSubmittedJobs = qb.submit([job])
# Report on submit results
for job in listOfSubmittedJobs:
print job['id']
if __name__=='__main__':
main()