Last active
March 1, 2017 15:01
-
-
Save greenvfx/f51df716906be1d8f7337ffa183d32f4 to your computer and use it in GitHub Desktop.
Just a fun script. Nodes run away from your selection.
This file contains 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 nuke | |
import random | |
import nukescripts | |
def runner(): | |
if nuke.thisKnob().name() == 'selected': | |
# RANDOM FOR X | |
random.seed(random.random()) | |
randFactX = (random.random()-0.5) | |
# RANDOM FOR Y | |
random.seed(random.random()) | |
randFactY = (random.random()-0.5) | |
# RUN AWAY | |
nuke.thisNode().setXpos(nuke.thisNode().xpos()+int(500*randFactX)) | |
nuke.thisNode().setYpos(nuke.thisNode().xpos()+int(500*randFactY)) | |
# CLEAR SELECTION | |
nukescripts.clear_selection_recursive() | |
#nuke.removeKnobChanged( runner ) | |
nuke.addKnobChanged( runner ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cool :)