Does anyone know how to change the script directory in the user preferences using Python from command line?

I believe it has something to do with bpy.types.UserPreferencesFilePaths, but I'm not sure how to use it.

Please help, thanks!

import bpy
from bpy import context
path = "/somepath"
context.user_preferences.filepaths.script_directory = path
| improve this answer | |
  • $\begingroup$ thank you, that works for 2.77 and 2.78, have yet to try with 2.76, but my guess is it works for 2.76 as well $\endgroup$ – Chunlin Hu Nov 1 '16 at 8:46

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.