this
JS-0105354 *
355 * @returns A list of Dependency objects that represent the nodes in the current Nuke script.
356 */
357 private async getNodes(): Promise<Dependency[]> {358 const data = await sendToNuke(
359 "import nuke;import json;json.dumps({n.name():n.Class() for n in nuke.allNodes()})"
360 );
328 * @param element The node that was clicked
329 * @returns A list of Dependency objects that represent the knobs files.
330 */
331 private getKnobs(element: Dependency) {332 const items: vscode.ProviderResult<Dependency[]> = [];
333 osWalk(KNOBS_DIR).forEach((file) => {
334 const filename = path.basename(file);
315 }
316 }
317
318 getTreeItem(element: Dependency): vscode.TreeItem | Thenable<vscode.TreeItem> {319 return element;
320 }
321
307 *
308 * @param item The item that was clicked
309 */
310 itemClicked(item: Dependency): void {311 if (item.label.endsWith(".py")) {
312 vscode.window.showTextDocument(vscode.Uri.file(path.join(KNOBS_DIR, item.label)), {
313 preview: false,
238 *
239 * @param item A Node dependency item.
240 */
241 syncKnob(item: Dependency): void {242 const knobFile = new KnobFile(item.label);
243
244 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();