Skip to content

Instantly share code, notes, and snippets.

@mattcox
mattcox / notifier_cmd.py
Last active June 17, 2018 20:48
Demonstrates how to write an executable and queryable command. The difference is that this command will listen for state changes in a scene. If the selection changes, then the command will check its enable/disable state and force any form it's embedded into to update.
#python
'''
Notifier Command
Demonstrates how to write an executable and queryable command.
The difference is that this command will listen for state changes
in a scene. If the selection changes, then the command will check
its enable/disable state and force any form it's embedded into
@mattcox
mattcox / query_cmd.py
Last active December 30, 2015 08:39
Demonstrates how to write an executable and queryable command. This will query a channel value on the first selected item, inputting a value will update the channel and querying the value will show the current value of the channel. The command will only be enabled if an item is selected, if there is no selection, then the command will be disabled.
#python
'''
Query Command
Demonstrates how to write an executable and queryable command.
This will query a channel value on the selected items,
inputting a value will update the channel and querying the
value will show the current value of the channel. The command
@lukpazera
lukpazera / cmdMatchXfrm.py
Created July 2, 2013 11:11
This is python translation of Matt Cox's matchXfrm.cpp C++ command and was done as an exercise while learning MODO python API. Matt's original: https://gist.github.com/mattcox/4742206
#python
""" Match Item Transforms.
Command matches transforms of one item to another.
Select 2 or more items and all items will be matched to last selected one.
I'm not author of this command.
This is python translation of Matt Cox's matchXfrm.cpp C++ equivalent
and was done as an exercise while learning MODO python API.
@dbr
dbr / nuke_viewer_shortcut_intercept.py
Created June 4, 2013 04:12
Test of finding Nuke's viewer widget, and intercepting the hardwired "c" shortcut and rewiring it to view the RGB channel
"""Test of finding Nuke's viewer widget, and intercepting the hardwired "c" shortcut and rewiring it to view the RGB channel
"""
from PySide import QtGui, QtCore
def findviewer():
stack = QtGui.QApplication.topLevelWidgets()
viewers = []
while stack: