AWS Thinkbox Discussion Forums

Draft!

I’m curious to know if any of you guys have had a chance to try out Draft yet, since we haven’t really gotten any feedback from it so far. For those who are interested in trying it out, but haven’t gotten a Draft beta license yet (it’s separate from the Deadline one!), let us know and we’ll hook you up :slight_smile:

Just as a reminder, download link is here:
viewtopic.php?f=85&t=5678

And instructions are here:
viewtopic.php?f=85&t=5680

If you’ve been waiting patiently for the Mac/Linux versions, those should be along fairly shortly, we just have to do some more internal testing and tune-ups first.

Let us know if you have any questions!

Cheers,

  • Jon

Not yet, I’ve been waiting for the time necessary to set aside and create some templates to actually use.

Ok first problem. It says it can’t import draft by default. I can point it to it though…

sys.path.append("C:\\Program Files\\Thinkbox\\Deadline\\bin\\Draft\\64bit")

Next problem:

0: INFO: About: Draft Plugin for Deadline 0: Plugin rendering frame(s): 0 0: INFO: Draft job starting... 0: INFO: Stdout Handling Enabled: False 0: INFO: Popup Handling Enabled: False 0: INFO: Using Process Tree: True 0: INFO: Hiding DOS Window: True 0: INFO: Creating New Console: False 0: INFO: Looking for bundled python at: 'C:\Program Files\Thinkbox\Deadline\python\2.6.7\x64\python.exe' 0: INFO: Render Executable: "C:\Program Files\Thinkbox\Deadline\python\2.6.7\x64\python.exe" 0: INFO: Render Argument: -u "C:\Basic_Resize.py" startFrame=1 endFrame=100 outfile="G:\Output\Draft\Tracking_Shot_.mov" infile="G:\Output\Tracking_Shot_###.tif" 0: INFO: Startup Directory: "C:\Program Files\Thinkbox\Deadline\bin\Draft\64bit" 0: INFO: Process Priority: BelowNormal 0: INFO: Process is now running 0: STDOUT: Command line args: 0: STDOUT: startFrame=1 0: STDOUT: endFrame=100 0: STDOUT: outfile=G:\Output\Draft\Tracking_Shot_.mov 0: STDOUT: Traceback (most recent call last): 0: STDOUT: File "C:\Basic_Resize.py", line 20, in <module> 0: STDOUT: ParseCommandLine( params, sys.argv ) 0: STDOUT: File "C:\Program Files\Thinkbox\Deadline\bin\Draft\64bit\DraftParamParser.py", line 142, in ParseCommandLine 0: STDOUT: return ParseParams( expected, params ) 0: STDOUT: File "C:\Program Files\Thinkbox\Deadline\bin\Draft\64bit\DraftParamParser.py", line 65, in ParseParams 0: STDOUT: raise StandardError('ERROR: ' + msg) 0: STDOUT: StandardError: ERROR: Expected parameter 'username' was not found. 0: INFO: Process exit code: 1

So I tried using shotgun but when I enter my username and hit connect I get

"An exception occured in the event handler for ShotgunButton TypeError: 'NoneType' object is unsubscriptable (Python.Runtime.PythonException)

It seemed to also be unhappy with this line with the [‘value’] property so I stripped it.
Revised code:

inFilePattern = params['infile'] startFrame = int(params['startFrame']) endFrame = int(params['endFrame'])

Ok I hard-coded in all the values for now so that the ParseCommandLine errors could be circumvented. But now I’m getting this error:

0: INFO: Looking for bundled python at: 'C:\Program Files\Thinkbox\Deadline\python\2.6.7\x64\python.exe' 0: INFO: Render Executable: "C:\Program Files\Thinkbox\Deadline\python\2.6.7\x64\python.exe" 0: INFO: Render Argument: -u "C:\Basic_Resize.py" startFrame=1 endFrame=48 outfile="G:\Output\Draft\Tracking_Shot_.mov" infile="G:\Output\Tracking_Shot_###.tif" 0: INFO: Startup Directory: "C:\Program Files\Thinkbox\Deadline\bin\Draft\64bit" 0: INFO: Process Priority: BelowNormal 0: INFO: Process is now running 0: STDOUT: Traceback (most recent call last): 0: STDOUT: File "C:\Basic_Resize.py", line 56, in <module> 0: STDOUT: overlay.CompositeWithPositionAndGravity( overlayStrip, 0.0, 0.0, PositionalGravity.SouthWestGravity, CompositeOperator.OverCompositeOp ) 0: STDOUT: RuntimeError: Magick: NoPixelsDefinedInCache `' @ error/cache.c/OpenPixelCache/3997 0: INFO: Process exit code: 1

Code in question:

#overlayStrip = Image.CreateImage(width, int(height*overlayScale)) #overlayStrip.SetToColor(ColorRGBA(0.0, 0.0, 0.0, 0.2)) #overlay = Image.CreateImage(width, height) #overlay.SetToColor(ColorRGBA(0.0, 0.0, 0.0, 0.0)) #overlay.CompositeWithPositionAndGravity( overlayStrip, 0.0, 0.0, PositionalGravity.SouthWestGravity, CompositeOperator.OverCompositeOp ) #overlay.CompositeWithPositionAndGravity( overlayStrip, 0.0, 1.0, PositionalGravity.NorthWestGravity, CompositeOperator.OverCompositeOp )

P.S. Is there a way to step through line by line? I tried that but the “Image” function didn’t work.

Ok I stripped out all of that too. It’s now BAREBONES.

But still getting this error:

0: INFO: Looking for bundled python at: 'C:\Program Files\Thinkbox\Deadline\python\2.6.7\x64\python.exe' 0: INFO: Render Executable: "C:\Program Files\Thinkbox\Deadline\python\2.6.7\x64\python.exe" 0: INFO: Render Argument: -u "C:\Basic_Resize.py" startFrame=1 endFrame=48 outfile="G:\Output\Draft\Tracking_Shot_.mov" infile="G:\Output\Tracking_Shot_###.tif" 0: INFO: Startup Directory: "C:\Program Files\Thinkbox\Deadline\bin\Draft\64bit" 0: INFO: Process Priority: BelowNormal 0: INFO: Process is now running 0: STDOUT: Traceback (most recent call last): 0: STDOUT: File "C:\Basic_Resize.py", line 68, in <module> 0: STDOUT: videoEncoder = VideoEncoder( params['outfile'], fps, width, height, kBitRate, codec ) 0: STDOUT: RuntimeError: Could not allocate picture 0: STDOUT: Output #0, mov, to 'G:\Output\Draft\Tracking_Shot.mov': 0: STDOUT: Stream #0.0: Video: mjpeg, yuvj420p, q=2-31, 90k tbn, 24 tbc 0: STDOUT: [IMGUTILS @ 000000000021EB90] Picture size 0x0 is invalid 0: INFO: Process exit code: 1 ---- September 16 2011 -- 12:02 PM ----

Ok I’ll strip it down even further… hmmm…

Ok I got it to work. Looks like it was a problem with Quicktime and some of those composite options?

[code]import sys
sys.path.append(“C:\Program Files\Thinkbox\Deadline\bin\Draft\64bit”)
import os
import datetime
import copy
from Draft import *
from DraftParamParser import *

params = dict()
params[‘username’] = { ‘type’ : ‘’, ‘value’ : None }
params[‘entity’] = { ‘type’ : ‘’, ‘value’ : None }
params[‘version’] = { ‘type’ : ‘’, ‘value’ : None }
params[‘startFrame’] = { ‘type’ : ‘’, ‘value’ : None }
params[‘endFrame’] = { ‘type’ : ‘’, ‘value’ : None }
params[‘outfile’] = { ‘type’ : ‘’, ‘value’ : None }
params[‘infile’] = { ‘type’ : ‘’, ‘value’ : None }
#ParseCommandLine( params, sys.argv )

params[‘username’] = “ggreenwalt”
params[‘entity’] = “”
params[‘version’] = “v00001”
params[‘startFrame’] = 1.0
params[‘endFrame’] = 5.0
params[‘outfile’] = “G:\Output\Draft\Tracking_Shot.mov”
params[‘infile’] = “G:\Output\Tracking_Shot_###.tif”

inFilePattern = params[‘infile’]
startFrame = int(params[‘startFrame’])
endFrame = int(params[‘endFrame’])

pull the output width height from an input frame

frameNumber = startFrame
inFile = ReplaceFilenameHashesWithNumber(inFilePattern, frameNumber)
inFrame = Image.ReadFromFile(inFile)

scale = float(864.0/(inFrame.width))

apply the scale

width = int(inFrame.widthscale)
height = int(inFrame.height
scale)

encode the video frames

for frameNumber in range(startFrame, endFrame + 1) :
inFile = ReplaceFilenameHashesWithNumber(inFilePattern, frameNumber)
bgFrame = Image.ReadFromFile(inFile)
bgFrame.Resize(width, height)
bgFrame.WriteToFile( “G:\Output\Draft\TestOutput_”+str(frameNumber)+".tif")[/code]
BAREBONES.zip (723 Bytes)

Hey Gavin,

Couple things. First, the import path should be fixed in the next iteration of the Draft plugin; for whatever reason, setting the Startup directory to be the Draft folder works on my machine but not elsewhere >_<. So we’re going to add a Draft path setting in the event plugin (similar to executable paths in other plugins), defaulting to the usual locations.

Second, for testing purposes, it might be more useful to try out some basic stuff in the python interpreter first; that’ll allow you to go “line by line” and see what might be causing issues. It’s also probably faster than modifying the script and re-submitting to Deadline every time you want to try something different :slight_smile:

Third, the error you posted in your latest post ("[IMGUTILS @ 000000000021EB90] Picture size 0x0 is invalid") only occurs for me if I have width/height = 0 when creating the Encoder; can you double-check to make sure those values are non-zero (maybe by doing a print of the two variables before calling the VideoEncoder constructor)?

As for the Shotgun stuff, I’ll have to look into that error message you’re getting (just tested and it worked for me :frowning:). And yeah, the sample scripts I’ve posted expect ‘username’ and a couple other params to be passed to them. Some of them are only submitted if you have Shotgun data by default, but you can always specify them in the “Additional args” text box (e.g., you could put ‘username=“Jon Gaudet”’ in there). The ‘username’, ‘entity’, and ‘version’ arguments are pretty much just for specifying text that the Template could overlay on top of the frames (at least, in the sample templates; you could conceivably do other stuff with it I guess).

Cheers,

  • Jon

EDIT: Looks like you squeaked another post in while I was typing this out :slight_smile:. Most of it still applies though!

Just as an additional note, I can see that the ParseCommandLine stuff in the DraftParamParser helper script we include might be a bit unintuitive. Maybe I’ll look into simplifying it a bit.

Cheers,

  • Jon

Does quicktime work with x64? If not how do use draft 32?

It should work… Can you post the values of the arguments (kbitrate, codec, etc) you are using to create the VideoEncoder, so I can try to replicate?

As for forcing 32bit, you can do it outside of Deadline just by starting a 32-bit python interpreter, then importing the 32-bit Draft library. To switch it inside of Deadline, you’d have to modify the Draft plugin to always start up the 32-bit python interpreter, instead of switching it based on the system.

I would love to do it line by line :smiley: but like I said I get:

NameError: name 'Image' is not defined

And all of the important Draft functions are Image. :stuck_out_tongue:

Try importing the Python module with “import Draft” (instead of “from Draft import *”), and specify “Draft.Image” instead of just “Image”. Hopefully that should fix it

Cheers,

  • Jon

[code]
[b]>>>from Draft import *

Draft.Image.ReadFromFile(inFile)[/b]


Traceback (most recent call last):
File “”, line 1, in
AttributeError: ‘module’ object has no attribute ‘Image’[/code]

Ok I restarted eclipse and changed it to “import Draft” and now it’s working. Bah!

Yeah, Python’s a bit weird in that “import Draft” and “from Draft import *” are not quite equivalent (thoughsometimes it looks like they are). Among other things, “import Draft” makes you use the module name before static functions and stuff (hence Draft.Image vs just Image); but I find “from … import …” to behave a bit unexpectedly sometimes…

Glad to hear you sorted it out though :slight_smile:

Cheers,

  • Jon

Ok I did a bunch of redefinitions so Class = Draft.Class.

I am now getting this error:

RuntimeError: Magick: UnableToOpenConfigureFile `type.xml' @ warning/configure.c/GetConfigureOptions/589

Also I think there is a typo in your docs. Every composite type is listed as Composite() instead of CompositeWithGravity() etc.

Privacy | Site terms | Cookie preferences