forked from openNuke/toolset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pasteToSelected.py
26 lines (24 loc) · 912 Bytes
/
pasteToSelected.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#author: Frank Rueter
#dateCreated: 19/02/2012
#source: http://www.nukepedia.com/python/nodegraph/pasteToSelected/
#licence:https://github.com/openNuke/toolkit/blob/master/LICENCE
#version:1.1
#Documentation:http://www.nukepedia.com/python/pasteToSelected
import nuke
class pasteToSelected():
def __init__(self):
if not nuke.selectedNodes():
nuke.nodePaste('%clipboard%')
return
selection = nuke.selectedNodes()
for self.node in selection:
self.toggleSelection()
for self.node in selection:
self.node['selected'].setValue(1)
nuke.nodePaste('%clipboard%')
self.node['selected'].setValue(0)
for self.node in selection:
self.toggleSelection()
def toggleSelection(self):
newValue = not self.node['selected'].value()
self.node['selected'].setValue(newValue)