Author Topic: Using qube frame name in your job  (Read 10695 times)

mkrupa

  • Newbie
  • *
  • Posts: 1
Using qube frame name in your job
« on: May 09, 2013, 10:44:13 AM »
Hi - I'm trying to submit a job that's making some batch operations, but it would be much easier for me if I could name the frames and use those names inside the agenda.

In example I have characters: girl, boy, dad, mum and I want to perform some actions on the scene that they participate, however I want to split the job among some workers so I'm creating the cmdline job with 4 frames and name them girl, boy, dad, mum. Now I want to use those names inside the batch script.

How can I do that and is it even possible?

jburk

  • Administrator
  • *****
  • Posts: 493
Re: Using qube frame name in your job
« Reply #1 on: May 09, 2013, 02:15:56 PM »
Yes, it's pretty easy if you can build your jobs with either python or perl, prototype them as the cmdrange jobtype, and use the QB_FRAME_RANGE token where you want the frame name to appear.

Here's a python example:

Code: [Select]
#!/bin/env python

import qb

job = {
    'prototype': 'cmdrange',
    'name': 'named agenda test',
    'package': {
        'cmdline': 'echo QB_FRAME_RANGE'
    }
}

agenda = []
for name in ['boy', 'girl', 'dog', 'cat']:
    agenda.append( {'name': name} )

job['agenda'] = agenda

for j in qb.submit(job):
    print '%(name)s: %(id)s' % j


The job then runs these commands:

[jburk@sv001 ~/dev]$ qbout 2485 | grep COMMAND
COMMAND: echo boy
COMMAND: echo girl
COMMAND: echo dog
COMMAND: echo cat