AWS Thinkbox Discussion Forums

Copy files to another location

Hi, we need to copy a rendered sequence to another location after it renders is that possible to with Draft? Or is there another better way to do it?

Tks!

Ok so basically this is what we need to do:

In our pipeline when we submit a render it goes to a WIP folder but we want to render to a different path when publishing to shotgun using the integration tab.

I would really appreciate if someone could point me to the right direction.

Tks!

To copy the render output files to another location when a render completes could be achieved with an event plugin or a post-job script. Here’s our boiler-plate job script example from our docs:
docs.thinkboxsoftware.com/produc … ob-scripts

Instead of just printing the output path, you could add a File.Copy command instead as you prefer.

Mike beat me to it! I’ve put in my two cents here:

Well, considering the Draft tooling allows you to run a Python script after the job is done and that script gets the path to the output directory, I think a Draft template that doesn’t use Draft at all would work great here!

Here’s an example: (I haven’t tested this, so treat it as ‘theory of operation’ instead of ‘gunna work great’ code)

import shutil
import sys

expectedTypes = {}
expectedTypes['inFile'] = '<string>'
expectedTypes['outFile'] = '<string>'

params = ParseCommandLine( expectedTypes, sys.argv )

inFile = params['inFile']
outFile = params['outFile']

try:
    shutil.copyfile(inFile, outFile)
except:
    print("File copy failed from {} to {}".format(inFile, outFile)

Now, outFile when using QuickDraft is a folder named “Draft” in the same folder as the output was written to, but you don’t need to use it. It’ll be up to you to figure out a good way of putting the output in the right spot, but you can pass more parameters into the Draft script with some info from over here:
thinkboxsoftware.com/draft-c … gs-recipe/
thinkboxsoftware.com/draft-u … arameters/ (this one is pretty great)

We don’t seem to have easy to find docs for the incoming parameters, but you could just dump the “sys.argv” and it’ll give you a good idea of what you have to work with.

Privacy | Site terms | Cookie preferences