Python: Support multiple custom script directories in Preferences #104876

Merged
Julian Eisel merged 9 commits from JulianEisel/blender:temp-multiple-script-dirs into main 2023-04-11 15:21:06 +02:00
1 changed files with 2 additions and 1 deletions
Showing only changes of commit 7feb808e29 - Show all commits

View File

@ -346,7 +346,8 @@ def script_path_pref():
first valid of these script paths for now, for compatibility.
"""
# TODO how to handle deprecation of this?
JulianEisel marked this conversation as resolved Outdated

This comment can be removed and a deprecation warning can be shown, e.g.

from warnings import warn
warnings.warn(
    "bpy.utils.script_path_pref() is deprecated, use script_paths_pref() instead!"
    DeprecationWarning,
    stacklevel=2,
)
This comment can be removed and a deprecation warning can be shown, e.g. ``` from warnings import warn warnings.warn( "bpy.utils.script_path_pref() is deprecated, use script_paths_pref() instead!" DeprecationWarning, stacklevel=2, ) ```

Note that I think we could even consider removing the function, scripts that use it are likely not to function properly and I don't think its a widely used function either (none of the add-ons distributed with Blender use it for e.g.).

Note that I think we could even consider removing the function, scripts that use it are likely not to function properly and I don't think its a widely used function either (none of the add-ons distributed with Blender use it for e.g.).

Will leave this up to you to decide. Can be removed in a separate change.

Will leave this up to you to decide. Can be removed in a separate change.
return script_paths_pref()[0]
script_paths = script_paths_pref()
return script_paths[0] if len(script_paths) > 0 else ""
def script_paths_pref():