matrixに値を入れたいとき、
When you want to set the value into matrix,
node['matrix'].setValueAt(value, frame, index)
node['matrix'].getValueAt(frame)[index]
node['matrix'].setValueAt(value, frame, index)
node['matrix'].getValueAt(frame)[index]
import nuke def shiftHP(): shiftH = nuke.toNode('preferences')['GridWidth'].value() sn = nuke.selectedNodes() for n in sn: posX = n['xpos'].value() newPosX = posX + shiftH n['xpos'].setValue(newPosX) def shiftHN(): shiftH = nuke.toNode('preferences')['GridWidth'].value() sn = nuke.selectedNodes() for n in sn: posX = n['xpos'].value() newPosX = posX - shiftH n['xpos'].setValue(newPosX) def shiftVP(): shiftV = nuke.toNode('preferences')['GridHeight'].value() sn = nuke.selectedNodes() for n in sn: posY = n['ypos'].value() newPosY = posY - shiftV n['ypos'].setValue(newPosY) def shiftVN(): shiftV = nuke.toNode('preferences')['GridHeight'].value() sn = nuke.selectedNodes() for n in sn: posY = n['ypos'].value() newPosY = posY + shiftV n['ypos'].setValue(newPosY)
import NodeShift m.addCommand("shiftHP", "NodeShift.shiftHP()", "ctrl+shift+Right") m.addCommand("shiftHN", "NodeShift.shiftHN()", "ctrl+shift+Left") m.addCommand("shiftVP", "NodeShift.shiftVP()", "ctrl+shift+Up") m.addCommand("shiftVN", "NodeShift.shiftVN()", "ctrl+shift+Down")
nuke.toNode('Transform1')['translate'].animation(0).keys()[1].y
nuke.toNode('Transform1')['translate'].animation(0).keys()[1].x
nuke.animation("Transform1.translate.x" , "x", ("2", "10"))
nuke.animation("Transform1.translate.x" , "y", ("2", "-30"))
animation(i).keys()
nuke.animation("ノード名.アトリビュート名" , "コマンド名", (コマンドの種類に応じた引数))
import nukeimport osdef main():sn = nuke.selectedNode()fP = sn['file'].value()dirP = os.path.dirname(fP)dirP = dirP.replace("/", "\\")dirP = dirP + "\\"#print dirPos.popen("explorer.exe" + " " + os.path.dirname(dirP))
import nukeimport osdef main():sn = nuke.selectedNode()fP = sn['file'].value()dirP = os.path.dirname(fP)os.popen("open" + " " + os.path.dirname(dirP))
import dirOpenm = nuke.menu("Nodes")m.addCommand("dirOpen", "dirOpen.main()", "ctrl+shift+o")
import os sn = nuke.thisNode() fp = sn['file'].value() dirP = os.path.dirname(fp) if not os.path.exists(dirP): os.makedirs(dirP)
import os import nuke def main(): sn = nuke.thisNode() fp = sn['file'].value() dirP = os.path.dirname(fp) if not os.path.exists(dirP): os.makedirs(dirP)
import makeDir;makeDir.main()
import makeDir makeDir.main()
nuke.knobDefault("Write.beforeRender", "import makeDir;makeDir.main()")
import makeDir;makeDir.main()
import makeDir
makeDir.main()