Hi all,
I wrote fairly simple script to automatically shrink the DR region size when doing previews (or small render regions) to ensure that I'm always using all of my DR nodes. I've set the script to run as a "Pre-Render" script in the Render Setup "Common" tab and it works great when I click the "render" button. However if I hit F9 or use the Render Last button in the Vray VFB it doesn't seem to run the script. Fair enough I thought, I'll just register it as a #preRender callback script. Only now it doesn't seem to want to change the DR region size until AFTER the render is complete. Am I missing something or is this not possible? What confused me is that the docs state the Render Setup script is run AFTER any #preRender callbacks which makes me think it should work just fine. The script is below in case anyones interested (no guarantees though).
Thanks.
I wrote fairly simple script to automatically shrink the DR region size when doing previews (or small render regions) to ensure that I'm always using all of my DR nodes. I've set the script to run as a "Pre-Render" script in the Render Setup "Common" tab and it works great when I click the "render" button. However if I hit F9 or use the Render Last button in the Vray VFB it doesn't seem to run the script. Fair enough I thought, I'll just register it as a #preRender callback script. Only now it doesn't seem to want to change the DR region size until AFTER the render is complete. Am I missing something or is this not possible? What confused me is that the docs state the Render Setup script is run AFTER any #preRender callbacks which makes me think it should work just fine. The script is below in case anyones interested (no guarantees though).
Thanks.
Code:
vr = renderers.current global oldDrSize=vr.system_region_x coresPerNode=8 --Average number of cores on render nodes sizeFactor=6 --number of regions devoted to each core minDrSize=16 --minimum region size VFBregionOn=vrayVFBGetRegionEnabled() VFBregion=vrayVFBGetRegion() drSize=oldDrSize^2 if vr.system_distributedRender == true then ( drNodecount=1 ini = ((getdir #plugcfg) +"\vray_dr.cfg") cfg=openFile ini do ( if (readchars cfg 3) != "res" then ( skiptostring cfg " " if (readchars cfg 1) =="1" then drNodeCount +=1 skipToNextLine cfg ) )while (eof cfg ==false and (readchars cfg 3) != "res" ) if VFBregionOn==false then renderSize=renderWidth*renderHeight else renderSize=(VFBregion[3]-VFBregion[1])*(VFBregion[4]-VFBregion[2]) if ((renderSize/drSize)/coresPerNode/sizeFactor/2) <= drNodeCount then newDrSize=sqrt((renderSize/coresPerNode)/drNodeCount/sizeFactor) else newDrSize=oldDrSize if newDrSize>oldDrSize then newDrSize=oldDrSize if newDrSize<=minDrSize then newDrSize=minDrSize vr.system_region_x=newDrSize )
Comment