JavaScript
Console
console.log("Hello, World!")Print a message to the console
App
app.node("Circle")Find the first node named "Circle"
app.createPixelNode("Circle")
app.createFloatNode("Value")
app.createDataNode("Text")Create nodes and add them to the center of the canvas
Node
console.log(self.name)Print the current JavaScript node name
self.position.x += 100 / sqrt(0.75)Moves the current node one grid step to the right
self.inputs.forEach( inputNode =>
console.log(inputNode.name)
)
self.outputs.forEach( outputNode =>
console.log(outputNode.name)
)Print all connected node names
Properties
app.node("Circle").property("Radius").value = 1.0Scale the Radius of a Circle Pixel Node
app.node("Noise").property("Colored").toggle()Toggles the Colored property of a Node Pixel Node
app.node("Noise").property("Position").point.x += 0.1Move the x axis of a Noise Pixel Node
app.node("Rectangle").property("Size").size.width = 0.125Set the width of a Rectangle Pixel Node
app.node("Image").property("Files").action()Open the file picker for an Image Pixel Node
let resolution = app.node("Circle").property("Resolution").resolution
resolution.width = 1920
resolution.height = 1080Set the resolution of a Pixel Node
let color = app.node("Circle").property("Color").color
// RGB
color.red = 0.0
color.green = 1.0
color.blue = 0.0
// HSB
color.hue = 1.0 / 3.0
color.saturation = 1.0
color.brightness = 1.0
// Alpha
color.alpha = 1.0Color the Circle Pixel Node green
app.node("JSON").property("URL").text = "http://some.site/file.json"Set the URL of a JSON Data Node
let uniform = app.node("Metal").property("Variable 1").uniform
uniform.name = "myValue"
uniform.value = Math.sqrt(0.75)Update a Uniform of a Metal Pixel Node
Pixel Node
let pixelNode = app.node("Circle")
pixelNode.resolution.width = 1920
pixelNode.resolution.height = 1080Get a Pixel Node and set it's resolution
app.node("Circle").render()Render the Pixel Node
Float Node
app.node("Value").floatsGet the float values of a Float Node
Data Node
let dataNode = app.node("Text")
dataNode.text = "Hello, World!"Change the text or code of a Data Node
let javaScriptNode = app.node("JavaScript")
javaScriptNode.runCode()Runs JavaScript Code
Project
app.projectAccess the current project
app.project.isFocusedCheck if the project is in focus
Window
app.project.windowAccess the currently focused window
app.project.windowsAccess all windows in the project (macOS)
Area
app.project.window.areaAccess the currently focused area
app.project.window.areasAccess the all areas in the current focused window (iPadOS & macOS)
app.project.window.area.currentMapNodeAccess the current map node of an Area
Root Map Node
app.project.rootMapNodeAccess the root Map Node
app.project.rootMapNode.nodesAccess nodes
Fullarea & Fullscreen
let circle = app.node("Circle")
circle.enterFullarea()
circle.exitFullarea()
circle.enterFullscreen()
circle.exitFullscreen()Enters and Exists Fullarea and Fullscreen
Last updated
Was this helpful?