Skip to content

Instantly share code, notes, and snippets.

@shidarin
shidarin / constantDraw.py
Last active August 29, 2015 13:59 — forked from sean-c-johnston/constantDraw.py
Fork of https://gist.github.com/SurpriseTRex/10633830 showing some further revisions possible. Original description: Nuke script. Down-rezzes and re-draws the selected read node in the Node Graph, using Constant nodes as pixels. Accounts for aspect ratio. More than 20x20 not recommended for performance reasons.
__author__ = 'SurpriseTRex'
def draw_constant(res=10):
"""Re-draws a Read node using Constant nodes as pixels."""
# Checks that the user has selected a Read node.
try:
node = nuke.selectedNode()
except ValueError: