nap Posted August 3, 2013 Share Posted August 3, 2013 Hi, does anybody know how to change the tile index without recreating an Ifd? Is there any commandline arguments or python filtering for mantra? Thanks nap Quote Link to comment Share on other sites More sharing options...
crin Posted October 6, 2015 Share Posted October 6, 2015 I think I've got this working. each tile index has it's own mantra rop so they are separate processes on our farm. 1. Generate ifds 2. Change mantra command parm to say "mantra -P '[path to script] --index 0 --xtiles 4 --ytiles 2' " on every rop, changing the index number appropriately. here's the script import sys, mantra,re, math, optparse def filterCamera(): #arguements parser = optparse.OptionParser() parser.add_option("-i", "--index", help="tile index") parser.add_option("-x", "--xtiles", help="number of x tiles") parser.add_option("-y", "--ytiles", help="number of y tiles") (options, args) = parser.parse_args() tile_count_x=int(options.xtiles) tile_count_y=int(options.ytiles) tileindex = int(options.index) print "filtering ifd" #update tile index----------------------------------------------------------------- res =mantra.property('image:resolution') if tile_count_x * tile_count_y > 1: tile_res_x= res[0]/tile_count_x tile_res_y= res[1]/tile_count_y tile_idx_y = int(tileindex/tile_count_x) tile_idx_x = int(tileindex%tile_count_x) pc = [ math.ceil(tile_idx_x * tile_res_x), min(math.ceil((tile_idx_x+1.0) * tile_res_x) - 1, res[0]-1), math.ceil(tile_idx_y * tile_res_y), min(math.ceil((tile_idx_y+1.0) * tile_res_y) - 1, res[1]-1) ] mantra.setproperty('image:pixelcrop', pc) #updatefilename-------------------------------------------------------------------- rendername = mantra.property('image:filename') nrn = re.split("_tile\d{2}_", rendername[0]) filename = nrn[0]+"_tile"+str(tileindex).zfill(2)+"_"+nrn[1] mantra.setproperty('image:filename', filename) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.