AWS Thinkbox Discussion Forums

Implement Takes in the Cinema R17 submitters

Hi
Cinema R17 now has a wonderful new Takes system. (Not unlike Houdini’s) You can specify Takes on the command line (-take “take_name”) so it would be great if you could implement Takes in the C4D submitters.
We’ve used the R17 beta version in production for a while so we’ve already implemented our own custom R17 submitter. You can find it here if: github.com/bonsak/deadline-cust … submission if it’s of any use to you. Just do a diff on the 7.1 submitter and you’ll see what we’ve done.

The section with frame range tokens at line 625 (Main/SubmitC4DToDeadline17.py) is some custom stuff we made for a specific project that’s not really needed for a general R17 submitter.

The submitter is split into two: one for all versions up to 16 and one for 17. No need for that really. Was just easier to implement and test that way. (The selection between the two is done in DeadlineC4DClient.pyp)

Our submitter is implemented as a drop down in the submitter with either “All Takes”, “Main Take”, or you can select a specific take. What we havn’t implemented yet is a drop down entry for “Marked takes”. This is very useful as you can mark a selection of Takes to render in the Takes manager.

What also needs to be implemented is some kind of parsing of the new Token system in R17. You can now use variables in your output paths like this:

$prj = document name
$camera = current camera name
$take = current take name
$pass = pass/buffer type name
$userpass = user defined pass/buffer name (renamed in the render settings tree)
$frame = current frame
$rs = current render settings name
$res = image resolution
$range = animation range
$fps = frame rate

R17 works in Deadline without this, but paths are stored with the variables as strings, so it’s not possible get correct paths from the job in Deadline when the job is finished.

Another betatester (Niklas Rosenstein) suggested we do something like this:

[code]import string
import c4d

class TokenString(string.Template):
idpattern = ‘[a-zA-Z]+’

def get_token_context(doc):
take = doc.GetTakeData().GetCurrentTake()
rdata = doc.GetActiveRenderData()
bd = doc.GetRenderBaseDraw()
fps = doc.GetFps()
time = doc.GetTime()
range_ = (rdata[c4d.RDATA_FRAMEFROM], rdata[c4d.RDATA_FRAMETO])
return {
‘prj’: doc.GetDocumentName(),
‘camera’: bd.GetSceneCamera(doc).GetName(),
‘take’: take.GetName(),
# ‘pass’:
# ‘userpass’:
‘frame’: doc.GetTime().GetFrame(doc.GetFps()),
‘rs’: rdata.GetName(),
‘res’: ‘%dx%d’ % (rdata[c4d.RDATA_XRES], rdata[c4d.RDATA_YRES]),
‘range’: ‘%d-%d’ % tuple(x.GetFrame(fps) for x in range_),
‘fps’: doc.GetFps()}

def token_eval(text, context):
return TokenString(text).safe_substitute(context)

context = get_token_context(doc)
print token_eval(‘hello/$take-$res-$fps-$camera-$prj’, context)[/code]
Havn’t had time to look into this yet.

Cheers
Bonsak

Hey Bonsak,

Thanks for sharing! We’ve currently put this on the todo list targeting 7.2, so we’ll do our best to get it implemented in time.

Cheers,
Ryan

Great!

-b

Thanks a lot for implementing Takes in the c4d submitter in DL 7.2!
One small wish though: Could you please include a “Marked” item in the Take Selection drop down. In the Takes manager you have the option to mark takes for rendering. This is a nice way of tagging which takes are rendered and submit them to DL.

Cheers
Bonsak

Hey Bonsak,
Marked has been added to the take drop down, it will be included in 7.2.1 which should be coming in a few weeks. Of note for this, it will only be accessible if you are using C4D R17 SP1 or later since without sp1 there is no accessed to them being marked in the python api.

Grant

I know. Thanks!

-b

Privacy | Site terms | Cookie preferences