8
$\begingroup$

We have a preferences option to enable auto-run of python scripts when opening blend files. We can also add paths that are excluded from auto-running scripts. Then we have a cli options to enable or disable auto-running scripts and to bypass the startup.blend with --factory-startup.

In regard to auto-running scripts which of these options overrides all others?

If my startup.blend disables auto-run, can a python script be run from the cli to enable auto-run for the blend being opened?

Does --factory-startup bypass my auto-run settings?

$\endgroup$
7
$\begingroup$

It seems that the order is as follows (in order from weakest to strongest):

  1. Startup .blend settings (does not override anything)

  2. --factory-startup will override all startup .blend preferences (including auto exec), but the default setting for auto exec is disabled (disallowing auto execution globally).

  3. -y (--enable-autoexec) enables
    -Y (--disable-autoexec) disables
    Both these options override the startup .blend auto exec preferences (including when used with --factory-startup) allowing auto execution. Note that it does not edit the preferences (even temporarily), it just allows execution.

  4. Running a script with -P (--python, --python-text, --python-expr) will execute the script immediately ignoring auto-execution settings. It is possible to enable auto-execution from such a script.

$\endgroup$
  • $\begingroup$ 4. But it only allows to run the script given to -P, or does it also allow other scripts? I guess only that script is executed, but can probably import and execute others. Text datablocks registered as module shouldn't be allowed, only because a certain script was passed for execution. $\endgroup$ – CoDEmanX Mar 11 '14 at 9:58
  • $\begingroup$ @CoDEmanX - clarified the -P behavior. $\endgroup$ – ideasman42 Mar 11 '14 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.