PDA

View Full Version : Py Batch Render - Put Pre-render cmnds in Var?


EightBit
10-24-2011, 09:40 PM
I'm writing scripts to manage rendering, but having trouble putting my preRender commands (which are Mel) in a var. Help please!
Thanks.
# This works:
destPath = r'D:\Tmp\junkRender'
scene2Render = r'D:\3D\MayaPractice\Scenes\RenderLayerTest01_Lites.mb'
os.system (' render -s 17 -e 17 -of png -fnc name.#.ext -pad 3 -im junk03textr -r mr -cam persp -alpha 0 -preRender " setAttr "miDefaultFramebuffer.gamma" 1 " -log ./testlog.txt -rd ' + destPath + ' ' + scene2Render )

# I want to put the pre-render commands into a var, these all fail:
#preRndrCmd = 'setAttr \"miDefaultFramebuffer.gamma\" 1;' # More than one file name is not allowed: 1; ...
#preRndrCmd = 'setAttr "miDefaultFramebuffer.gamma" 1;' # More than one file name is not allowed: 1; ...
preRndrCmd = 'setAttr miDefaultFramebuffer.gamma 1;' # More than one file name is not allowed: 1; ...

os.system (' render -s 17 -e 17 -of png -fnc name.#.ext -pad 3 -im junk03textr -r mr -cam persp -alpha 0 -preRender ' + preRndrCmd + ' -log ./testlog.txt -rd ' + destPath + ' ' + scene2Render )
moveSrc = destPath+'\\renderLayr3_rLayr\\'

EightBit
10-24-2011, 09:46 PM
Got it:
preRndrCmd = ' " setAttr miDefaultFramebuffer.gamma 1; setAttr "pSphereShape2.primaryVisibility" 0; " '

# or multiline for easing reading:
preRndrCmd = ' "\
setAttr miDefaultFramebuffer.gamma 1;\
setAttr "pSphereShape2.primaryVisibility" 0;\
setAttr "renderLayr2_rLayr.renderable" 0;\
" '

CGTalk Moderation
10-24-2011, 09:46 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.