diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-21 04:47:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-21 04:55:02 +0300 |
commit | 63fcbfc3a7325d79b9e916457d64c302ddfeadfa (patch) | |
tree | f194e16441c06af61a2c34ef6dc119ac2c98f9a3 | |
parent | 9dde3e42a7c5bc5f7896fd30e2b3a5859d6857bf (diff) |
RNA: naming, user-preferences -> preferences
48 files changed, 220 insertions, 220 deletions
diff --git a/doc/python_api/examples/bpy.types.AddonPreferences.1.py b/doc/python_api/examples/bpy.types.AddonPreferences.1.py index e6c720e0fad..fdc073b3e2f 100644 --- a/doc/python_api/examples/bpy.types.AddonPreferences.1.py +++ b/doc/python_api/examples/bpy.types.AddonPreferences.1.py @@ -50,8 +50,8 @@ class OBJECT_OT_addon_prefs_example(Operator): bl_options = {'REGISTER', 'UNDO'} def execute(self, context): - user_preferences = context.user_preferences - addon_prefs = user_preferences.addons[__name__].preferences + preferences = context.preferences + addon_prefs = preferences.addons[__name__].preferences info = ("Path: %s, Number: %d, Boolean %r" % (addon_prefs.filepath, addon_prefs.number, addon_prefs.boolean)) diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index eda0ab637fa..6200a88d2b1 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -359,7 +359,7 @@ INFO_DOCS = ( # only support for properties atm. RNA_BLACKLIST = { # XXX messes up PDF!, really a bug but for now just workaround. - "UserPreferencesSystem": {"language", } + "PreferencesSystem": {"language", } } MODULE_GROUPING = { diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py index 28b92edf489..7829e090c98 100644 --- a/intern/cycles/blender/addon/engine.py +++ b/intern/cycles/blender/addon/engine.py @@ -138,7 +138,7 @@ def create(engine, data, region=None, v3d=None, rv3d=None, preview_osl=False): import bpy data = data.as_pointer() - userpref = bpy.context.user_preferences.as_pointer() + prefs = bpy.context.preferences.as_pointer() if region: region = region.as_pointer() if v3d: @@ -147,7 +147,7 @@ def create(engine, data, region=None, v3d=None, rv3d=None, preview_osl=False): rv3d = rv3d.as_pointer() engine.session = _cycles.create( - engine.as_pointer(), userpref, data, region, v3d, rv3d, preview_osl) + engine.as_pointer(), prefs, data, region, v3d, rv3d, preview_osl) def free(engine): diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 8e57d3a0c2f..f5e7e98b40e 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -65,7 +65,7 @@ class CyclesNodeButtonsPanel: def get_device_type(context): - return context.user_preferences.addons[__package__].preferences.compute_device_type + return context.preferences.addons[__package__].preferences.compute_device_type def use_cpu(context): @@ -102,7 +102,7 @@ def show_device_active(context): cscene = context.scene.cycles if cscene.device != 'GPU': return True - return context.user_preferences.addons[__package__].preferences.has_active_device() + return context.preferences.addons[__package__].preferences.has_active_device() def draw_samples_info(layout, context): diff --git a/intern/cycles/blender/addon/version_update.py b/intern/cycles/blender/addon/version_update.py index 0564f2a7456..c61972da6e6 100644 --- a/intern/cycles/blender/addon/version_update.py +++ b/intern/cycles/blender/addon/version_update.py @@ -281,9 +281,9 @@ def ambient_occlusion_nodes_relink(): @persistent def do_versions(self): - if bpy.context.user_preferences.version <= (2, 78, 1): - prop = bpy.context.user_preferences.addons[__package__].preferences - system = bpy.context.user_preferences.system + if bpy.context.preferences.version <= (2, 78, 1): + prop = bpy.context.preferences.addons[__package__].preferences + system = bpy.context.preferences.system if not prop.is_property_set("compute_device_type"): # Device might not currently be available so this can fail try: diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 768c1c589b6..69f2f9b853f 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -218,8 +218,8 @@ static PyObject *create_func(PyObject * /*self*/, PyObject *args) BL::RenderEngine engine(engineptr); PointerRNA userprefptr; - RNA_pointer_create(NULL, &RNA_UserPreferences, (void*)PyLong_AsVoidPtr(pyuserpref), &userprefptr); - BL::UserPreferences userpref(userprefptr); + RNA_pointer_create(NULL, &RNA_Preferences, (void*)PyLong_AsVoidPtr(pyuserpref), &userprefptr); + BL::Preferences userpref(userprefptr); PointerRNA dataptr; RNA_main_pointer_create((Main*)PyLong_AsVoidPtr(pydata), &dataptr); diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index d031d12b507..58d3b57a67e 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -53,7 +53,7 @@ int BlenderSession::end_resumable_chunk = 0; bool BlenderSession::print_render_stats = false; BlenderSession::BlenderSession(BL::RenderEngine& b_engine, - BL::UserPreferences& b_userpref, + BL::Preferences& b_userpref, BL::BlendData& b_data, bool preview_osl) : session(NULL), @@ -79,7 +79,7 @@ BlenderSession::BlenderSession(BL::RenderEngine& b_engine, } BlenderSession::BlenderSession(BL::RenderEngine& b_engine, - BL::UserPreferences& b_userpref, + BL::Preferences& b_userpref, BL::BlendData& b_data, BL::SpaceView3D& b_v3d, BL::RegionView3D& b_rv3d, diff --git a/intern/cycles/blender/blender_session.h b/intern/cycles/blender/blender_session.h index fdeba7b2f81..96ffc06a3db 100644 --- a/intern/cycles/blender/blender_session.h +++ b/intern/cycles/blender/blender_session.h @@ -35,12 +35,12 @@ class RenderTile; class BlenderSession { public: BlenderSession(BL::RenderEngine& b_engine, - BL::UserPreferences& b_userpref, + BL::Preferences& b_userpref, BL::BlendData& b_data, bool preview_osl); BlenderSession(BL::RenderEngine& b_engine, - BL::UserPreferences& b_userpref, + BL::Preferences& b_userpref, BL::BlendData& b_data, BL::SpaceView3D& b_v3d, BL::RegionView3D& b_rv3d, @@ -102,7 +102,7 @@ public: double last_redraw_time; BL::RenderEngine b_engine; - BL::UserPreferences b_userpref; + BL::Preferences b_userpref; BL::BlendData b_data; BL::RenderSettings b_render; BL::Depsgraph b_depsgraph; diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index 7ac44a3ec9e..38e0e66b91b 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -702,7 +702,7 @@ bool BlenderSync::get_session_pause(BL::Scene& b_scene, bool background) } SessionParams BlenderSync::get_session_params(BL::RenderEngine& b_engine, - BL::UserPreferences& b_userpref, + BL::Preferences& b_userpref, BL::Scene& b_scene, bool background) { @@ -742,7 +742,7 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine& b_engine, else if(get_enum(cscene, "device") == 1) { PointerRNA b_preferences; - BL::UserPreferences::addons_iterator b_addon_iter; + BL::Preferences::addons_iterator b_addon_iter; for(b_userpref.addons.begin(b_addon_iter); b_addon_iter != b_userpref.addons.end(); ++b_addon_iter) { if(b_addon_iter->module() == "cycles") { b_preferences = b_addon_iter->preferences().ptr; diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h index ddc5e00cf9d..8af0de39a47 100644 --- a/intern/cycles/blender/blender_sync.h +++ b/intern/cycles/blender/blender_sync.h @@ -83,7 +83,7 @@ public: static SceneParams get_scene_params(BL::Scene& b_scene, bool background); static SessionParams get_session_params(BL::RenderEngine& b_engine, - BL::UserPreferences& b_userpref, + BL::Preferences& b_userpref, BL::Scene& b_scene, bool background); static bool get_session_pause(BL::Scene& b_scene, bool background); diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py index c0d45822503..ef5ec77a6c5 100644 --- a/release/scripts/modules/addon_utils.py +++ b/release/scripts/modules/addon_utils.py @@ -30,7 +30,7 @@ __all__ = ( ) import bpy as _bpy -_user_preferences = _bpy.context.user_preferences +_preferences = _bpy.context.preferences error_encoding = False # (name, file, path) @@ -43,7 +43,7 @@ def _initialize(): path_list = paths() for path in path_list: _bpy.utils._sys_path_ensure(path) - for addon in _user_preferences.addons: + for addon in _preferences.addons: enable(addon.module) @@ -231,7 +231,7 @@ def check(module_name): :rtype: tuple of booleans """ import sys - loaded_default = module_name in _user_preferences.addons + loaded_default = module_name in _preferences.addons mod = sys.modules.get(module_name) loaded_state = ( @@ -258,7 +258,7 @@ def check(module_name): def _addon_ensure(module_name): - addons = _user_preferences.addons + addons = _preferences.addons addon = addons.get(module_name) if not addon: addon = addons.new() @@ -266,7 +266,7 @@ def _addon_ensure(module_name): def _addon_remove(module_name): - addons = _user_preferences.addons + addons = _preferences.addons while module_name in addons: addon = addons.get(module_name) diff --git a/release/scripts/modules/bl_app_template_utils.py b/release/scripts/modules/bl_app_template_utils.py index 66ed7327b31..c00ac6a50b1 100644 --- a/release/scripts/modules/bl_app_template_utils.py +++ b/release/scripts/modules/bl_app_template_utils.py @@ -33,7 +33,7 @@ __all__ = ( import bpy as _bpy -# Normally matches 'user_preferences.app_template_id', +# Normally matches 'preferences.app_template_id', # but loading new preferences will get us out of sync. _app_template = { "id": "", @@ -184,7 +184,7 @@ def reset(*, reload_scripts=False): """ Sets default state. """ - template_id = _bpy.context.user_preferences.app_template + template_id = _bpy.context.preferences.app_template if _bpy.app.debug_python: print("bl_app_template_utils.reset('%s')" % template_id) diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py index 55a210c56ed..1db0beabb92 100644 --- a/release/scripts/modules/bl_i18n_utils/utils.py +++ b/release/scripts/modules/bl_i18n_utils/utils.py @@ -178,8 +178,8 @@ def enable_addons(addons=None, support=None, disable=False, check_only=False): if support is None: support = {} - userpref = bpy.context.user_preferences - used_ext = {ext.module for ext in userpref.addons} + prefs = bpy.context.preferences + used_ext = {ext.module for ext in prefs.addons} ret = [ mod for mod in addon_utils.modules() diff --git a/release/scripts/modules/bl_previews_utils/bl_previews_render.py b/release/scripts/modules/bl_previews_utils/bl_previews_render.py index 084937f0369..55cbd128183 100644 --- a/release/scripts/modules/bl_previews_utils/bl_previews_render.py +++ b/release/scripts/modules/bl_previews_utils/bl_previews_render.py @@ -485,11 +485,11 @@ def main(): help="Do not generate/clear previews for mat/tex/image/etc. IDs (those handled by core Blender code).") args = parser.parse_args(argv) - orig_save_version = bpy.context.user_preferences.filepaths.save_version + orig_save_version = bpy.context.preferences.filepaths.save_version if args.no_backups: - bpy.context.user_preferences.filepaths.save_version = 0 + bpy.context.preferences.filepaths.save_version = 0 elif orig_save_version < 1: - bpy.context.user_preferences.filepaths.save_version = 1 + bpy.context.preferences.filepaths.save_version = 1 if args.clear: print("clear!") @@ -501,7 +501,7 @@ def main(): do_data_intern=args.no_data_intern) # Not really necessary, but better be consistent. - bpy.context.user_preferences.filepaths.save_version = orig_save_version + bpy.context.preferences.filepaths.save_version = orig_save_version if __name__ == "__main__": diff --git a/release/scripts/modules/bpy/utils/__init__.py b/release/scripts/modules/bpy/utils/__init__.py index 75044d9d85c..5fbff2eb51b 100644 --- a/release/scripts/modules/bpy/utils/__init__.py +++ b/release/scripts/modules/bpy/utils/__init__.py @@ -71,7 +71,7 @@ import sys as _sys import addon_utils as _addon_utils -_user_preferences = _bpy.context.user_preferences +_preferences = _bpy.context.preferences _script_module_dirs = "startup", "modules" _is_factory_startup = _bpy.app.factory_startup @@ -176,7 +176,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False): # to reload. note that they will only actually reload of the # modification time changes. This `won't` work for packages so... # its not perfect. - for module_name in [ext.module for ext in _user_preferences.addons]: + for module_name in [ext.module for ext in _preferences.addons]: _addon_utils.disable(module_name) def register_module_call(mod): @@ -308,7 +308,7 @@ def script_path_user(): def script_path_pref(): """returns the user preference or None""" - path = _user_preferences.filepaths.script_directory + path = _preferences.filepaths.script_directory return _os.path.normpath(path) if path else None @@ -572,7 +572,7 @@ def preset_find(name, preset_path, display_name=False, ext=".py"): def keyconfig_init(): # Key configuration initialization and refresh, called from the Blender # window manager on startup and refresh. - active_config = _user_preferences.inputs.active_keyconfig + active_config = _preferences.inputs.active_keyconfig # Load the default key configuration. default_filepath = preset_find("blender", "keyconfig") diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py index ea7a4a5cd57..5e8f497d1a0 100644 --- a/release/scripts/modules/bpy_extras/object_utils.py +++ b/release/scripts/modules/bpy_extras/object_utils.py @@ -67,7 +67,7 @@ def add_object_align_init(context, operator): properties.location = location.to_translation() # rotation - view_align = (context.user_preferences.edit.object_align == 'VIEW') + view_align = (context.preferences.edit.object_align == 'VIEW') view_align_force = False if operator: if properties.is_property_set("view_align"): @@ -135,7 +135,7 @@ def object_data_add(context, obdata, operator=None, name=None): # XXX # caused because entering edit-mode does not add a empty undo slot! - if context.user_preferences.edit.use_enter_edit_mode: + if context.preferences.edit.use_enter_edit_mode: if not (obj_act and obj_act.mode == 'EDIT' and obj_act.type == obj_new.type): @@ -174,7 +174,7 @@ def object_data_add(context, obdata, operator=None, name=None): bpy.ops.object.mode_set(mode='EDIT') else: layer.objects.active = obj_new - if context.user_preferences.edit.use_enter_edit_mode: + if context.preferences.edit.use_enter_edit_mode: bpy.ops.object.mode_set(mode='EDIT') return obj_new diff --git a/release/scripts/modules/bpy_restrict_state.py b/release/scripts/modules/bpy_restrict_state.py index 589b3960b04..7ad9e0ec0a8 100644 --- a/release/scripts/modules/bpy_restrict_state.py +++ b/release/scripts/modules/bpy_restrict_state.py @@ -33,14 +33,14 @@ class _RestrictContext: __slots__ = () _real_data = _bpy.data # safe, the pointer never changes - _real_pref = _bpy.context.user_preferences + _real_pref = _bpy.context.preferences @property def window_manager(self): return self._real_data.window_managers[0] @property - def user_preferences(self): + def preferences(self): return self._real_pref diff --git a/release/scripts/modules/rna_keymap_ui.py b/release/scripts/modules/rna_keymap_ui.py index 756dbde23c9..3a44745e01b 100644 --- a/release/scripts/modules/rna_keymap_ui.py +++ b/release/scripts/modules/rna_keymap_ui.py @@ -413,8 +413,8 @@ def draw_keymaps(context, layout): box = col.box() row = box.row(align=True) - userpref = context.user_preferences - inputs = userpref.inputs + prefs = context.preferences + inputs = prefs.inputs show_ui_keyconfig = inputs.show_ui_keyconfig row.prop( inputs, diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py index f08390cfd6d..88c3f37fbaf 100644 --- a/release/scripts/modules/rna_prop_ui.py +++ b/release/scripts/modules/rna_prop_ui.py @@ -148,7 +148,7 @@ def draw(layout, context, context_member, property_type, use_edit=True): props.data_path = context_member del row - show_developer_ui = context.user_preferences.view.show_developer_ui + show_developer_ui = context.preferences.view.show_developer_ui rna_properties = {prop.identifier for prop in rna_item.bl_rna.properties if prop.is_runtime} if items else None layout.use_property_split = True diff --git a/release/scripts/modules/sys_info.py b/release/scripts/modules/sys_info.py index 53b3197fca3..8b4e224efe4 100644 --- a/release/scripts/modules/sys_info.py +++ b/release/scripts/modules/sys_info.py @@ -227,7 +227,7 @@ def write_sysinfo(filepath): import addon_utils addon_utils.modules() output.write(title("Enabled add-ons")) - for addon in bpy.context.user_preferences.addons.keys(): + for addon in bpy.context.preferences.addons.keys(): addon_mod = addon_utils.addons_fake_modules.get(addon, None) if addon_mod is None: output.write("%s (MISSING)\n" % (addon)) diff --git a/release/scripts/presets/keyconfig/blender.py b/release/scripts/presets/keyconfig/blender.py index ff8edbdede7..9db6df35662 100644 --- a/release/scripts/presets/keyconfig/blender.py +++ b/release/scripts/presets/keyconfig/blender.py @@ -108,7 +108,7 @@ def load(): from bpy import context from bl_keymap_utils.io import keyconfig_init_from_data - prefs = context.user_preferences + prefs = context.preferences kc = context.window_manager.keyconfigs.new(idname) kc_prefs = kc.preferences diff --git a/release/scripts/presets/keyconfig/blender_27x.py b/release/scripts/presets/keyconfig/blender_27x.py index d60324f22d6..eaa5dda4457 100644 --- a/release/scripts/presets/keyconfig/blender_27x.py +++ b/release/scripts/presets/keyconfig/blender_27x.py @@ -45,7 +45,7 @@ def load(): from bpy import context from bl_keymap_utils.io import keyconfig_init_from_data - prefs = context.user_preferences + prefs = context.preferences kc = context.window_manager.keyconfigs.new(idname) kc_prefs = kc.preferences diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index dbaeea959a8..61d59502a98 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -317,13 +317,13 @@ def km_window(params): # NDOF settings op_menu("USERPREF_MT_ndof_settings", {"type": 'NDOF_BUTTON_MENU', "value": 'PRESS'}), ("wm.context_scale_float", {"type": 'NDOF_BUTTON_PLUS', "value": 'PRESS'}, - {"properties": [("data_path", 'user_preferences.inputs.ndof_sensitivity'), ("value", 1.1)]}), + {"properties": [("data_path", 'preferences.inputs.ndof_sensitivity'), ("value", 1.1)]}), ("wm.context_scale_float", {"type": 'NDOF_BUTTON_MINUS', "value": 'PRESS'}, - {"properties": [("data_path", 'user_preferences.inputs.ndof_sensitivity'), ("value", 1.0 / 1.1)]}), + {"properties": [("data_path", 'preferences.inputs.ndof_sensitivity'), ("value", 1.0 / 1.1)]}), ("wm.context_scale_float", {"type": 'NDOF_BUTTON_PLUS', "value": 'PRESS', "shift": True}, - {"properties": [("data_path", 'user_preferences.inputs.ndof_sensitivity'), ("value", 1.5)]}), + {"properties": [("data_path", 'preferences.inputs.ndof_sensitivity'), ("value", 1.5)]}), ("wm.context_scale_float", {"type": 'NDOF_BUTTON_MINUS', "value": 'PRESS', "shift": True}, - {"properties": [("data_path", 'user_preferences.inputs.ndof_sensitivity'), ("value", 2.0 / 3.0)]}), + {"properties": [("data_path", 'preferences.inputs.ndof_sensitivity'), ("value", 2.0 / 3.0)]}), ("info.reports_display_update", {"type": 'TIMER_REPORT', "value": 'ANY', "any": True}, None), ]) @@ -3011,7 +3011,7 @@ def km_grease_pencil_stroke_paint_mode(params): {"properties": [("data_path_primary", 'tool_settings.gpencil_paint.brush.size')]}), # Brush size ("wm.radial_control", {"type": 'F', "value": 'PRESS', "ctrl": True}, - {"properties": [("data_path_primary", 'user_preferences.edit.grease_pencil_eraser_radius')]}), + {"properties": [("data_path_primary", 'preferences.edit.grease_pencil_eraser_radius')]}), # Draw context menu op_menu("GPENCIL_MT_gpencil_draw_specials", params.context_menu_event), # Draw delete menu diff --git a/release/scripts/startup/bl_operators/image.py b/release/scripts/startup/bl_operators/image.py index 8fbc8182ad8..a3de2811750 100644 --- a/release/scripts/startup/bl_operators/image.py +++ b/release/scripts/startup/bl_operators/image.py @@ -37,7 +37,7 @@ class EditExternally(Operator): def _editor_guess(context): import sys - image_editor = context.user_preferences.filepaths.image_editor + image_editor = context.preferences.filepaths.image_editor # use image editor in the preferences when available. if not image_editor: @@ -189,7 +189,7 @@ class ProjectEdit(Operator): if bpy.data.is_saved: filepath = "//" + filepath else: - tmpdir = context.user_preferences.filepaths.temporary_directory + tmpdir = context.preferences.filepaths.temporary_directory filepath = os.path.join(tmpdir, "project_edit") obj = context.object diff --git a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py index 27c8487eaa9..3a7199120a6 100644 --- a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py +++ b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py @@ -79,7 +79,7 @@ class PlayRenderedAnim(Operator): scene = context.scene rd = scene.render - prefs = context.user_preferences + prefs = context.preferences fps_final = rd.fps / rd.fps_base preset = prefs.filepaths.animation_player_preset diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 4461812cc2e..81814f4ffcf 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -2015,7 +2015,7 @@ class WM_OT_addon_install(Operator): # don't use bpy.utils.script_paths("addons") because we may not be able to write to it. path_addons = bpy.utils.user_resource('SCRIPTS', "addons", create=True) else: - path_addons = context.user_preferences.filepaths.script_directory + path_addons = context.preferences.filepaths.script_directory if path_addons: path_addons = os.path.join(path_addons, "addons") @@ -2206,7 +2206,7 @@ class WM_OT_addon_expand(Operator): class WM_OT_addon_userpref_show(Operator): - """Show add-on user preferences""" + """Show add-on preferences""" bl_idname = "wm.addon_userpref_show" bl_label = "" bl_options = {'INTERNAL'} @@ -2227,7 +2227,7 @@ class WM_OT_addon_userpref_show(Operator): info = addon_utils.module_bl_info(mod) info["show_expanded"] = True - context.user_preferences.active_section = 'ADDONS' + context.preferences.active_section = 'ADDONS' context.window_manager.addon_filter = 'All' context.window_manager.addon_search = info["name"] bpy.ops.screen.userpref_show('INVOKE_DEFAULT') @@ -2454,7 +2454,7 @@ class WM_OT_studiolight_install(Operator): import traceback import shutil import pathlib - userpref = context.user_preferences + prefs = context.preferences filepaths = [pathlib.Path(self.directory, e.name) for e in self.files] path_studiolights = bpy.utils.user_resource('DATAFILES') @@ -2472,7 +2472,7 @@ class WM_OT_studiolight_install(Operator): for filepath in filepaths: shutil.copy(str(filepath), str(path_studiolights)) - userpref.studio_lights.load(str(path_studiolights.joinpath(filepath.name)), self.type) + prefs.studio_lights.load(str(path_studiolights.joinpath(filepath.name)), self.type) # print message msg = ( @@ -2503,7 +2503,7 @@ class WM_OT_studiolight_new(Operator): def execute(self, context): import pathlib - userpref = context.user_preferences + prefs = context.preferences wm = context.window_manager path_studiolights = bpy.utils.user_resource('DATAFILES') @@ -2525,11 +2525,11 @@ class WM_OT_studiolight_new(Operator): self.ask_overide = True return wm.invoke_props_dialog(self, width=600) else: - for studio_light in userpref.studio_lights: + for studio_light in prefs.studio_lights: if studio_light.name == self.filename + ".sl": bpy.ops.wm.studiolight_uninstall(index=studio_light.index) - userpref.studio_lights.new(path=finalpath) + prefs.studio_lights.new(path=finalpath) # print message msg = ( @@ -2564,8 +2564,8 @@ class WM_OT_studiolight_uninstall(Operator): def execute(self, context): import pathlib - userpref = context.user_preferences - for studio_light in userpref.studio_lights: + prefs = context.preferences + for studio_light in prefs.studio_lights: if studio_light.index == self.index: if studio_light.path: self._remove_path(pathlib.Path(studio_light.path)) @@ -2573,7 +2573,7 @@ class WM_OT_studiolight_uninstall(Operator): self._remove_path(pathlib.Path(studio_light.path_irr_cache)) if studio_light.path_sh_cache: self._remove_path(pathlib.Path(studio_light.path_sh_cache)) - userpref.studio_lights.remove(studio_light) + prefs.studio_lights.remove(studio_light) return {'FINISHED'} return {'CANCELLED'} @@ -2585,9 +2585,9 @@ class WM_OT_studiolight_copy_settings(Operator): index: bpy.props.IntProperty() def execute(self, context): - userpref = context.user_preferences - system = userpref.system - for studio_light in userpref.studio_lights: + prefs = context.preferences + system = prefs.system + for studio_light in prefs.studio_lights: if studio_light.index == self.index: system.light_ambient = studio_light.light_ambient for sys_light, light in zip(system.solid_lights, studio_light.solid_lights): @@ -2601,13 +2601,13 @@ class WM_OT_studiolight_copy_settings(Operator): class WM_OT_studiolight_userpref_show(Operator): - """Show light user preferences""" + """Show light preferences""" bl_idname = "wm.studiolight_userpref_show" bl_label = "" bl_options = {'INTERNAL'} def execute(self, context): - context.user_preferences.active_section = 'LIGHTS' + context.preferences.active_section = 'LIGHTS' bpy.ops.screen.userpref_show('INVOKE_DEFAULT') return {'FINISHED'} @@ -2617,7 +2617,7 @@ class WM_MT_splash(Menu): def draw_setup(self, context): wm = context.window_manager - # userpref = context.user_preferences + # prefs = context.preferences layout = self.layout @@ -2678,8 +2678,8 @@ class WM_MT_splash(Menu): #row = sub.row() #row.alignment = 'RIGHT' # row.label(text="Language:") - #userpref = context.user_preferences - #sub.prop(userpref.system, "language", text="") + #prefs = context.preferences + #sub.prop(prefs.system, "language", text="") # Keep height constant if not has_select_mouse: @@ -2705,7 +2705,7 @@ class WM_MT_splash(Menu): layout.separator() def draw(self, context): - # Draw setup screen if no user preferences have been saved yet. + # Draw setup screen if no preferences have been saved yet. import os user_path = bpy.utils.resource_path('USER') diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index 32524ec092c..49d0b4075a1 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -129,7 +129,7 @@ class SceneKeyingSetsPanel: owner = ks propname = prop else: - owner = context.user_preferences.edit + owner = context.preferences.edit if userpref_fallback: propname = userpref_fallback else: @@ -137,7 +137,7 @@ class SceneKeyingSetsPanel: else: item = ks - owner = context.user_preferences.edit + owner = context.preferences.edit if userpref_fallback: propname = userpref_fallback else: diff --git a/release/scripts/startup/bl_ui/properties_workspace.py b/release/scripts/startup/bl_ui/properties_workspace.py index d07e2dbbaf6..daea94a3811 100644 --- a/release/scripts/startup/bl_ui/properties_workspace.py +++ b/release/scripts/startup/bl_ui/properties_workspace.py @@ -57,7 +57,7 @@ class WORKSPACE_PT_addons(WorkSpaceButtonsPanel, Panel): col = layout.box().column(align=True) workspace = context.workspace - userpref = context.user_preferences + prefs = context.preferences col.active = workspace.use_filter_by_owner @@ -65,7 +65,7 @@ class WORKSPACE_PT_addons(WorkSpaceButtonsPanel, Panel): addon_map = {mod.__name__: mod for mod in addon_utils.modules()} owner_ids = {owner_id.name for owner_id in workspace.owner_ids} - for addon in userpref.addons: + for addon in prefs.addons: module_name = addon.module info = addon_utils.module_bl_info(addon_map[module_name]) if not info["use_owner"]: diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index eb94adc1964..2eacae81057 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -141,7 +141,7 @@ class FILEBROWSER_PT_system_bookmarks(Panel): @classmethod def poll(cls, context): - return not context.user_preferences.filepaths.hide_system_bookmarks + return not context.preferences.filepaths.hide_system_bookmarks def draw(self, context): layout = self.layout @@ -203,7 +203,7 @@ class FILEBROWSER_PT_recent_folders(Panel): @classmethod def poll(cls, context): - return not context.user_preferences.filepaths.hide_recent_locations + return not context.preferences.filepaths.hide_recent_locations def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index 3be03ee8a80..0ae28ae38e7 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -47,7 +47,7 @@ class TIME_HT_editor_buttons(Header): # if using JACK and A/V sync: # hide the play-reversed button # since JACK transport doesn't support reversed playback - if scene.sync_mode == 'AUDIO_SYNC' and context.user_preferences.system.audio_device == 'JACK': + if scene.sync_mode == 'AUDIO_SYNC' and context.preferences.system.audio_device == 'JACK': sub = row.row(align=True) sub.scale_x = 1.4 sub.operator("screen.animation_play", text="", icon='PLAY') @@ -275,7 +275,7 @@ class TIME_PT_keyframing_settings(TimelinePanelButtons, Panel): scene = context.scene tool_settings = context.tool_settings - userprefs = context.user_preferences + prefs = context.preferences col = layout.column(align=True) col.label(text="Active Keying Set:") @@ -293,7 +293,7 @@ class TIME_PT_keyframing_settings(TimelinePanelButtons, Panel): row = col.row() row.prop(tool_settings, "auto_keying_mode", text="") row.prop(tool_settings, "use_keyframe_insert_keyingset", text="") - if not userprefs.edit.use_keyframe_insert_available: + if not prefs.edit.use_keyframe_insert_available: col.prop(tool_settings, "use_record_with_nla", text="Layered Recording") layout.prop(tool_settings, "use_keyframe_cycle_aware") diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py index 9d13bd93c86..4d6a43aa141 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_common.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py @@ -431,7 +431,7 @@ class ToolSelectPanelHelper: """ # Currently this just checks the width, # we could have different layouts as preferences too. - system = bpy.context.user_preferences.system + system = bpy.context.preferences.system view2d = region.view2d view2d_scale = ( view2d.region_to_view(1.0, 0.0)[0] - diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index a4ca27e8f48..e7883ce0bac 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -195,8 +195,8 @@ class _defs_annotate: def eraser(): def draw_settings(context, layout, tool): # TODO: Move this setting to tool_settings - user_prefs = context.user_preferences - layout.prop(user_prefs.edit, "grease_pencil_eraser_radius", text="Radius") + prefs = context.preferences + layout.prop(prefs.edit, "grease_pencil_eraser_radius", text="Radius") return dict( text="Annotate Eraser", icon="ops.gpencil.draw.eraser", diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 67530ba71ee..6f80b4394b6 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -609,7 +609,7 @@ class TOPBAR_MT_file(Menu): layout.operator_context = 'INVOKE_AREA' if any(bpy.utils.app_template_paths()): - app_template = context.user_preferences.app_template + app_template = context.preferences.app_template else: app_template = None @@ -647,7 +647,7 @@ class TOPBAR_MT_file(Menu): layout.separator() layout.operator_context = 'EXEC_AREA' - if bpy.data.is_dirty and context.user_preferences.view.use_quit_dialog: + if bpy.data.is_dirty and context.preferences.view.use_quit_dialog: layout.operator_context = 'INVOKE_SCREEN' # quit dialog layout.operator("wm.quit_blender", text="Quit", icon='QUIT') @@ -894,7 +894,7 @@ class TOPBAR_MT_help(Menu): def draw(self, context): layout = self.layout - show_developer = context.user_preferences.view.show_developer_ui + show_developer = context.preferences.view.show_developer_ui layout.operator( "wm.url_open", text="Manual", icon='HELP', diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 541158796e5..c4198e02187 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -28,29 +28,29 @@ from bpy.app.translations import contexts as i18n_contexts class USERPREF_HT_header(Header): - bl_space_type = 'USER_PREFERENCES' + bl_space_type = 'PREFERENCES' def draw(self, context): layout = self.layout layout.template_header() - userpref = context.user_preferences + prefs = context.preferences - if userpref.active_section == 'INPUT': + if prefs.active_section == 'INPUT': layout.operator("wm.keyconfig_import", icon='IMPORT') layout.operator("wm.keyconfig_export", icon='EXPORT') - elif userpref.active_section == 'ADDONS': + elif prefs.active_section == 'ADDONS': layout.operator("wm.addon_install", icon='FILEBROWSER') layout.operator("wm.addon_refresh", icon='FILE_REFRESH') layout.menu("USERPREF_MT_addons_online_resources") - elif userpref.active_section == 'LIGHTS': + elif prefs.active_section == 'LIGHTS': layout.operator("wm.studiolight_install", text="Add MatCap").type = 'MATCAP' layout.operator("wm.studiolight_install", text="Add LookDev HDRI").type = 'WORLD' op = layout.operator("wm.studiolight_install", text="Add Studio Light") op.type = 'STUDIO' op.filter_glob = ".sl" - elif userpref.active_section == 'THEMES': + elif prefs.active_section == 'THEMES': layout.operator("wm.theme_install", icon='FILEBROWSER') layout.operator("ui.reset_default_theme", icon='LOOP_BACK') @@ -62,38 +62,38 @@ class USERPREF_HT_header(Header): class USERPREF_PT_navigation(Panel): bl_label = "" - bl_space_type = 'USER_PREFERENCES' + bl_space_type = 'PREFERENCES' bl_region_type = 'NAVIGATION_BAR' bl_options = {'HIDE_HEADER'} def draw(self, context): layout = self.layout - userpref = context.user_preferences + prefs = context.preferences col = layout.column() col.scale_x = 1.3 col.scale_y = 1.3 - col.prop(userpref, "active_section", expand=True) + col.prop(prefs, "active_section", expand=True) class USERPREF_PT_interface(Panel): - bl_space_type = 'USER_PREFERENCES' + bl_space_type = 'PREFERENCES' bl_label = "Interface" bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} @classmethod def poll(cls, context): - userpref = context.user_preferences - return (userpref.active_section == 'INTERFACE') + prefs = context.preferences + return (prefs.active_section == 'INTERFACE') def draw(self, context): layout = self.layout - userpref = context.user_preferences - view = userpref.view + prefs = context.preferences + view = prefs.view split = layout.split() row = split.row() @@ -212,21 +212,21 @@ class USERPREF_PT_interface(Panel): class USERPREF_PT_edit(Panel): - bl_space_type = 'USER_PREFERENCES' + bl_space_type = 'PREFERENCES' bl_label = "Edit" bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} @classmethod def poll(cls, context): - userpref = context.user_preferences - return (userpref.active_section == 'EDITING') + prefs = context.preferences + return (prefs.active_section == 'EDITING') def draw(self, context): layout = self.layout - userpref = context.user_preferences - edit = userpref.edit + prefs = context.preferences + edit = prefs.edit split = layout.split() row = split.row() @@ -341,22 +341,22 @@ class USERPREF_PT_edit(Panel): class USERPREF_PT_system_general(Panel): - bl_space_type = 'USER_PREFERENCES' + bl_space_type = 'PREFERENCES' bl_label = "System General" bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} @classmethod def poll(cls, context): - userpref = context.user_preferences - return (userpref.active_section == 'SYSTEM_GENERAL') + prefs = context.preferences + return (prefs.active_section == 'SYSTEM_GENERAL') def draw(self, context): import sys layout = self.layout - userpref = context.user_preferences - system = userpref.system + prefs = context.preferences + system = prefs.system split = layout.split() @@ -383,7 +383,7 @@ class USERPREF_PT_system_general(Panel): col.separator() if bpy.app.build_options.cycles: - addon = userpref.addons.get("cycles") + addon = prefs.addons.get("cycles") if addon is not None: addon.preferences.draw_impl(col, context) del addon @@ -490,8 +490,8 @@ class USERPREF_MT_interface_theme_presets(Menu): preset_operator = "script.execute_preset" preset_type = 'XML' preset_xml_map = ( - ("user_preferences.themes[0]", "Theme"), - ("user_preferences.ui_styles[0]", "ThemeStyle"), + ("preferences.themes[0]", "Theme"), + ("preferences.ui_styles[0]", "ThemeStyle"), ) draw = Menu.draw_preset @@ -500,7 +500,7 @@ class USERPREF_MT_interface_theme_presets(Menu): class USERPREF_PT_theme(Panel): - bl_space_type = 'USER_PREFERENCES' + bl_space_type = 'PREFERENCES' bl_label = "Themes" bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} @@ -640,13 +640,13 @@ class USERPREF_PT_theme(Panel): @classmethod def poll(cls, context): - userpref = context.user_preferences - return (userpref.active_section == 'THEMES') + prefs = context.preferences + return (prefs.active_section == 'THEMES') def draw(self, context): layout = self.layout - theme = context.user_preferences.themes[0] + theme = context.preferences.themes[0] split_themes = layout.split(factor=0.2) @@ -864,7 +864,7 @@ class USERPREF_PT_theme(Panel): elif theme.theme_area == 'STYLE': col = split.column() - style = context.user_preferences.ui_styles[0] + style = context.preferences.ui_styles[0] col.label(text="Panel Title:") self._ui_font_style(col, style.panel_title) @@ -883,22 +883,22 @@ class USERPREF_PT_theme(Panel): class USERPREF_PT_file(Panel): - bl_space_type = 'USER_PREFERENCES' + bl_space_type = 'PREFERENCES' bl_label = "Files" bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} @classmethod def poll(cls, context): - userpref = context.user_preferences - return (userpref.active_section == 'SYSTEM_FILES') + prefs = context.preferences + return (prefs.active_section == 'SYSTEM_FILES') def draw(self, context): layout = self.layout - userpref = context.user_preferences - paths = userpref.filepaths - system = userpref.system + prefs = context.preferences + paths = prefs.filepaths + system = prefs.system split = layout.split(factor=0.7) @@ -949,7 +949,7 @@ class USERPREF_PT_file(Panel): row = box.row() row.label(text="Excluded Paths:") row.operator("wm.userpref_autoexec_path_add", text="", icon='ADD', emboss=False) - for i, path_cmp in enumerate(userpref.autoexec_paths): + for i, path_cmp in enumerate(prefs.autoexec_paths): row = box.row() row.prop(path_cmp, "path", text="") row.prop(path_cmp, "use_glob", text="", icon='FILTER') @@ -1002,7 +1002,7 @@ class USERPREF_MT_ndof_settings(Menu): def draw(self, context): layout = self.layout - input_prefs = context.user_preferences.inputs + input_prefs = context.preferences.inputs is_view3d = context.space_data.type == 'VIEW_3D' @@ -1052,15 +1052,15 @@ class USERPREF_MT_keyconfigs(Menu): class USERPREF_PT_input(Panel): - bl_space_type = 'USER_PREFERENCES' + bl_space_type = 'PREFERENCES' bl_label = "Input" bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} @classmethod def poll(cls, context): - userpref = context.user_preferences - return (userpref.active_section == 'INPUT') + prefs = context.preferences + return (prefs.active_section == 'INPUT') @staticmethod def draw_input_prefs(inputs, layout): @@ -1163,9 +1163,9 @@ class USERPREF_PT_input(Panel): #start = time.time() - userpref = context.user_preferences + prefs = context.preferences - inputs = userpref.inputs + inputs = prefs.inputs split = layout.split(factor=0.25) @@ -1212,7 +1212,7 @@ class USERPREF_MT_addons_online_resources(Menu): class USERPREF_PT_addons(Panel): - bl_space_type = 'USER_PREFERENCES' + bl_space_type = 'PREFERENCES' bl_label = "Add-ons" bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} @@ -1225,8 +1225,8 @@ class USERPREF_PT_addons(Panel): @classmethod def poll(cls, context): - userpref = context.user_preferences - return (userpref.active_section == 'ADDONS') + prefs = context.preferences + return (prefs.active_section == 'ADDONS') @staticmethod def is_user_addon(mod, user_addon_paths): @@ -1261,12 +1261,12 @@ class USERPREF_PT_addons(Panel): layout = self.layout - userpref = context.user_preferences - used_ext = {ext.module for ext in userpref.addons} + prefs = context.preferences + used_ext = {ext.module for ext in prefs.addons} addon_user_dirs = tuple( p for p in ( - os.path.join(userpref.filepaths.script_directory, "addons"), + os.path.join(prefs.filepaths.script_directory, "addons"), bpy.utils.user_resource('SCRIPTS', "addons"), ) if p @@ -1443,9 +1443,9 @@ class USERPREF_PT_addons(Panel): for _ in range(4 - tot_row): split.separator() - # Show addon user preferences + # Show addon preferences if is_enabled: - addon_preferences = userpref.addons[module_name].preferences + addon_preferences = prefs.addons[module_name].preferences if addon_preferences is not None: draw = getattr(addon_preferences, "draw", None) if draw is not None: @@ -1489,21 +1489,21 @@ class USERPREF_PT_addons(Panel): class StudioLightPanelMixin(): - bl_space_type = 'USER_PREFERENCES' + bl_space_type = 'PREFERENCES' bl_region_type = 'WINDOW' @classmethod def poll(cls, context): - userpref = context.user_preferences - return (userpref.active_section == 'LIGHTS') + prefs = context.preferences + return (prefs.active_section == 'LIGHTS') - def _get_lights(self, userpref): - return [light for light in userpref.studio_lights if light.is_user_defined and light.type == self.sl_type] + def _get_lights(self, prefs): + return [light for light in prefs.studio_lights if light.is_user_defined and light.type == self.sl_type] def draw(self, context): layout = self.layout - userpref = context.user_preferences - lights = self._get_lights(userpref) + prefs = context.preferences + lights = self._get_lights(prefs) self.draw_light_list(layout, lights) @@ -1549,7 +1549,7 @@ class USERPREF_PT_studiolight_lights(Panel, StudioLightPanelMixin): class USERPREF_PT_studiolight_light_editor(Panel): bl_label = "Studio Light Editor" bl_parent_id = "USERPREF_PT_studiolight_lights" - bl_space_type = 'USER_PREFERENCES' + bl_space_type = 'PREFERENCES' bl_region_type = 'WINDOW' def opengl_light_buttons(self, layout, light): @@ -1566,8 +1566,8 @@ class USERPREF_PT_studiolight_light_editor(Panel): def draw(self, context): layout = self.layout - userpref = context.user_preferences - system = userpref.system + prefs = context.preferences + system = prefs.system row = layout.row() row.prop(system, "edit_studio_light", toggle=True) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index c1b4849ddad..12ac3698359 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -4420,8 +4420,8 @@ class VIEW3D_PT_shading_lighting(Panel): sub = col.row() if shading.light == 'STUDIO': - userpref = context.user_preferences - system = userpref.system + prefs = context.preferences + system = prefs.system if not system.edit_studio_light: sub.scale_y = 0.6 # smaller studiolight preview @@ -5013,7 +5013,7 @@ class VIEW3D_PT_overlay_edit_mesh_developer(Panel): @classmethod def poll(cls, context): - return context.mode == 'EDIT_MESH' and context.user_preferences.view.show_developer_ui + return context.mode == 'EDIT_MESH' and context.preferences.view.show_developer_ui def draw(self, context): layout = self.layout diff --git a/release/scripts/templates_py/operator_modal_timer.py b/release/scripts/templates_py/operator_modal_timer.py index 12f1ebbc17d..808f1a1299c 100644 --- a/release/scripts/templates_py/operator_modal_timer.py +++ b/release/scripts/templates_py/operator_modal_timer.py @@ -15,7 +15,7 @@ class ModalTimerOperator(bpy.types.Operator): if event.type == 'TIMER': # change theme color, silly! - color = context.user_preferences.themes[0].view_3d.space.gradients.high_gradient + color = context.preferences.themes[0].view_3d.space.gradients.high_gradient color.s = 1.0 color.h += 0.01 diff --git a/source/blender/draw/engines/workbench/workbench_data.c b/source/blender/draw/engines/workbench/workbench_data.c index ab9417705e5..a4a449c1ee5 100644 --- a/source/blender/draw/engines/workbench/workbench_data.c +++ b/source/blender/draw/engines/workbench/workbench_data.c @@ -16,7 +16,7 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) const DRWContextState *draw_ctx = DRW_context_state_get(); const Scene *scene = draw_ctx->scene; wpd->material_hash = BLI_ghash_ptr_new(__func__); - wpd->user_preferences = &U; + wpd->preferences = &U; View3D *v3d = draw_ctx->v3d; if (!v3d) { diff --git a/source/blender/draw/engines/workbench/workbench_effect_taa.c b/source/blender/draw/engines/workbench/workbench_effect_taa.c index 929281daaf4..4af0158754d 100644 --- a/source/blender/draw/engines/workbench/workbench_effect_taa.c +++ b/source/blender/draw/engines/workbench/workbench_effect_taa.c @@ -98,13 +98,13 @@ int workbench_taa_calculate_num_iterations(WORKBENCH_Data *vedata) result = (scene->r.mode & R_OSA) ? scene->r.osa : 1; } else if (IN_RANGE_INCL( - wpd->user_preferences->gpu_viewport_quality, + wpd->preferences->gpu_viewport_quality, GPU_VIEWPORT_QUALITY_TAA8, GPU_VIEWPORT_QUALITY_TAA16)) { result = 8; } else if (IN_RANGE_INCL( - wpd->user_preferences->gpu_viewport_quality, + wpd->preferences->gpu_viewport_quality, GPU_VIEWPORT_QUALITY_TAA16, GPU_VIEWPORT_QUALITY_TAA32)) { result = 16; diff --git a/source/blender/draw/engines/workbench/workbench_private.h b/source/blender/draw/engines/workbench/workbench_private.h index 534fc3b933b..c4b73fa43ff 100644 --- a/source/blender/draw/engines/workbench/workbench_private.h +++ b/source/blender/draw/engines/workbench/workbench_private.h @@ -61,9 +61,9 @@ #define IS_NAVIGATING(wpd) ((DRW_context_state_get()->rv3d) && (DRW_context_state_get()->rv3d->rflag & RV3D_NAVIGATING)) #define FXAA_ENABLED(wpd) ((!DRW_state_is_opengl_render()) && \ - (IN_RANGE(wpd->user_preferences->gpu_viewport_quality, GPU_VIEWPORT_QUALITY_FXAA, GPU_VIEWPORT_QUALITY_TAA8) || \ - ((IS_NAVIGATING(wpd) || wpd->is_playback) && (wpd->user_preferences->gpu_viewport_quality >= GPU_VIEWPORT_QUALITY_TAA8)))) -#define TAA_ENABLED(wpd) (DRW_state_is_image_render() || (wpd->user_preferences->gpu_viewport_quality >= GPU_VIEWPORT_QUALITY_TAA8 && !IS_NAVIGATING(wpd) && !wpd->is_playback)) + (IN_RANGE(wpd->preferences->gpu_viewport_quality, GPU_VIEWPORT_QUALITY_FXAA, GPU_VIEWPORT_QUALITY_TAA8) || \ + ((IS_NAVIGATING(wpd) || wpd->is_playback) && (wpd->preferences->gpu_viewport_quality >= GPU_VIEWPORT_QUALITY_TAA8)))) +#define TAA_ENABLED(wpd) (DRW_state_is_image_render() || (wpd->preferences->gpu_viewport_quality >= GPU_VIEWPORT_QUALITY_TAA8 && !IS_NAVIGATING(wpd) && !wpd->is_playback)) #define SPECULAR_HIGHLIGHT_ENABLED(wpd) (STUDIOLIGHT_ENABLED(wpd) && (wpd->shading.flag & V3D_SHADING_SPECULAR_HIGHLIGHT) && (!STUDIOLIGHT_TYPE_MATCAP_ENABLED(wpd))) #define OBJECT_OUTLINE_ENABLED(wpd) (wpd->shading.flag & V3D_SHADING_OBJECT_OUTLINE) #define OBJECT_ID_PASS_ENABLED(wpd) (OBJECT_OUTLINE_ENABLED(wpd) || CURVATURE_ENABLED(wpd)) @@ -179,7 +179,7 @@ typedef struct WORKBENCH_PrivateData { struct GPUShader *transparent_accum_texture_hair_sh; View3DShading shading; StudioLight *studio_light; - UserDef *user_preferences; + const UserDef *preferences; struct GPUUniformBuffer *world_ubo; struct DRWShadingGroup *shadow_shgrp; struct DRWShadingGroup *depth_shgrp; diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 20d83b0a64b..185c0d1cc77 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -4751,7 +4751,7 @@ static void context_cycle_prop_get( propname = "context"; break; case SPACE_USERPREF: - RNA_pointer_create(NULL, &RNA_UserPreferences, &U, r_ptr); + RNA_pointer_create(NULL, &RNA_Preferences, &U, r_ptr); propname = "active_section"; break; default: diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 03a879c9cf7..7ac03d5d3f8 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -610,7 +610,7 @@ extern StructRNA RNA_SpaceProperties; extern StructRNA RNA_SpaceSequenceEditor; extern StructRNA RNA_SpaceTextEditor; extern StructRNA RNA_SpaceUVEditor; -extern StructRNA RNA_SpaceUserPreferences; +extern StructRNA RNA_SpacePreferences; extern StructRNA RNA_SpaceView3D; extern StructRNA RNA_Speaker; extern StructRNA RNA_SpeedControlSequence; @@ -685,7 +685,7 @@ extern StructRNA RNA_ThemeSpaceListGeneric; extern StructRNA RNA_ThemeStyle; extern StructRNA RNA_ThemeTextEditor; extern StructRNA RNA_ThemeUserInterface; -extern StructRNA RNA_ThemeUserPreferences; +extern StructRNA RNA_ThemePreferences; extern StructRNA RNA_ThemeView3D; extern StructRNA RNA_ThemeWidgetColors; extern StructRNA RNA_ThemeWidgetStateColors; @@ -708,13 +708,13 @@ extern StructRNA RNA_UVProjector; extern StructRNA RNA_UVWarpModifier; extern StructRNA RNA_UnitSettings; extern StructRNA RNA_UnknownType; -extern StructRNA RNA_UserPreferences; -extern StructRNA RNA_UserPreferencesEdit; -extern StructRNA RNA_UserPreferencesFilePaths; -extern StructRNA RNA_UserPreferencesInput; -extern StructRNA RNA_UserPreferencesSystem; -extern StructRNA RNA_UserPreferencesView; -extern StructRNA RNA_UserPreferencesWalkNavigation; +extern StructRNA RNA_Preferences; +extern StructRNA RNA_PreferencesEdit; +extern StructRNA RNA_PreferencesFilePaths; +extern StructRNA RNA_PreferencesInput; +extern StructRNA RNA_PreferencesSystem; +extern StructRNA RNA_PreferencesView; +extern StructRNA RNA_PreferencesWalkNavigation; extern StructRNA RNA_UserSolidLight; extern StructRNA RNA_VectorFont; extern StructRNA RNA_VertexGroup; diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index 240d21407d0..4b4ae24bafd 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -196,10 +196,10 @@ static PointerRNA rna_Context_tool_settings_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_ToolSettings, CTX_data_tool_settings(C)); } -static PointerRNA rna_Context_user_preferences_get(PointerRNA *UNUSED(ptr)) +static PointerRNA rna_Context_preferences_get(PointerRNA *UNUSED(ptr)) { PointerRNA newptr; - RNA_pointer_create(NULL, &RNA_UserPreferences, &U, &newptr); + RNA_pointer_create(NULL, &RNA_Preferences, &U, &newptr); return newptr; } @@ -306,10 +306,10 @@ void RNA_def_context(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ToolSettings"); RNA_def_property_pointer_funcs(prop, "rna_Context_tool_settings_get", NULL, NULL, NULL); - prop = RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE); + prop = RNA_def_property(srna, "preferences", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_struct_type(prop, "UserPreferences"); - RNA_def_property_pointer_funcs(prop, "rna_Context_user_preferences_get", NULL, NULL, NULL); + RNA_def_property_struct_type(prop, "Preferences"); + RNA_def_property_pointer_funcs(prop, "rna_Context_preferences_get", NULL, NULL, NULL); prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_context_mode_items); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index ef1b60272f3..c5ac3cdc4d1 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -102,7 +102,7 @@ const EnumPropertyItem rna_enum_space_type_items[] = { {SPACE_OUTLINER, "OUTLINER", ICON_OUTLINER, "Outliner", "Overview of scene graph and all available data-blocks"}, {SPACE_BUTS, "PROPERTIES", ICON_PROPERTIES, "Properties", "Edit properties of active object and related data-blocks"}, {SPACE_FILE, "FILE_BROWSER", ICON_FILEBROWSER, "File Browser", "Browse for files and assets"}, - {SPACE_USERPREF, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", + {SPACE_USERPREF, "PREFERENCES", ICON_PREFERENCES, "Preferences", "Edit persistent configuration settings"}, {0, NULL, 0, NULL, NULL} }; @@ -417,7 +417,7 @@ static StructRNA *rna_Space_refine(struct PointerRNA *ptr) case SPACE_CONSOLE: return &RNA_SpaceConsole; case SPACE_USERPREF: - return &RNA_SpaceUserPreferences; + return &RNA_SpacePreferences; case SPACE_CLIP: return &RNA_SpaceClipEditor; default: @@ -4733,7 +4733,7 @@ static void rna_def_space_userpref(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - srna = RNA_def_struct(brna, "SpaceUserPreferences", "Space"); + srna = RNA_def_struct(brna, "SpacePreferences", "Space"); RNA_def_struct_sdna(srna, "SpaceUserPref"); RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data"); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index dcb8473a430..c39e1479e31 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -285,27 +285,27 @@ static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value) static PointerRNA rna_UserDef_view_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesView, ptr->data); + return rna_pointer_inherit_refine(ptr, &RNA_PreferencesView, ptr->data); } static PointerRNA rna_UserDef_edit_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesEdit, ptr->data); + return rna_pointer_inherit_refine(ptr, &RNA_PreferencesEdit, ptr->data); } static PointerRNA rna_UserDef_input_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesInput, ptr->data); + return rna_pointer_inherit_refine(ptr, &RNA_PreferencesInput, ptr->data); } static PointerRNA rna_UserDef_filepaths_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesFilePaths, ptr->data); + return rna_pointer_inherit_refine(ptr, &RNA_PreferencesFilePaths, ptr->data); } static PointerRNA rna_UserDef_system_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesSystem, ptr->data); + return rna_pointer_inherit_refine(ptr, &RNA_PreferencesSystem, ptr->data); } static void rna_UserDef_audio_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) @@ -2078,7 +2078,7 @@ static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna) /* space_userpref */ - srna = RNA_def_struct(brna, "ThemeUserPreferences", NULL); + srna = RNA_def_struct(brna, "ThemePreferences", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences"); @@ -3202,7 +3202,7 @@ static void rna_def_userdef_themes(BlenderRNA *brna) {9, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""}, {11, "PROPERTIES", ICON_PROPERTIES, "Properties", ""}, {12, "OUTLINER", ICON_OUTLINER, "Outliner", ""}, - {14, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", ""}, + {14, "PREFERENCES", ICON_PREFERENCES, "Preferences", ""}, {15, "INFO", ICON_INFO, "Info", ""}, {16, "FILE_BROWSER", ICON_FILEBROWSER, "File Browser", ""}, {17, "CONSOLE", ICON_CONSOLE, "Python Console", ""}, @@ -3307,11 +3307,11 @@ static void rna_def_userdef_themes(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ThemeInfo"); RNA_def_property_ui_text(prop, "Info", ""); - prop = RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE); + prop = RNA_def_property(srna, "preferences", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "tuserpref"); - RNA_def_property_struct_type(prop, "ThemeUserPreferences"); - RNA_def_property_ui_text(prop, "User Preferences", ""); + RNA_def_property_struct_type(prop, "ThemePreferences"); + RNA_def_property_ui_text(prop, "Preferences", ""); prop = RNA_def_property(srna, "console", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); @@ -3670,9 +3670,9 @@ static void rna_def_userdef_view(BlenderRNA *brna) PropertyRNA *prop; StructRNA *srna; - srna = RNA_def_struct(brna, "UserPreferencesView", NULL); + srna = RNA_def_struct(brna, "PreferencesView", NULL); RNA_def_struct_sdna(srna, "UserDef"); - RNA_def_struct_nested(brna, srna, "UserPreferences"); + RNA_def_struct_nested(brna, srna, "Preferences"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "View & Controls", "Preferences related to viewing data"); @@ -3971,9 +3971,9 @@ static void rna_def_userdef_edit(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - srna = RNA_def_struct(brna, "UserPreferencesEdit", NULL); + srna = RNA_def_struct(brna, "PreferencesEdit", NULL); RNA_def_struct_sdna(srna, "UserDef"); - RNA_def_struct_nested(brna, srna, "UserPreferences"); + RNA_def_struct_nested(brna, srna, "Preferences"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Edit Methods", "Settings for interacting with Blender data"); @@ -4295,9 +4295,9 @@ static void rna_def_userdef_system(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - srna = RNA_def_struct(brna, "UserPreferencesSystem", NULL); + srna = RNA_def_struct(brna, "PreferencesSystem", NULL); RNA_def_struct_sdna(srna, "UserDef"); - RNA_def_struct_nested(brna, srna, "UserPreferences"); + RNA_def_struct_nested(brna, srna, "Preferences"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "System & OpenGL", "Graphics driver and operating system settings"); @@ -4633,9 +4633,9 @@ static void rna_def_userdef_input(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - srna = RNA_def_struct(brna, "UserPreferencesInput", NULL); + srna = RNA_def_struct(brna, "PreferencesInput", NULL); RNA_def_struct_sdna(srna, "UserDef"); - RNA_def_struct_nested(brna, srna, "UserPreferences"); + RNA_def_struct_nested(brna, srna, "Preferences"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Input", "Settings for input devices"); @@ -4846,9 +4846,9 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - srna = RNA_def_struct(brna, "UserPreferencesFilePaths", NULL); + srna = RNA_def_struct(brna, "PreferencesFilePaths", NULL); RNA_def_struct_sdna(srna, "UserDef"); - RNA_def_struct_nested(brna, srna, "UserPreferences"); + RNA_def_struct_nested(brna, srna, "Preferences"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external files"); @@ -5031,7 +5031,7 @@ void RNA_def_userdef(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static const EnumPropertyItem user_pref_sections[] = { + static const EnumPropertyItem preference_section_items[] = { {0, "", ICON_USER, "User Preferences", ""}, {USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""}, {USER_SECTION_EDIT, "EDITING", 0, "Editing", ""}, @@ -5059,14 +5059,14 @@ void RNA_def_userdef(BlenderRNA *brna) rna_def_userdef_solidlight(brna); rna_def_userdef_walk_navigation(brna); - srna = RNA_def_struct(brna, "UserPreferences", NULL); + srna = RNA_def_struct(brna, "Preferences", NULL); RNA_def_struct_sdna(srna, "UserDef"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); - RNA_def_struct_ui_text(srna, "User Preferences", "Global user preferences"); + RNA_def_struct_ui_text(srna, "Preferences", "Global preferences"); prop = RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "userpref"); - RNA_def_property_enum_items(prop, user_pref_sections); + RNA_def_property_enum_items(prop, preference_section_items); RNA_def_property_ui_text(prop, "Active Section", "Active section of the user preferences shown in the user interface"); RNA_def_property_update(prop, 0, "rna_userdef_update"); @@ -5101,31 +5101,31 @@ void RNA_def_userdef(BlenderRNA *brna) /* nested structs */ prop = RNA_def_property(srna, "view", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_struct_type(prop, "UserPreferencesView"); + RNA_def_property_struct_type(prop, "PreferencesView"); RNA_def_property_pointer_funcs(prop, "rna_UserDef_view_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "View & Controls", "Preferences related to viewing data"); prop = RNA_def_property(srna, "edit", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_struct_type(prop, "UserPreferencesEdit"); + RNA_def_property_struct_type(prop, "PreferencesEdit"); RNA_def_property_pointer_funcs(prop, "rna_UserDef_edit_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Edit Methods", "Settings for interacting with Blender data"); prop = RNA_def_property(srna, "inputs", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_struct_type(prop, "UserPreferencesInput"); + RNA_def_property_struct_type(prop, "PreferencesInput"); RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Inputs", "Settings for input devices"); prop = RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_struct_type(prop, "UserPreferencesFilePaths"); + RNA_def_property_struct_type(prop, "PreferencesFilePaths"); RNA_def_property_pointer_funcs(prop, "rna_UserDef_filepaths_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files"); prop = RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_struct_type(prop, "UserPreferencesSystem"); + RNA_def_property_struct_type(prop, "PreferencesSystem"); RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "System & OpenGL", "Graphics driver and operating system settings"); diff --git a/source/blender/python/intern/bpy_rna_callback.c b/source/blender/python/intern/bpy_rna_callback.c index 3a20ba385c6..ed29aa795e6 100644 --- a/source/blender/python/intern/bpy_rna_callback.c +++ b/source/blender/python/intern/bpy_rna_callback.c @@ -225,7 +225,7 @@ static eSpace_Type rna_Space_refine_reverse(StructRNA *srna) if (srna == &RNA_SpaceNLA) return SPACE_NLA; if (srna == &RNA_SpaceNodeEditor) return SPACE_NODE; if (srna == &RNA_SpaceConsole) return SPACE_CONSOLE; - if (srna == &RNA_SpaceUserPreferences) return SPACE_USERPREF; + if (srna == &RNA_SpacePreferences) return SPACE_USERPREF; if (srna == &RNA_SpaceClipEditor) return SPACE_CLIP; return SPACE_EMPTY; } diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 23c60c33d61..5c7d9c1be48 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -2423,9 +2423,9 @@ static uiBlock *block_create_autorun_warning(struct bContext *C, struct ARegion uiItemS(layout); - PointerRNA userpref_ptr; - RNA_pointer_create(NULL, &RNA_UserPreferencesSystem, &U, &userpref_ptr); - uiItemR(layout, &userpref_ptr, "use_scripts_auto_execute", 0, IFACE_("Permanently allow execution of scripts"), ICON_NONE); + PointerRNA pref_ptr; + RNA_pointer_create(NULL, &RNA_PreferencesSystem, &U, &pref_ptr); + uiItemR(layout, &pref_ptr, "use_scripts_auto_execute", 0, IFACE_("Permanently allow execution of scripts"), ICON_NONE); uiItemS(layout); diff --git a/tests/python/bl_load_addons.py b/tests/python/bl_load_addons.py index e404e2340ce..d54d5c3c45f 100644 --- a/tests/python/bl_load_addons.py +++ b/tests/python/bl_load_addons.py @@ -64,7 +64,7 @@ def addon_modules_sorted(): def disable_addons(): # first disable all - addons = bpy.context.user_preferences.addons + addons = bpy.context.preferences.addons for mod_name in list(addons.keys()): addon_utils.disable(mod_name, default_set=True) assert(bool(addons) is False) @@ -75,7 +75,7 @@ def test_load_addons(): disable_addons() - addons = bpy.context.user_preferences.addons + addons = bpy.context.preferences.addons addons_fail = [] @@ -97,7 +97,7 @@ def test_load_addons(): def reload_addons(do_reload=True, do_reverse=True): modules = addon_modules_sorted() - addons = bpy.context.user_preferences.addons + addons = bpy.context.preferences.addons disable_addons() diff --git a/tests/python/bl_load_py_modules.py b/tests/python/bl_load_py_modules.py index b7b0db76b63..be7f426d993 100644 --- a/tests/python/bl_load_py_modules.py +++ b/tests/python/bl_load_py_modules.py @@ -104,7 +104,7 @@ def source_list(path, filename_check=None): def load_addons(): modules = addon_modules_sorted() - addons = bpy.context.user_preferences.addons + addons = bpy.context.preferences.addons # first disable all for mod_name in list(addons.keys()): |