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
def duplicate_selected_node_with_inputs(): | |
sn = nuke.selectedNode() | |
nuke.nodeCopy(nukescripts.edit.cut_paste_file()) | |
nodes = nuke.allNodes(); | |
for i in nodes: | |
i.knob("selected").setValue(False) | |
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
from PySide import QtGui, QtCore | |
def removeInvalidClipboardData(): | |
oldMimeData = QtGui.qApp.clipboard().mimeData() | |
newMimeData = QtCore.QMimeData() | |
for format in oldMimeData.formats(): | |
if 'text/uri-list' in format: #This breaks maya paste | |
continue | |
data = oldMimeData.data(format) | |
newMimeData.setData(format, data) |
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
# Install pip | |
# $ curl -kL https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python | |
# | |
# Install Cython | |
# $ pip install cython | |
# | |
# compile command | |
python setup.py build_ext --inplace |
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 PySide.QtGui as QtGui | |
import PySide.QtCore as QtCore | |
_DEFAULT_ITEM_SIZE = QtCore.QSize(100, 85) | |
_USER_ROLE = QtGui.QStandardItem.UserType + 1 | |
class CustomItemWidget(QtGui.QWidget): | |
def __init__(self, parent=None): | |
super(CustomItemWidget, self).__init__(parent=parent) |
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
#http://stackoverflow.com/questions/265960/best-way-to-strip-punctuation-from-a-string-in-python | |
import re, string | |
table = string.maketrans("","") | |
regex = re.compile('[%s]' % re.escape(string.punctuation)) | |
def test_re(s): # From Vinko's solution, with fix. | |
return regex.sub('', s) | |
def test_trans(s): |