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
from PyQt4 import QtCore,QtGui | |
from tableModel import TableModel | |
#import tableModel.TableModel as PaletteTableModel | |
import sys | |
class PaletteListModel(QtCore.QAbstractListModel): | |
def __init__(self, colors = [], parent = None): | |
super(PaletteListModel,self).__init__(parent) | |
self.__colors = colors |
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 os | |
def sequenceExists(seqPath, firstFrame, lastFrame, sep=None): | |
""" Checks if sequence exist on disk. | |
seqPath (string): image sequence path | |
example: J:/Footages/33x01_02a/33x01_02a.%04d.sgi | |
where %04d can be any sequence like 0001-0265, 231-689 but not KFd001- KFd567 string | |
change buildPath at line 21 to customize for compatibility |
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 | |
sel = nuke.selectedNodes() | |
if sel: | |
# create backdrop for selection | |
bckDrop = nukescripts.autoBackdrop() | |
for eachNode in sel: | |
if eachNode.Class() == 'Read': | |
bckDrop.setName(eachNode.name(), uncollide=True) | |
else: |
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 | |
y = [os.path.dirname(each['file'].getValue()) for each in nuke.selectedNodes() if each.Class() == 'Read' and not os.path.exists(os.path.dirname(each['file'].getValue()))] | |
sa = nuke.Panel("printFilePath", 600) | |
sa.addMultilineTextInput("Error'd Read Nodes","\n".join(y)) |
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
def orderSelectionToList(): | |
""" Set the node order in list same as order in DAG | |
Returns: | |
selNodes(List): sorted node order in list as in DAG | |
""" | |
selNodes = nuke.selectedNodes() | |
lastNode = nuke.selectedNode() | |
if lastNode.dependencies()[0] in selNodes: | |
return list(reversed(selNodes)) | |
else: |
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
if orderSelectionToList()[0].dependencies()[0].Class() == 'Read': | |
nuke.message("Cannot Move up further to %s" % orderSelectionToList()[0].dependencies()[0].name()) | |
else: | |
selection = orderSelectionToList() | |
lastNode = orderSelectionToList()[-1]#.dependent()[0] | |
lastNodeDep = orderSelectionToList()[-1].dependent()[0] | |
moveNode = orderSelectionToList()[0].dependencies()[0] | |
[each.setSelected(False) for each in orderSelectionToList()] | |
moveNode.setSelected(True) | |
nuke.extractSelected() |
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
for each in nuke.allNodes('Read'): | |
if not len(each.dependent()): | |
if not each.maxOutputs() == 0: | |
print nuke.delete(each) |
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
# Add Custom menu for scripts | |
menubar=nuke.menu("Nodes") | |
m=menubar.addMenu("San") | |
# Add Python scripts to the custom menu | |
m.addCommand("Move Up", "import moveupdown; \ | |
moveupdown.moveUp()", icon="PostageStamp.png") | |
m.addCommand("Move Down", "import moveupdown; \ |
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
sel = nuke.selectedNode() | |
for i in range(0, sel.inputs()): | |
print "input %s of %s is connected to %s " % (i, sel.name(), sel.input(i).name()) |
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 sys | |
import ast | |
import logging | |
class ItemNotString(Exception): | |
pass | |
class FilterList(object): |
OlderNewer