https://www.nukepedia.com/reference/Tcl/
Nuke Developer Kit (NDK) 9.0v4: Nuke TCL Scripting: Main Page
Nuke Scripting Nuke's scripting language is based on TCL. The syntax of Tcl is described in detail in the TCL manual page. Note that Nuke does not use the Tk user interface toolkit, this is often described as part of Tcl. init.tcl: Whenever Nuke starts up,
www.nukepedia.com
Nuke TCL 스크립팅 개요 (Nuke Developer Kit 9.0v4)
Nuke에서 사용되는 TCL 스크립팅에 대한 주요 내용을 다음과 같이 요약할 수 있습니다:
- TCL 스크립팅의 기본:
- Nuke의 스크립팅 언어는 TCL에 기반을 두며, 이 문법은 TCL 매뉴얼에서 자세히 설명됩니다.
- Nuke는 일반적인 Tcl에서 사용되는 Tk 사용자 인터페이스 툴킷을 사용하지 않습니다.
- 스크립트 파일:
- init.tcl: Nuke 시작 시 실행되며, 여러 번 실행될 수 있으므로 시간이 많이 소요되지 않도록 설계해야 합니다.
- menu.tcl: 인터랙티브 모드에서 실행되며, Nuke의 DAG 창 인터페이스, 도구 모음, 단축키 등을 사용자 정의할 수 있습니다. DAG(Directed Acyclic Graph)는 노드와 연결을 나타냅니다.
- 플러그인 및 연산자:
- 알려지지 않은 명령어를 실행하면 해당 이름의 플러그인을 로드하려 시도합니다.
- 플러그인이 로드되지 않으면 “unknown command” 오류가 발생합니다.
- 새로운 연산자는 대문자로 시작하여 기본 명령어와 구분됩니다.
- 연산자 스택:
- 연산자는 “스택”에 저장되며, 사용자 인터페이스에서 연산자가 클릭되면 스크립트 명령어가 이에 맞게 동작합니다.
- 연산자의 노브(knob) 값 등을 설정할 수 있습니다.
https://benmcewan.com/blog/2018/05/30/tcl-tips-for-visualizing-data-in-your-comp/
TCL Tips For Visualizing Data In Your Comp
I often find myself labelling nodes with descriptors, so it’s clear what each node is doing. This usually involves a TCL snippet to return a value of a certain knob. This article is intended …
benmcewan.com
NODE LABELS & INFORMATION TO DISPLAY USING THE TEXT NODE
노브의 값 설정
Code: [knob <nodeName>.<knobName> <valueToSet>]
Example: [knob Transform2.translate.x 30]
노브 값 반환
Code: [value <knobName>]
Example (Tracker Node): Motion: [value transform]\\nRef Frame: [value reference_frame]
다른 노드에서 노브 값 반환
Code: [value <nodeName>.<knobName>]
Example: [value Blur1.channels]
입력 노드의 이름 반환
Code: [value input.name]
업스트림에 연결된 읽기 노드의 파일 이름 반환
Code: [basename [value [topnode].file ]]
파일 확장자 없이 업스트림에 연결된 읽기 노드의 파일 이름을 반환합니다
Code: [basename [file rootname [value [topnode].file]]]
업스트림에 연결된 읽기 노드의 프레임 범위 반환
Code: Frame Range: [value first_frame] – [value last_frame]
특정 좌표에서 채널의 값 샘플링
Code: [sample [node input] <colourChannel> <xCoordinate> <yCoordinate>]
Example: [sample [node input] red 1094 354]
스위치 노드의 값을 반환하고 결과를 숫자에서 더 설명적인 단어로 변경합니다
Code: [if {[value <nodeName>.<knobName>]==<value>} {return “<Whatever text you want to replace <value> with>”} elseif{[value <nodeName>.<knobName>]==<value2>} {return “<Whatever text you want to replace <value2> with>”} else {return “<Whatever your default value should be, if the previous conditions aren’t met>”}]Example: [if {[value Switch1.which]==1} {return “Viewing the first option”} elseif {[value Switch1.which]==2} {return “Viewing the second option”} else {return “No Value Returned”}]
특정 표현식의 문자열을 다른 단어로 바꾸기
*Code: [regsub -all “<string to look for in expression>” [value <expression>] “What to replace the string with”]Example: [regsub –all “THR-025” [value [node this].file] “Sequence: THR* // *Shot: 025″]*
EXPRESSIONS
특정 프레임에서 노브의 값을 구합니다
Code: <nodeName>.<knobName>(<frameNumber>)
Example: Transform1.translate.x(50)
새 노드에서 애니메이션 타이밍을 50프레임으로 오프셋합니다(플레이트 프레임 범위가 변경될 때 트래커를 오프셋하는 데 유용)
Code: <nodeName>.<knobName>(frame+<offsetAmount>)
Example: Transform1.translate.x(frame+50)
프로젝트 형식의 가치 반환
width: [value root.width]height: [value root.height]
노드 입력 형식의 값 반환
width: [value input.width]height: [value input.height]
이미지의 중심점 찾기
x: [value format.width]/2y: [value format.height]/2
bbox의 값을 반환합니다
x: [value bbox.x]
y: [value bbox.y]
r: [value bbox.r]
t: [value bbox.t]
bbox의 중심점을 반환합니다
x: ([value bbox.x]+[value bbox.r])/2
y: ([value bbox.y]+[value bbox.t])/2