3

using this command blender --help to get more help about Blender command line options, you can find this snippet

--python-text <name> Run the given Python script text block

So if I'm not wrong, this means that I can specify the name of text block which I would like to auto run at Blender start.

So my final command will look like this:
blender --python-text my_text_block_name scene.blend

Where "my_text_block_name" is the name of text block I wrote and save right in my blend file.

But, when I run this command, I have the following error.

Error: text block not found my_text_block_name.

What I'm doing wrong?

EDIT:
I'm using the latest official version of Blender for linux 64bit available at this moment (2.76)

Scantlight
  • 135
  • 7

1 Answers1

5

Unlike most command line programs the order of the options make a difference. The thing to remember is that blender executes each option in the order they are given, almost like a mini script.

The command you used blender --python-text my_text_block_name scene.blend says run this text block then open this file.

To get your example working you want to open the blend file then execute the text block - blender scene.blend --python-text my_text_block_name

More details about Blender command and some example of how order works.

Brainor
  • 103
  • 4
sambler
  • 55,387
  • 3
  • 59
  • 192