Skip to main content
Commonmark migration
Source Link

I need blender command-line access though spawn but keep running into an ENOENT error and it is hard to pinpoint what is missing. The command-line being passed in the sample application works in terminal.

Below are some details about the environment and the sample script I am using.


Environment (OSX El Capitan)

  1. Installed Blender 2.76b with:

    Installed Blender 2.76b with:

    brew install Caskroom/cask/blender

  2. Then add alias to bash_profile for terminal access:

    alias blender="/Applications/blender/Blender.app/Contents/MacOS/blender"

brew install Caskroom/cask/blender

  1. Then add alias to bash_profile for terminal access:

alias blender="/Applications/blender/Blender.app/Contents/MacOS/blender"

Test Code

#!/usr/bin/env node
var child_process = require('child_process');
var arguments = [
        '-b',
        'recipe.blend',
        '-o', 'test-#',
        '-f', 0
];
console.log("values: ", arguments);
var child = child_process.spawn('blender', arguments);

child.stdout.on('data', function(data) {
    console.log('data out: ', data.toString());
});
child.stderr.on('data', function(data) {
    console.error('error out: ',data);
});
child.on('close', function(code) {
    console.log('closing code: ' + code);
});

// Raw command-line for terminal. (PASS)
// blender -b recipe.blend -o test-# -f 0

I need blender command-line access though spawn but keep running into an ENOENT error and it is hard to pinpoint what is missing. The command-line being passed in the sample application works in terminal.

Below are some details about the environment and the sample script I am using.


Environment (OSX El Capitan)

  1. Installed Blender 2.76b with:

brew install Caskroom/cask/blender

  1. Then add alias to bash_profile for terminal access:

alias blender="/Applications/blender/Blender.app/Contents/MacOS/blender"

Test Code

#!/usr/bin/env node
var child_process = require('child_process');
var arguments = [
        '-b',
        'recipe.blend',
        '-o', 'test-#',
        '-f', 0
];
console.log("values: ", arguments);
var child = child_process.spawn('blender', arguments);

child.stdout.on('data', function(data) {
    console.log('data out: ', data.toString());
});
child.stderr.on('data', function(data) {
    console.error('error out: ',data);
});
child.on('close', function(code) {
    console.log('closing code: ' + code);
});

// Raw command-line for terminal. (PASS)
// blender -b recipe.blend -o test-# -f 0

I need blender command-line access though spawn but keep running into an ENOENT error and it is hard to pinpoint what is missing. The command-line being passed in the sample application works in terminal.

Below are some details about the environment and the sample script I am using.


Environment (OSX El Capitan)

  1. Installed Blender 2.76b with:

    brew install Caskroom/cask/blender

  2. Then add alias to bash_profile for terminal access:

    alias blender="/Applications/blender/Blender.app/Contents/MacOS/blender"

Test Code

#!/usr/bin/env node
var child_process = require('child_process');
var arguments = [
        '-b',
        'recipe.blend',
        '-o', 'test-#',
        '-f', 0
];
console.log("values: ", arguments);
var child = child_process.spawn('blender', arguments);

child.stdout.on('data', function(data) {
    console.log('data out: ', data.toString());
});
child.stderr.on('data', function(data) {
    console.error('error out: ',data);
});
child.on('close', function(code) {
    console.log('closing code: ' + code);
});

// Raw command-line for terminal. (PASS)
// blender -b recipe.blend -o test-# -f 0
edited tags
Link
David
  • 49.7k
  • 40
  • 162
  • 318
Source Link

Node.js spawn for command-line?

I need blender command-line access though spawn but keep running into an ENOENT error and it is hard to pinpoint what is missing. The command-line being passed in the sample application works in terminal.

Below are some details about the environment and the sample script I am using.


Environment (OSX El Capitan)

  1. Installed Blender 2.76b with:

brew install Caskroom/cask/blender

  1. Then add alias to bash_profile for terminal access:

alias blender="/Applications/blender/Blender.app/Contents/MacOS/blender"

Test Code

#!/usr/bin/env node
var child_process = require('child_process');
var arguments = [
        '-b',
        'recipe.blend',
        '-o', 'test-#',
        '-f', 0
];
console.log("values: ", arguments);
var child = child_process.spawn('blender', arguments);

child.stdout.on('data', function(data) {
    console.log('data out: ', data.toString());
});
child.stderr.on('data', function(data) {
    console.error('error out: ',data);
});
child.on('close', function(code) {
    console.log('closing code: ' + code);
});

// Raw command-line for terminal. (PASS)
// blender -b recipe.blend -o test-# -f 0