most of our shows require multiple scenes, but that can be a problem if you’ve only got 1gb of gpu ram, or if your scene has a lot of textures and/or TOP usage.
according to the derivative team, the only way to reclaim GPU ram (for the time being!) is to lower the resolution of a TOP. i thought i’d share a couple of scripts that can be used to recursively set the resolution of every TOP in a network to 4x4. it also saves the original resolutions in a table, which are then referenced again when you want to re-enable that particular part of the network.
STORE_RESOLUTIONS:
if (`opexists("resolutions")`==0) then
opadd -n DAT:table resolutions
endif
tabdelete resolutions a
cc ../`opname("..")`
set path = ""
foreach o (`execute("lc -R")`)
set fpo = `strcat($path,$o)`
if (`strmatch("*:",$o)`==1) then
set path = `strcat(substr($o,0,strlen($o)-1),"/")`
else if (`strmatch("TOP*",optype($fpo))`==1) then
set r1 = `strcat($fpo,"/resolution1")`
set r2 = `strcat($fpo,"/resolution2")`
tabinsert resolutions r $fpo `par($r1)` `par($r2)`
opparm $fpo resolution1 4
opparm $fpo resolution2 4
endif
end
(i would also run this afterwards to stop cooking as well!)
opset -c off .
RESTORE_RESOLUTIONS:
for i=0 to `tabnr("resolutions")-1` do
opparm `tab("resolutions",$i,0)` resolution1 `tab("resolutions",$i,1)`
opparm `tab("resolutions",$i,0)` resolution2 `tab("resolutions",$i,2)`
end