Author Topic: Copy scripts to repository before rendering?  (Read 2929 times)

tim.bowman

  • Jr. Member
  • **
  • Posts: 2
    • Dive, Philadlephia
Copy scripts to repository before rendering?
« on: June 07, 2010, 07:51:46 PM »
Hello all --

One of the things we'd like to do with our 2D pipeline is to copy comp scripts to a repository area before rendering to avoid artists changing things during a render. Has anyone done any work in this direction, especially anything that can be shared?

Ideally, we'd also like for the scripts in the repository to be removed when the job is removed from Qube. Is there a callback we could use to do that?

I'd love to hear anyone else's options/advice. Thanks in advance.

jburk

  • Administrator
  • *****
  • Posts: 493
Re: Copy scripts to repository before rendering?
« Reply #1 on: June 07, 2010, 09:45:14 PM »
If you are building and submitting jobs within a pipeline, I'd suggest creating a callback that triggers when complete, and delete the script in the callback:

job = {}
job['package']['compScript'] = script_repoPath

callback = {}
callback['language'] = 'python'
callback['triggers'] = 'complete-job-self'
callback['code'] = '''import os
os.unlink(%s)
''' % script_repoPath

job['callbacks'] = [callback]

qb.submit(job)


tim.bowman

  • Jr. Member
  • **
  • Posts: 2
    • Dive, Philadlephia
Re: Copy scripts to repository before rendering?
« Reply #2 on: June 08, 2010, 01:21:31 PM »
Thanks for the callback code, John. I didn't realize writing a callback was so straightforward. That'll be a good reference for me.

What I was really hoping for was a way to hook in to qbremove to delete the script when the job is removed from Qube. We were thinking of using the repository as a sort of short-term storage where you can go back and grab the script from the last working render if you've hopelessly mangled your comp since then. Are there any callbacks exposed for that sort of thing? If not, we'll look for another way of managing this. Maybe could be something for future versions?