Versions Compared

    Key

    • This line was added.
    • This line was removed.
    • Formatting was changed.
    Comment: Published by Scroll Versions from this space and version 7.0-2

    ...

    Code Block
    titleUsing the "python" callback language is identical to the first example, except the callback's "language" and "code" is different
    linenumberstrue
    languagepython
    jobA = {
    	'label': 'ribGen',
    	.
    	.
    }
     
    jobB = {
    	'label': 'render',
    	.
    	.
    }
     
    jobC = {
    	'label': 'composite'
    	.
    	.
    }
     
    callbacks = []
    for work in jobC['agenda']:
    	work['status'] = 'blocked'
    	frameNumber = work['name']
    
        # the agenda item's callback should unblock both itself and the job
        cbCode = 'jobId = qb.jobid()\n'
        cbCode += 'qb.workunblock("%%s:%s" %% jobId)\n' % frameNumber
        cbCode += 'qb.unblock(jobId)\n'
    
    	triggerStr = 'complete-work-ribgen-%s' % frameNumber'
    	triggerStr += ' AND&& '
    	triggerStr += 'complete-work-render-%s' % frameNumber'
    		
    	callbacks.append(
    		{ 
    			'triggers': triggerStr,
    			'language': 'python',
    			'code': cbCode,
    		}
    	)
    ]
    jobB['callbacks'] = callbacks
     
    qb.submit( [jobA, jobB, jobC] )

    ...

    Code Block
    titleThis is identical to the above example, except the 'triggerStr'" is different
    linenumberstrue
    languagepython
    jobA = {
    	'label': 'ribGen',
    	.
    	.
    }
     
    jobB = {
    	'label': 'render',
    	.
    	.
    }
     
    jobC = {
    	'label': 'composite',
    	.
    	.
    }
     
    jobD = {
    	'label': 'sendToDailies',
    	.
    	.
    } 
    callbacks = []
    for work in jobD['agenda']:
    	work['status'] = 'blocked',
    	frameNumber = work['name']
    
        # the agenda item's callback should unblock both itself and the job
        cbCode = 'jobId = qb.jobid()\n'
        cbCode += 'qb.workunblock("%%s:%s" %% jobId)\n' % frameNumber
        cbCode += 'qb.unblock(jobId)\n'
    
    	triggerSt = '('
    	triggerStr += 'complete-work-ribgen-%s' % frameNumber'
    	triggerStr += ' AND&& '
    	triggerStr += 'complete-work-render-%s' % frameNumber'
    	triggerStr += ')'
     
    	triggerStr += ' OR|| '
    	triggerStr = 'complete-work-composite-%s' % frameNumber'
    		
    	callbacks.append(
    		{ 
    			'triggers': triggerStr,
    			'language': 'python',
    			'code': cbCode,
    		}
    	)
    ]
    jobB['callbacks'] = callbacks
     
    qb.submit( [jobA, jobB, jobC, jobD] )