Last active
August 29, 2015 13:56
-
-
Save draconiansolo/9133920 to your computer and use it in GitHub Desktop.
Nuke Smooth a Stroke
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
import random | |
def smoothStroke(stroke): | |
node=nuke.toNode("RotoPaint1") | |
curves=node["curves"] | |
brush=curves.toElement(stroke) | |
for i in range(len(brush)): | |
#help(cp) | |
#break | |
if i>0 and i<len(brush)-1: | |
brush[i].removeAllKeys() | |
brush[i].setPosition((brush[i-1].getPosition(nuke.frame())+brush[i].getPosition(nuke.frame())+brush[i+1].getPosition(nuke.frame()))/3) | |
curves.changed() | |
smoothStroke("Brush1") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment