SyntaxHighlighter

2013年7月11日木曜日

outRangeHandler

set cut_paste_input [stack 0]
version 7.0 v5
StickyNote {
 inputs 0
 name StickyNote1
 label outRangeHandler
 note_font "Helvetica Bold Bold Bold Bold Bold Bold Bold Bold Bold"
 note_font_size 12
 note_font_color 0xff
 selected true
 xpos -29
 ypos -248
 addUserKnob {20 User l outRangeHandler}
 addUserKnob {1 list}
 addUserKnob {26 line l "" +STARTLINE}
 addUserKnob {22 addAllToList l "add all to list" T "for n in nuke.allNodes():\n    n.setSelected(False)\nfor n in nuke.allNodes('Read'):\n    n.setSelected(True)\nlist = nuke.thisNode()\['list'].value()\nfor i in nuke.selectedNodes():\n    if i.name() in list:\n        pass\n    else:\n        list = list + i.name() + '\\n'\nnuke.thisNode()\['list'].setValue(list)\nfor n in nuke.allNodes('Read'):\n    n.setSelected(False)" +STARTLINE}
 addUserKnob {22 addToList l "add to list" T "list = nuke.thisNode()\['list'].value()\nfor i in nuke.selectedNodes():\n    if i.name() in list:\n        pass\n    else:\n        list = list + i.name() + '\\n'\nnuke.thisNode()\['list'].setValue(list)" +STARTLINE}
 addUserKnob {22 clearList l "clear list" -STARTLINE T "nuke.thisNode()\['list'].setValue('')"}
 addUserKnob {22 highlightList l "highlight list" -STARTLINE T "for n in nuke.allNodes():\n    if n.name() in nuke.thisNode()\['list'].value():\n        n.setSelected(True)\n    else:\n        n.setSelected(False)"}
 addUserKnob {22 changeNodeColor l "change node color" -STARTLINE T "for n in nuke.allNodes():\n    if n.name() in nuke.thisNode()\['list'].value():\n        n.setSelected(True)\n    else:\n        n.setSelected(False)        \nnukescripts.color_nodes()"}
 addUserKnob {6 beforeIO l before +STARTLINE}
 addUserKnob {4 choiceBeforeMethod l "" -STARTLINE M {hold loop bounce black "" "" "" ""}}
 choiceBeforeMethod black
 addUserKnob {6 afterIO l after -STARTLINE}
 addUserKnob {4 choiceAfterMethod l "" -STARTLINE M {hold loop bounce black ""}}
 choiceAfterMethod black
 addUserKnob {22 setOutRangeType l "set out range type" -STARTLINE T "befIO = nuke.thisNode()\['beforeIO'].value()\nprint befIO\n\nif befIO == True:\n\tbeforeMeth = nuke.thisNode()\['choiceBeforeMethod'].value()\n\tif beforeMeth == \"hold\":\n\t\tbeforeMeth = 0\n\t\tprint beforeMeth\n\t\tfor n in nuke.allNodes():\n    \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n        \t\t\tn\['before'].setValue(beforeMeth)\n\telif beforeMeth == \"loop\":\n\t\tbeforeMeth = 1\n\t\tprint beforeMeth\n\t\tfor n in nuke.allNodes():\n    \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n        \t\t\tn\['before'].setValue(beforeMeth)\n\telif beforeMeth == \"bounce\":\n\t\tbeforeMeth = 2\n\t\tprint beforeMeth\n\t\tfor n in nuke.allNodes():\n    \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n        \t\t\tn\['before'].setValue(beforeMeth)\n\telif beforeMeth == \"black\":\n\t\tbeforeMeth = 3\n\t\tprint beforeMeth\n\t\tfor n in nuke.allNodes():\n    \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n        \t\t\tn\['before'].setValue(beforeMeth)\n\nafIO = nuke.thisNode()\['afterIO'].value()\nprint afIO\n\nif afIO == True:\n\tafterMeth = nuke.thisNode()\['choiceAfterMethod'].value()\n\tif afterMeth == \"hold\":\n\t\tafterMeth = 0\n\t\tprint afterMeth\n\t\tfor n in nuke.allNodes():\n    \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n        \t\t\tn\['after'].setValue(afterMeth)\n\telif afterMeth == \"loop\":\n\t\tafterMeth = 1\n\t\tprint afterMeth\n\t\tfor n in nuke.allNodes():\n    \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n        \t\t\tn\['after'].setValue(afterMeth)\n\telif afterMeth == \"bounce\":\n\t\tafterMeth = 2\n\t\tprint afterMeth\n\t\tfor n in nuke.allNodes():\n    \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n        \t\t\tn\['after'].setValue(afterMeth)\n\telif afterMeth == \"black\":\n\t\tafterMeth = 3\n\t\tprint afterMeth\n\t\tfor n in nuke.allNodes():\n    \t\t\tif n.name() in nuke.thisNode()\['list'].value():\n        \t\t\tn\['after'].setValue(afterMeth)"}
 addUserKnob {41 bookmark_1 l bookmark T StickyNote1.bookmark}
}

2013年7月9日火曜日

メモ_配列の場合の表記

for b in  nuke.allNodes('Transform'):
    b.knob('center').setValue((640,512))

for b in  nuke.allNodes('Crop'):
    b.knob('box').setValue((((0,-10,1280,1034))))

sn = nuke.selectedNodes()
for n in sn:

    n.knob('box').setValue((((0,0,1280,1024))))

- pass the value argument as a tuple: 

nuke.toNode("Transform1").knob("center").setValue((0, 1080)) 

- or set the value for each index separately 

nuke.toNode("Transform1").knob("center").setValue(0,0) 
nuke.toNode("Transform1").knob("center").setValue(1080,1) 


2013年7月4日木曜日

開いてるファイル セキュリティの警告の消し方

[開いてるファイル - セキュリティの警告]
[発行元:不明な発行元]
[種類:ショートカット]
Windows7-Shortcut
これを表示させない方法がこちら。
1. [ローカルグループポリシーエディター]を起動:gpedit.msc
2. [ユーザーの構成] [管理用テンプレート] [Windowsコンポーネント] [添付ファイルマネージャー]
[危険度の低いファイルの種類の一覧] を開く
Dangerfiles-01
3. [有効] にして .exe 拡張子を追加
Dangerfiles-02
これでいちいちメッセージに応答することなくアプリを起動できる。

メモ_番号歯抜けでも連番ファイルを順に読み込む

importFile()を使ってimportOptions.forceAlphabetical を true にすると番号歯抜けでも順に読み込める