0

I have placed a startup file named "blender_startup.py" in "C:\Program Files\Blender Foundation\Blender 3.3\3.3\scripts\startup" folder but the file does not seem to run automatically when i start blender. The contents are:

import bpy
import os
filename = "P:\\_blenderpython\\helper280.py"
exec(compile(open(filename).read(), filename, 'exec'),globals())

Of course the file helper280.py exists and the above commands run fine when i paste them in the python console.

Any ideas on what might be wrong?

  • 1
    Have you tried to add a print() to the file and checked the System Console window for any errors to actually see if the file is executed? – Blunder Feb 25 '23 at 14:47
  • It works for me. Make sure that your P path really works. Try using C path too to test, and as Blunder pointed out, do some print statements to see if they come out. – Harry McKenzie Feb 26 '23 at 03:25
  • I tried that and nothing is printed. I also set a variable and when blender starts, it doesn't know the variable – Spiros Papageorgiou Feb 26 '23 at 19:40
  • Hmm, looks like Blender ignores your file for some reason. I've tested it, too, and it works when I put the "blender_startup.py" in "C:\Program Files\Blender Fondation......\startup" and in "%appdata%\Blender Foundation..." (user home). Hard to tell, why it's not working for you. – Blunder Feb 27 '23 at 02:31

0 Answers0