3
$\begingroup$

I wrote "PI" in a driver expression, and Blender threw up this warning message. I don't understand why it thinks there's a problem, nor what implications any of the choices have.

What is the security issue with using PI in a driver expression? What "unexpected behavior" is it talking about? If I choose "Ignore", will my driver stop working? If I choose "Allow Execution", am I inadvertently allowing other scripts I'm unaware of to run? And what does "Permanently allow execution of scripts" mean, is it saying any python scripts in any blender file can run henceforth, or what?

"For security reasons, automatic execution of Python scripts in this file was disabled: Driver '90*(var-1.0)*PI/180'. This may lead to unexpected behavior.

$\endgroup$
4
$\begingroup$

The problem isn't with the specific driver you've implemented, but with python scripts in general. The automatic execution of all python scripts is disabled by default.

From the Blender 2.90 Manual:

The ability to include Python scripts within blend-files is valuable for advanced tasks such as rigging and automation. However, it poses a security risk since Python does not restrict what a script can do.

Therefore, you should only run scripts from sources you know and trust.

Automatic execution is disabled by default, however, some blend-files need this to function properly.

This is mostly an issue when you are opening a Blender file which you didn't yourself make. It could contain any conceivable script.

In Blender Preferences > Save & Load there is a checkbox to Auto Run Python Scripts. You can add excluded paths to, for example, your downloads folder, so that foreign blend files are still restricted.

You can also manually enable scripts in specific blend files as you open then, by checking the Trusted Source box in the File Browser.

| improve this answer | |
$\endgroup$
  • $\begingroup$ I still don't understand what it objected to in this case, nor why it's prompting me about a blender file I just created and am working in (rather than opening). But the bigger picture makes sense now, thanks. $\endgroup$ – adurdin Sep 20 at 10:26
  • $\begingroup$ Blender by default objects to all python scripts, and your driver counts as a python script, regardless of its contents. You can configure Blender to allow python scripts by default in all files, and then exclude files in certain folders if you want. $\endgroup$ – Rekov Sep 20 at 21:57

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.