Author Topic: Start mr job from python  (Read 8216 times)

toni

  • Jr. Member
  • **
  • Posts: 2
Start mr job from python
« on: August 19, 2012, 10:50:02 PM »
i did everything and i have problem with this:
job['todo'] = 25

when i start job from python it set it in qube as 100%(1/1), and in .xja file there is todo tag 0 , and it should be 25 , i think it is error because when i resubmit job from qube it start normal 0/25 and rendering normal. please help !

Code: [Select]
job = {}
    job['todo'] = 25
    job['retrywork'] = 10
    job['name'] = name
    job['cpus'] = cpus
    job['user'] = user
    job['priority']  = 9999
    job['reservations'] = 'host.processors=1'
    job['prototype'] = 'cmdrange'
   
    job['package']   = {
                      'mayaExe' : '/Applications/Autodesk/maya2013/Maya.app/Contents/bin/Render',
                      'cmdline' : '. "/Applications/Autodesk/maya2013/Maya.app/Contents/bin/MayaENV.sh" && "/Applications/Autodesk/maya2013/Maya.app/Contents/bin/Render" -s QB_FRAME_START -e QB_FRAME_END -b QB_FRAME_STEP -of "jpg" -rd "/Users/Shared/Autodesk/maya/2013/scene" -fnc name.#.ext -renderer "mr"  "/Users/Shared/Autodesk/maya/2013/scene/test.ma"',
                      'scenefile' : '/Users/Shared/Autodesk/maya/2013/scene/test.ma',
                      'mayaEnvCommand' : '"/Applications/Autodesk/maya2013/Maya.app/Contents/bin/MayaENV.sh" &&',
                      'simpleCmdType' : 'Maya BatchRender (mr)',
                      '-of' : 'jpg',
                      'frameCount' : '25',
                      'range' : '1-25',
                      '-render' : '/Users/Shared/Autodesk/maya/2013/scene/test.ma',
                      '-rd' : '/Users/Shared/Autodesk/maya/2013/scene',
                      '-fnc' : 'name.#.ext',
                      'shell' : '/bin/sh',
                      '-renderer' : 'mr',
                      }

    listOfJobsToSubmit = []
    listOfJobsToSubmit.append(job)

    listOfSubmittedJobs = qb.submit(listOfJobsToSubmit)

    for job in listOfSubmittedJobs:
        print job['id']

jburk

  • Administrator
  • *****
  • Posts: 493
Re: Start mr job from python
« Reply #1 on: August 20, 2012, 12:08:26 AM »
The 'todo' field is set server-side once the job is stored in the database, not before submission.

When building the job, use the qb.genframes('1-25') to set the job['agenda'].

toni

  • Jr. Member
  • **
  • Posts: 2
Re: Start mr job from python
« Reply #2 on: August 20, 2012, 12:50:36 PM »
thanks you a lot, you saved me a lot of time.  ::)