Created
September 12, 2017 10:22
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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