Skip to main content

Script

Run Lua scripts.

λvTextDoActionExecutes Fusion actions The "Action Name" text field is where the action you want to run is entered. The "Action Params" text field contents are placed inside a Lua table like element \{\}. This information is used to specify any extra attributes you would like to pass along to the action when it is run. The "Wrap Lines" checkbox makes it possible to enable/disable line wrapping in the text preview area. DoAction is launched via the "self.Comp:Execute()" function so it is run asynchronously.
λvTextDoStringReturn a Text object from running a string of Lua code The node automatically creates new text input connections as needed. The text based input data can be accessed in the script using a Lua table variable named "tbl". The text based output connection on the node receives the data that is defined by the "return" command. The "Script Header Wire" input is used to specify a text datatype connection of code that is appended to the top of the Lua Script field contents when run. The script content connected to the Script Header Wire field is typically sourced from a vTextCreateMultiline or vTextFromFile node. In your Lua Script code you can iterate through each record in the Lua table data using: for i, v in ipairs(tbl) do end If you need to temporarily troubleshoot the internals of what your code is doing in the vTextDoString node there are two diagnostic checkbox controls labelled "Show Code" and "Show Dump". The output from those options is displayed in the Console window. For performance reasons you probably want to leave those options turned off most of the time when rendering long sequences in Fusion to reduce the Console logging overhead.
λvTextExecuteExecutes code sourced from a Fusion Text object The "Script Language" control is used to define if you want to use Lua or Python code in the text input field. This code is executed asynchronously by the Fusion API function "self.Comp:Execute()". In the code block you can return a value from the executed script to the node graph with the function "OutText()". An example of that would be 'OutText("Hello World")'. The output from the vTextExcute node is a text based filepath that holds any results you might have written to disk using the function "OutText()".
λvTextProcessOpenLaunches a command-line process via popen The "Text" field is used to define the executable program name and the command-line arguments you want to run from a shell session. The output from the shell session is returned to the node's output connection as a text data type result. Typically a vTextSubFormat node is used to build the executable command line string that is supplied to the Text input on a vTextProcessOpen node. If you need cross-platform support you can use a vTextCreatePlatform or vTextCreatePlatformBrowse node to automatically define the per-OS specific elements like the program name to run. If you need to access more complex automation techniques, or dynamically define custom environment variables, it is possible to use a vTextToFile node to export a dynamically created .bat (Windows), .sh (Linux), .command (macOS) script file to the TEMP folder on disk. Then the vTextProcessOpen node could be used to execute this document by specifying in the "Text" field both the shell interpreter to use, like "/bin/zsh" or "/bin/zsh", and the external script file to run "/bin/zsh" "/tmp/VonkTempScript.command" "VonkTempScript.command" File Contents: #!/bin/zsh say Hello Vonk World!
λvTextShellBGLaunch a command-line shell task in the background via bmd.executebg() The "Wait" checkbox can be used to make the node act in a blocking fashion that will pause the rendering of this branch of the comp until the launched process has completed and exited. Note which open /usr/bin/open Also, the vTextShellBG node is used to launch a program with its command line arguments specified. It is not a full terminal environment so shell redirection approaches and expanding environment variable tokens in the command string are not supported. If you need those extended command line scripting features, write out a temporary .bat/.sh/.command file to disk then use vTextShellBG to run the script.