Write Node Script

Write Node specific JavaScript objects and classes. More...

Classes

class  RemoteCmd
 The RemoteCmd JavaScript class. Send one sided commands to a remote host. More...
 
class  Process2
 The Process2 JavaScript class. Used to launch an external process. More...
 
class  about
 The about JavaScript global object. Provides information about the main application and the platform on which the script is running. More...
 
class  MessageLog
 The MessageLog JavaScript global object. Allows the user to print messages to the message log window. More...
 
class  System
 The System JavaScript global object. Call system specific command directly. More...
 
class  WriteNode
 The WriteNode JavaScript object. Provide information about rendered images and the movie to generate. More...
 

Detailed Description

Write Node specific JavaScript objects and classes.

Used in Scripted Movie scripts in Write Node, for example to create movie from rendered images as in an example below.

try
{
var images = WriteNode.imageFiles();
for (var i = 0; i < images.length; i++)
{
MessageLog.trace("generated image : " + images[i]);
}
var outputFile = WriteNode.movieDir() + "/" + WriteNode.movieName() + ".mov";
var soundFile;
{
soundFile = WriteNode.exportSound(16, 2, 22050);
}
// Use ffmpeg to generate movie from rendered images.
var ffmpeg = "ffmpeg";
if (about.isMacArch()) {
ffmpeg = System.getenv("HOME") + "/ffmpeg";
}
else if (about.isWindowsArch()) {
ffmpeg = "C:/ffmpeg.exe";
}
var args = [
ffmpeg,
"-y",
"-start_number",
"-i",
];
if (soundFile)
{
args = args.concat([
"-i",
soundFile,
"-c:a",
"copy"
]);
}
args = args.concat([
"-vframes",
"-r",
"-c:v",
"mpeg4",
"-pix_fmt",
"yuv420p",
outputFile
]);
MessageLog.trace("execute : " + args.join(" "));
var process = new Process2(args.join(" "));
var retCode = process.launch();
if (retCode != 0)
{
MessageLog.trace("Process return code: " + retCode);
if (process.errorMessage())
{
MessageLog.trace("Error: " + process.errorMessage());
}
MessageLog.error("Movie generation script error");
}
}
catch(err)
{
MessageLog.error("Movie generation script error: " + err);
}