this
JS-0105355 *
356 * @returns A list of Dependency objects that represent the nodes in the current Nuke script.
357 */
358 private async getNodes(): Promise<Dependency[]> {359 const data = await sendToNuke(
360 "import nuke;import json;json.dumps({n.name():n.Class() for n in nuke.allNodes()})"
361 );
329 * @param element The node that was clicked
330 * @returns A list of Dependency objects that represent the knobs files.
331 */
332 private getKnobs(element: Dependency) {333 const items: vscode.ProviderResult<Dependency[]> = [];
334 osWalk(KNOBS_DIR).forEach((file) => {
335 const filename = path.basename(file);
316 }
317 }
318
319 getTreeItem(element: Dependency): vscode.TreeItem | Thenable<vscode.TreeItem> {320 return element;
321 }
322
308 *
309 * @param item The item that was clicked
310 */
311 itemClicked(item: Dependency): void {312 if (item.label.endsWith(".py")) {
313 vscode.window.showTextDocument(vscode.Uri.file(path.join(KNOBS_DIR, item.label)), {
314 preview: false,
239 *
240 * @param item A Node dependency item.
241 */
242 syncKnob(item: Dependency): void {243 const knobFile = new KnobFile(item.label);
244
245 const codeSnippet =
If a class method does not use this
, it can sometimes be made into a static function. If you do convert the method into a static function, instances of the class that call that particular method have to be converted to a static call as well (MyClass.callStaticMethod())
class Person {
sayHi() {
const greeting = document.createElement("div");
greeting.innerText = "Hello!";
document.appendChild();
}
}
const person = new Person();
person.sayHi();
class Person {
static sayHi() {
const greeting = document.createElement("div");
greeting.innerText = "Hello!";
document.appendChild();
}
}
Person.sayHi();