JRAB, thanks a lot for the reply. The issue we ran into for this was actually
processing, re-calculating for each and every frame in the frame range.
Because we couldn't find how to execute the "re-calculate" or "refresh" for the
viewport via Python. We had to resort to actually rendering each sequence.
First option was to blend all the frames together or mix them so they can be
process all together through one Write node. The hiccup we had in this option
was that if multiple sequences have a corruption on the same frame, it only
detects the first exception in the tree of process and stops. Therefore
missing any errors in other sequences that go past the first process in the
tree.
Ultimately we did this, and although processing wise it is time consuming and
this probably isn't the most efficient way to achieve this. It is automated
and completely 100% accurate.
1. Strip the script to Reads only and disable Postage Stamps to increase
efficiency:
n = nuke.allNodes()
for i in n:
if i.Class() == "Read":
i.knob("selected").setValue(True)
s = nuke.selectedNodes()
b = nuke.allNodes()
for n in b:
if n not in s:
nuke.delete(n)
for a in nuke.allNodes():
try:
a['postage_stamp'].setValue(0)
except:
pass
2. Use this script to automatically create a write for each read, inheriting
the reads input filepath.
http://www.nukepedia.com/python-scripts/import-export/make-write-from-read/
3. Run this from the script editor in Nuke's GUI to generate the errors to a
.txt error log.
import sys
import os
def uniqueList(seq, idfun=None):
# order preserving
if idfun is None:
def idfun(x): return x
seen = {}
result = []
for item in seq:
marker = idfun(item)
# in old Python versions:
# if seen.has_key(marker)
# but in new ones:
if marker in seen: continue
seen[marker] = 1
result.append(item)
return result
start = 1
end = 1
writeNodes = []
for n in nuke.allNodes():
if n.Class() == "Write":
writeNodes.append(n)
x = []
for i in range(start, end+1):
for n in writeNodes:
try:
nuke.execute ( n.name(), i, i)
except: # catch *all* exceptions
e = sys.exc_info()[1]
splits = str(e).split('"')
if len(splits) > 1:
x.append( str(e).split('"')[1] )
else:
x.append(str(e))
x = uniqueList(x)
# Write info to file
dir = nuke.script_directory()
f = open(os.path.join(dir, 'errorLog.txt'), 'w')
f.write('\n'.join(x))
f.close()
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python