7

Our renderfarm is running Blender from the network. How can I enable addons on startup without saving user preferences for each node?

The following works when I run it from Blender REPL during a regular Blender session. I thought I would easily add a script in script/startup and run:

import addon_utils
addon_utils.enable("animation_nodes")

But it doesn't find the addon. Maybe the startup script is run before the addons are scanned? Any ideas?

What would be the best way then to enable it for all the rendernodes?

zeffii
  • 39,634
  • 9
  • 103
  • 186
knekke
  • 1,331
  • 2
  • 15
  • 33
  • Maybe an addon should be installed first, before ebeing able to enable it. The blender install should perfectly know where all addon files are, and its exact name to use in python (or gui) to enable/disable it. Are you sure it is? – m.ardito Oct 07 '15 at 15:23
  • please see the updated question. – knekke Oct 07 '15 at 18:50
  • i've simplified the question again. – zeffii Oct 07 '15 at 20:35
  • thanks!... actually all would be fine, if USER settings would override LOCAL settings: http://blender.stackexchange.com/questions/19534/shared-network-install-config-priority ... that would solve so many problems for me – knekke Oct 08 '15 at 06:49

1 Answers1

9

You can enable a comma-separated list of addons through the command line/terminal, so you're able to do that through a script. That functionality is described in the blender terminal help (./blender --help).

An example would be ./blender -b --addons animation_nodes,meshlint [file] to enable animation nodes and meshlint, then load your file.

If you need to load a single python script, such as a set of operations you want to use on a mesh object, you can use the --python flag. ./blender -b --addons animation_nodes,meshlint [file] --python [myscript.py] loads blender in the background, loads specified addons, loads the file, then executes the python script.

Unfortunately, the wiki is not helpful here; it only goes over basic rendering functionality. Simply call the help flag to see everything the executable can do from the terminal. A specific thing to remember is that flags are order-sensitive. Those flags listed first will be interpreted first, sequentially until the end of the command.

Italic_
  • 1,563
  • 1
  • 9
  • 20