Blog‎ > ‎

Node Disabling

posted Oct 24, 2018, 7:59 AM by Levente Vass   [ updated Oct 25, 2018, 7:15 AM ]
  # Python      

This is a simple node disable tool, it's useful if you have a lot of VectorBlur in your graph :).
 
# get type of selected node
# print(nuke.selectedNode().Class())

def node_disabling(n_s_mode, n_class, switcher=False): """Simple node disabler. Parameters
----------
 n_s_mode: str
all -- search in all nodes sn -- search in selected nodes n_class: str
node class switcher: boolean
False or 0 -- node enabled True or 1 -- node disabled

 Returns
-------
None """
n_s = {n_s_mode == 'all': nuke.allNodes(), n_s_mode == 'sn': nuke.selectedNodes()}.get(True, 0)
for i in n_s: if i.Class() == '{0}'.format(n_class): i.knob('disable').setValue(switcher) del n_s
# example: #node_disabling('all', 'Grade', 0)
ċ
simple_node_disabling.py
(1k)
Levente Vass,
Oct 25, 2018, 7:15 AM
Comments