Skip to content

Instantly share code, notes, and snippets.

@kpprt
Created September 12, 2017 10:22
Show Gist options
  • Save kpprt/4a8f7f619773dfca34ae4b101b8e0606 to your computer and use it in GitHub Desktop.
Save kpprt/4a8f7f619773dfca34ae4b101b8e0606 to your computer and use it in GitHub Desktop.
Print out stats about a comp in Nuke. Returns a list of used node classes and their number of occurrences.
stats = dict()
for n in nuke.allNodes():
node_class = str(n.Class())
if node_class in stats:
stats[node_class] += 1
else:
stats[node_class] = 1
import operator
sorted_stats = sorted(stats.items(), key=operator.itemgetter(1), reverse=True)
for entry in sorted_stats:
print '{0}: {1}'.format(entry[0], entry[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment