From 039db0906d741fc8b3c55c9448b0f707d2075dd2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 15 Jan 2013 17:20:52 +0000 Subject: [PATCH] add user_preference access to _RestrictContext() so addons can access their own preferences on load. --- release/scripts/modules/bpy_restrict_state.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/release/scripts/modules/bpy_restrict_state.py b/release/scripts/modules/bpy_restrict_state.py index 21c69212731..0395a38f4a2 100644 --- a/release/scripts/modules/bpy_restrict_state.py +++ b/release/scripts/modules/bpy_restrict_state.py @@ -31,9 +31,14 @@ import bpy as _bpy class _RestrictContext(): __slots__ = () _real_data = _bpy.data + # safe, the pointer never changes + _real_pref = _bpy.context.user_preferences @property def window_manager(self): return self._real_data.window_managers[0] + @property + def user_preferences(self): + return self._real_pref class _RestrictData():