Update contrib Add-ons to changed Preference API
authorSeverin <eiseljulian@gmail.com>
Fri, 4 Jan 2019 00:44:03 +0000 (01:44 +0100)
committerJulian Eisel <eiseljulian@gmail.com>
Fri, 4 Jan 2019 21:26:24 +0000 (22:26 +0100)
41 files changed:
add_dimension.py
amaranth/animation/frame_current.py
amaranth/animation/jump_frames.py
amaranth/animation/timeline_extra_info.py
amaranth/node_editor/display_image.py
amaranth/scene/refresh.py
amaranth/scene/save_reload.py
amaranth/scene/stats.py
animation_motion_trail.py
cacharanth/util.py
cmu_mocap_browser/__init__.py
cmu_mocap_browser/data.py
cmu_mocap_browser/download.py
cmu_mocap_browser/makehuman.py
curve_tools/__init__.py
data_overrides/util.py
exact_edit/xedit_free_rotate.py
exact_edit/xedit_set_meas.py
io_import_LRO_Lola_MGS_Mola_img.py
lighting_hdri_shortcut/__init__.py
mesh_ktools.py
mesh_show_vgroup_weights.py
node_presets.py
np_station/__init__.py
np_station/np_float_box.py
np_station/np_float_poly.py
np_station/np_float_rectangle.py
np_station/np_point_array.py
np_station/np_point_copy.py
np_station/np_point_distance.py
np_station/np_point_instance.py
np_station/utils_graphics.py
oscurart_mesh_cache_tools.py
render_renderslot.py
space_view3d_align_tools.py
space_view3d_enhanced_3d_cursor.py
space_view3d_paint_bprojection.py
space_view3d_quickPrefs.py
space_view3d_toolshelf_menu.py
sun_position/hdr.py
sun_position/ui_sun.py

index 6468d94..92b29e8 100644 (file)
@@ -1447,7 +1447,7 @@ def ablength(x1 = 0.0, y1 = 0.0, z1 = 0.0, x2 = 0.0, y2 = 0.0, z2 = 0.0):
 def align_matrix(context, location):
 
     loc = Matrix.Translation(location)
-    obj_align = context.user_preferences.edit.object_align
+    obj_align = context.preferences.edit.object_align
     if (context.space_data.type == 'VIEW_3D'
         and obj_align == 'VIEW'):
         rot = context.space_data.region_3d.view_matrix.to_3x3().inverted().to_4x4()
@@ -2652,15 +2652,15 @@ class Dimension(bpy.types.Operator):
             bpy.context.scene.update()
 
         # turn off undo
-        undo = bpy.context.user_preferences.edit.use_global_undo
-        bpy.context.user_preferences.edit.use_global_undo = False
+        undo = bpy.context.preferences.edit.use_global_undo
+        bpy.context.preferences.edit.use_global_undo = False
 
         # main function
         self.align_matrix = align_matrix(context, self.Dimension_startlocation)
         main(self, self.align_matrix)
 
         # restore pre operator undo state
-        bpy.context.user_preferences.edit.use_global_undo = undo
+        bpy.context.preferences.edit.use_global_undo = undo
 
         return {'FINISHED'}
 
index 24bd395..8fc7c08 100644 (file)
@@ -25,12 +25,12 @@ import bpy
 
 
 def button_frame_current(self, context):
-    get_addon = "amaranth" in context.user_preferences.addons.keys()
+    get_addon = "amaranth" in context.preferences.addons.keys()
     if not get_addon:
         return
 
     scene = context.scene
-    if context.user_preferences.addons["amaranth"].preferences.use_frame_current:
+    if context.preferences.addons["amaranth"].preferences.use_frame_current:
         self.layout.separator()
         self.layout.prop(scene, "frame_current", text="Set Current Frame")
 
index 2d93e80..022ba03 100644 (file)
@@ -123,11 +123,11 @@ class AMTH_SCREEN_OT_frame_jump(Operator):
     def execute(self, context):
         scene = context.scene
 
-        get_addon = "amaranth" in context.user_preferences.addons.keys()
+        get_addon = "amaranth" in context.preferences.addons.keys()
         if not get_addon:
             return {"CANCELLED"}
 
-        preferences = context.user_preferences.addons["amaranth"].preferences
+        preferences = context.preferences.addons["amaranth"].preferences
 
         if preferences.use_framerate:
             framedelta = scene.render.fps
@@ -142,11 +142,11 @@ class AMTH_SCREEN_OT_frame_jump(Operator):
 
 
 def ui_userpreferences_edit(self, context):
-    get_addon = "amaranth" in context.user_preferences.addons.keys()
+    get_addon = "amaranth" in context.preferences.addons.keys()
     if not get_addon:
         return
 
-    preferences = context.user_preferences.addons["amaranth"].preferences
+    preferences = context.preferences.addons["amaranth"].preferences
 
     col = self.layout.column()
     split = col.split(percentage=0.21)
@@ -155,13 +155,13 @@ def ui_userpreferences_edit(self, context):
 
 
 def label(self, context):
-    get_addon = "amaranth" in context.user_preferences.addons.keys()
+    get_addon = "amaranth" in context.preferences.addons.keys()
     if not get_addon:
         return
 
     layout = self.layout
 
-    if context.user_preferences.addons["amaranth"].preferences.use_timeline_extra_info:
+    if context.preferences.addons["amaranth"].preferences.use_timeline_extra_info:
         row = layout.row(align=True)
 
         row.operator(AMTH_SCREEN_OT_keyframe_jump_inbetween.bl_idname,
index 8419345..0e875b4 100644 (file)
@@ -23,14 +23,14 @@ import bpy
 
 
 def label_timeline_extra_info(self, context):
-    get_addon = "amaranth" in context.user_preferences.addons.keys()
+    get_addon = "amaranth" in context.preferences.addons.keys()
     if not get_addon:
         return
 
     layout = self.layout
     scene = context.scene
 
-    if context.user_preferences.addons["amaranth"].preferences.use_timeline_extra_info:
+    if context.preferences.addons["amaranth"].preferences.use_timeline_extra_info:
         row = layout.row(align=True)
 
         # Check for preview range
index 5cc2e94..66d2f95 100644 (file)
@@ -50,11 +50,11 @@ class AMTH_NODE_OT_show_active_node_image(bpy.types.Operator):
         select_node = bpy.ops.node.select(mouse_x=mlocx, mouse_y=mlocy, extend=False)
 
         if 'FINISHED' in select_node:  # Only run if we're clicking on a node
-            get_addon = "amaranth" in context.user_preferences.addons.keys()
+            get_addon = "amaranth" in context.preferences.addons.keys()
             if not get_addon:
                 return {"CANCELLED"}
 
-            preferences = context.user_preferences.addons["amaranth"].preferences
+            preferences = context.preferences.addons["amaranth"].preferences
             if preferences.use_image_node_display:
                 if context.active_node:
                     active_node = context.active_node
index 3952078..d50bc19 100644 (file)
@@ -31,11 +31,11 @@ class AMTH_SCENE_OT_refresh(bpy.types.Operator):
     bl_label = "Refresh!"
 
     def execute(self, context):
-        get_addon = "amaranth" in context.user_preferences.addons.keys()
+        get_addon = "amaranth" in context.preferences.addons.keys()
         if not get_addon:
             return {"CANCELLED"}
 
-        preferences = context.user_preferences.addons["amaranth"].preferences
+        preferences = context.preferences.addons["amaranth"].preferences
         scene = context.scene
 
         if preferences.use_scene_refresh:
@@ -47,11 +47,11 @@ class AMTH_SCENE_OT_refresh(bpy.types.Operator):
 
 
 def button_refresh(self, context):
-    get_addon = "amaranth" in context.user_preferences.addons.keys()
+    get_addon = "amaranth" in context.preferences.addons.keys()
     if not get_addon:
         return
 
-    if context.user_preferences.addons["amaranth"].preferences.use_scene_refresh:
+    if context.preferences.addons["amaranth"].preferences.use_scene_refresh:
         self.layout.separator()
         self.layout.operator(AMTH_SCENE_OT_refresh.bl_idname,
                              text="Refresh!",
index 4f588c3..7b961b6 100644 (file)
@@ -47,11 +47,11 @@ class AMTH_WM_OT_save_reload(bpy.types.Operator):
 
 
 def button_save_reload(self, context):
-    get_addon = "amaranth" in context.user_preferences.addons.keys()
+    get_addon = "amaranth" in context.preferences.addons.keys()
     if not get_addon:
         return
 
-    if context.user_preferences.addons["amaranth"].preferences.use_file_save_reload:
+    if context.preferences.addons["amaranth"].preferences.use_file_save_reload:
         self.layout.separator()
         self.layout.operator(
             AMTH_WM_OT_save_reload.bl_idname,
index 602cc23..10d8be4 100644 (file)
@@ -24,11 +24,11 @@ from amaranth import utils
 
 
 def stats_scene(self, context):
-    get_addon = "amaranth" in context.user_preferences.addons.keys()
+    get_addon = "amaranth" in context.preferences.addons.keys()
     if not get_addon:
         return
 
-    if context.user_preferences.addons["amaranth"].preferences.use_scene_stats:
+    if context.preferences.addons["amaranth"].preferences.use_scene_stats:
         scenes_count = str(len(bpy.data.scenes))
         cameras_count = str(len(bpy.data.cameras))
         cameras_selected = 0
index d5598c2..3579367 100644 (file)
@@ -312,8 +312,8 @@ def calc_callback(self, context):
     self.displayed = objects  # store, so it can be checked next time
     context.window_manager.motion_trail.force_update = False
     try:
-        global_undo = context.user_preferences.edit.use_global_undo
-        context.user_preferences.edit.use_global_undo = False
+        global_undo = context.preferences.edit.use_global_undo
+        context.preferences.edit.use_global_undo = False
 
         for action_ob, child, offset_ob in objects:
             if selection_change:
@@ -606,11 +606,11 @@ def calc_callback(self, context):
             if context.scene.frame_current != frame_old:
                 context.scene.frame_set(frame_old)
 
-        context.user_preferences.edit.use_global_undo = global_undo
+        context.preferences.edit.use_global_undo = global_undo
 
     except:
         # restore global undo in case of failure (see T52524)
-        context.user_preferences.edit.use_global_undo = global_undo
+        context.preferences.edit.use_global_undo = global_undo
 
 
 # draw in 3d-view
index f8386fb..7a9cd13 100644 (file)
@@ -37,7 +37,7 @@ def round_sigfigs(num, sig_figs):
 class OperatorCallContext():
     def __enter__(self):
         scene = bpy.context.scene
-        prefs = bpy.context.user_preferences
+        prefs = bpy.context.preferences
 
         # store active/selected state to restore it after operator execution
         self.curact = scene.objects.active
@@ -52,7 +52,7 @@ class OperatorCallContext():
 
     def __exit__(self, exc_type, exc_value, traceback):
         scene = bpy.context.scene
-        prefs = bpy.context.user_preferences
+        prefs = bpy.context.preferences
 
         # restore active/selected state
         scene.objects.active = self.curact
index db2b70e..19912c0 100644 (file)
@@ -62,7 +62,7 @@ class CMUMocapSubjectBrowser(bpy.types.Panel):
     def draw(self, context):
         data.initialize_subjects(context)
         layout = self.layout
-        cml = context.user_preferences.addons['cmu_mocap_browser'].preferences
+        cml = context.preferences.addons['cmu_mocap_browser'].preferences
         layout.template_list("UI_UL_list", "SB", cml, "subject_list",
             cml, "subject_active")
         layout.prop(cml, "subject_import_name")
@@ -100,7 +100,7 @@ class CMUMocapMotionBrowser(bpy.types.Panel):
 
     def draw(self, context):
         layout = self.layout
-        cml = context.user_preferences.addons['cmu_mocap_browser'].preferences
+        cml = context.preferences.addons['cmu_mocap_browser'].preferences
         layout.template_list("UI_UL_list", "MB", cml, "motion_list",
             cml, "motion_active")
         if cml.motion_active == -1:
@@ -153,7 +153,7 @@ class CMUMocapToMakeHuman(bpy.types.Panel):
 
     def draw(self, context):
         layout = self.layout
-        cml = context.user_preferences.addons['cmu_mocap_browser'].preferences
+        cml = context.preferences.addons['cmu_mocap_browser'].preferences
         layout.prop_search(cml, "floor", context.scene, "objects")
         layout.prop(cml, "feet_angle")
         layout.operator("object.cmu_align", text='Align armatures')
index ddec7a4..47536f6 100644 (file)
@@ -24,7 +24,7 @@ def initialize_subjects(context):
     """
         Initializes the main object and the subject (actor) list
     """
-    cml = context.user_preferences.addons['cmu_mocap_browser'].preferences
+    cml = context.preferences.addons['cmu_mocap_browser'].preferences
     if hasattr(cml, 'initialized'):
         return
     cml.initialized = True
index 0f30386..f8d8e18 100644 (file)
@@ -96,13 +96,13 @@ class CMUMocapDownloadImport(bpy.types.Operator):
     def cancel(self, context):
         context.window_manager.event_timer_remove(self.timer)
         bpy.types.SpaceView3D.draw_handler_remove(self.handle, 'WINDOW')
-        cml = context.user_preferences.addons['cmu_mocap_browser'].preferences
+        cml = context.preferences.addons['cmu_mocap_browser'].preferences
         if os.path.exists(self.local_file):
             return self.import_or_open(cml)
         return {'CANCELLED'}
 
     def execute(self, context):
-        cml = context.user_preferences.addons['cmu_mocap_browser'].preferences
+        cml = context.preferences.addons['cmu_mocap_browser'].preferences
         if not os.path.exists(self.local_file):
             try:
                 os.makedirs(os.path.split(self.local_file)[0])
index 466a40b..7c8d843 100644 (file)
@@ -85,7 +85,7 @@ class CMUMocapAlignArmatures(bpy.types.Operator):
     bl_options = {'REGISTER', 'UNDO'}
 
     def execute(self, context):
-        cml = context.user_preferences.addons['cmu_mocap_browser'].preferences
+        cml = context.preferences.addons['cmu_mocap_browser'].preferences
         self.src, self.dst = scan_armatures(context)
         context.scene.frame_set(0)
 
@@ -232,7 +232,7 @@ class CMUMocapTransferer(bpy.types.Operator):
         return {'PASS_THROUGH'}
 
     def execute(self, context):
-        cml = context.user_preferences.addons['cmu_mocap_browser'].preferences
+        cml = context.preferences.addons['cmu_mocap_browser'].preferences
         self.src, self.dst = scan_armatures(context)
         DPB = self.dst.pose.bones
         self.set_inverses()
index bae4300..33aaa37 100644 (file)
@@ -375,7 +375,7 @@ def update_panel(self, context):
                 bpy.utils.unregister_class(panel)
 
         for panel in panels:
-            panel.bl_category = context.user_preferences.addons[__name__].preferences.category
+            panel.bl_category = context.preferences.addons[__name__].preferences.category
             bpy.utils.register_class(panel)
 
     except Exception as e:
index a22cddb..5e59d98 100644 (file)
@@ -79,7 +79,7 @@ def id_data_enum_item(id_data):
 class OperatorCallContext():
     def __enter__(self):
         scene = bpy.context.scene
-        prefs = bpy.context.user_preferences
+        prefs = bpy.context.preferences
 
         # store active/selected state to restore it after operator execution
         self.curact = scene.objects.active
@@ -94,7 +94,7 @@ class OperatorCallContext():
 
     def __exit__(self, exc_type, exc_value, traceback):
         scene = bpy.context.scene
-        prefs = bpy.context.user_preferences
+        prefs = bpy.context.preferences
 
         # restore active/selected state
         scene.objects.active = self.curact
index 013ada6..8930817 100644 (file)
@@ -151,7 +151,7 @@ class MenuStore:
 
 class MenuHandler:
     def __init__(self, title, tsize, act_colr, dis_colr, toolwid, reg):
-        self.dpi = bpy.context.user_preferences.system.dpi
+        self.dpi = bpy.context.preferences.system.dpi
         self.title = title
         # todo : better solution than None "magic numbers"
         self.menus = [None]  # no menu for 0
@@ -249,7 +249,7 @@ class MenuHandler:
 # === 3D View mouse location and button code ===
 class ViewButton():
     def __init__(self, colr_on, colr_off, txt_sz, txt_colr, offs=(0, 0)):
-        self.dpi = bpy.context.user_preferences.system.dpi
+        self.dpi = bpy.context.preferences.system.dpi
         self.is_drawn = False
         self.ms_over = False  # mouse over button
         self.wid = 0
@@ -979,7 +979,7 @@ def draw_callback_px(self, context):
                 if axis_pts is not None:
                     draw_line_2d(axis_pts[0], axis_pts[1], colr)
 
-                dpi = bpy.context.user_preferences.system.dpi
+                dpi = bpy.context.preferences.system.dpi
                 font_id, txt_sz = 0, 32
                 x_pos, y_pos = self.rtoolsw + 80, 36
                 bgl.glColor4f(*colr)
@@ -1042,7 +1042,7 @@ def exit_addon(self):
 def get_reg_overlap():
     rtoolsw = 0  # region tools (toolbar) width
     #ruiw = 0  # region ui (Number/n-panel) width
-    system = bpy.context.user_preferences.system
+    system = bpy.context.preferences.system
     if system.use_region_overlap:
         area = bpy.context.area
         for r in area.regions:
index ea6f8f4..395677d 100644 (file)
@@ -153,7 +153,7 @@ class MenuStore:
 
 class MenuHandler:
     def __init__(self, title, tsize, act_colr, dis_colr, toolwid, reg):
-        self.dpi = bpy.context.user_preferences.system.dpi
+        self.dpi = bpy.context.preferences.system.dpi
         self.title = title
         # todo : better solution than None "magic numbers"
         self.menus = [None, None]  # no menu for 0 or 1
@@ -346,7 +346,7 @@ class XEditMeasureInputPanel(bpy.types.Operator):
 # === 3D View mouse location and button code ===
 class ViewButton():
     def __init__(self, colr_on, colr_off, txt_sz, txt_colr, offs=(0, 0)):
-        self.dpi = bpy.context.user_preferences.system.dpi
+        self.dpi = bpy.context.preferences.system.dpi
         self.is_drawn = False
         self.ms_over = False  # mouse over button
         self.wid = 0
@@ -1470,7 +1470,7 @@ def draw_callback_px(self, context):
                 txt_colr = Colr.green
             elif RotDat.axis_lock == 'Z':
                 txt_colr = Colr.blue
-            dpi = bpy.context.user_preferences.system.dpi
+            dpi = bpy.context.preferences.system.dpi
             font_id, txt_sz = 0, 32
             x_pos, y_pos = self.rtoolsw + 80, 36
             bgl.glColor4f(*txt_colr)
@@ -1521,7 +1521,7 @@ def exit_addon(self):
 def get_reg_overlap():
     rtoolsw = 0  # region tools (toolbar) width
     #ruiw = 0  # region ui (Number/n-panel) width
-    system = bpy.context.user_preferences.system
+    system = bpy.context.preferences.system
     if system.use_region_overlap:
         area = bpy.context.area
         for r in area.regions:
index 36d97dd..e198e54 100644 (file)
@@ -65,8 +65,8 @@ from mathutils import *
 TO_RAD = math.pi / 180  # From degrees to radians
 
 # turning off relative path - it causes an error if it was true
-if bpy.context.user_preferences.filepaths.use_relative_paths == True:
-    bpy.context.user_preferences.filepaths.use_relative_paths = False
+if bpy.context.preferences.filepaths.use_relative_paths == True:
+    bpy.context.preferences.filepaths.use_relative_paths = False
 
 
 # A very simple "bridge" tool.
index 8cf848f..5804812 100644 (file)
@@ -553,8 +553,8 @@ class OBJECT_OT_load_img(bpy.types.Operator):
         global folder_path
         folder_path = '//'
         try:
-            user_preferences = bpy.context.user_preferences
-            addon_prefs = user_preferences.addons['lighting_hdri_shortcut'].preferences
+            preferences = bpy.context.preferences
+            addon_prefs = preferences.addons['lighting_hdri_shortcut'].preferences
             folder_path = addon_prefs.folder_path
         except:
             pass
@@ -621,8 +621,8 @@ class OBJECT_OT_addon_prefs(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" %
                 (addon_prefs.folder_path))
index 5b7a624..cd74a00 100644 (file)
@@ -1326,7 +1326,7 @@ class drawPoly(bpy.types.Operator):
             # restore selection mode and manipulator
             bpy.context.tool_settings.mesh_select_mode = self.sel_mode
             bpy.context.space_data.show_manipulator = self.manip
-            bpy.context.user_preferences.view.use_mouse_depth_cursor = self.cursor_depth
+            bpy.context.preferences.input.use_mouse_depth_cursor = self.cursor_depth
             bpy.context.scene.tool_settings.use_snap = self.snap
 
 
@@ -1350,7 +1350,7 @@ class drawPoly(bpy.types.Operator):
             # restore selection mode and manipulator
             bpy.context.tool_settings.mesh_select_mode = self.sel_mode
             bpy.context.space_data.show_manipulator = self.manip
-            bpy.context.user_preferences.view.use_mouse_depth_cursor = self.cursor_depth
+            bpy.context.preferences.input.use_mouse_depth_cursor = self.cursor_depth
             bpy.context.scene.tool_settings.use_snap = self.snap
 
 
@@ -1370,11 +1370,11 @@ class drawPoly(bpy.types.Operator):
             return {'PASS_THROUGH'}
 
         elif event.type == 'LEFT_CTRL' or event.type == 'RIGHT_CTRL' :
-            if bpy.context.user_preferences.view.use_mouse_depth_cursor == True:
-                bpy.context.user_preferences.view.use_mouse_depth_cursor = False
+            if bpy.context.preferences.input.use_mouse_depth_cursor == True:
+                bpy.context.preferences.input.use_mouse_depth_cursor = False
                 bpy.context.scene.tool_settings.use_snap = False
             else:
-                bpy.context.user_preferences.view.use_mouse_depth_cursor = True
+                bpy.context.preferences.input.use_mouse_depth_cursor = True
                 bpy.context.scene.tool_settings.use_snap = True
             return {'PASS_THROUGH'}
 
@@ -1413,8 +1413,8 @@ class drawPoly(bpy.types.Operator):
         bpy.context.tool_settings.mesh_select_mode = True, False, False
         self.manip = bpy.context.space_data.show_manipulator
         bpy.context.space_data.show_manipulator = False
-        self.cursor_depth = bpy.context.user_preferences.view.use_mouse_depth_cursor
-        bpy.context.user_preferences.view.use_mouse_depth_cursor = False
+        self.cursor_depth = bpy.context.preferences.input.use_mouse_depth_cursor
+        bpy.context.preferences.input.use_mouse_depth_cursor = False
         self.snap = bpy.context.scene.tool_settings.use_snap
         bpy.context.scene.tool_settings.use_snap = False
 
@@ -1445,28 +1445,28 @@ class toggleSilhouette(bpy.types.Operator):
     def execute(self, context):
 
 
-        light_check = bpy.context.user_preferences.system.solid_lights[0].use
+        light_check = bpy.context.preferences.system.solid_lights[0].use
 
         if light_check == True:
             # Set Lights to Off
-            bpy.context.user_preferences.system.solid_lights[0].use = False
-            bpy.context.user_preferences.system.solid_lights[1].use = False
+            bpy.context.preferences.system.solid_lights[0].use = False
+            bpy.context.preferences.system.solid_lights[1].use = False
 
             # Store variables
-            self.diff_col = bpy.context.user_preferences.system.solid_lights[2].diffuse_color
+            self.diff_col = bpy.context.preferences.system.solid_lights[2].diffuse_color
             self.disp_mode = bpy.context.space_data.viewport_shade
             self.matcap = bpy.context.space_data.use_matcap
             self.only_render = bpy.context.space_data.show_only_render
 
-            bpy.context.user_preferences.system.solid_lights[2].diffuse_color = 0,0,0
+            bpy.context.preferences.system.solid_lights[2].diffuse_color = 0,0,0
             bpy.context.space_data.viewport_shade = 'SOLID'
             bpy.context.space_data.use_matcap = False
             bpy.context.space_data.show_only_render = True
 
         else:
-            bpy.context.user_preferences.system.solid_lights[0].use = True
-            bpy.context.user_preferences.system.solid_lights[1].use = True
-            bpy.context.user_preferences.system.solid_lights[2].diffuse_color = self.diff_col
+            bpy.context.preferences.system.solid_lights[0].use = True
+            bpy.context.preferences.system.solid_lights[1].use = True
+            bpy.context.preferences.system.solid_lights[2].diffuse_color = self.diff_col
             bpy.context.space_data.viewport_shade = self.disp_mode
             bpy.context.space_data.use_matcap = self.matcap
             bpy.context.space_data.show_only_render = self.only_render
index f36b5e4..738b10a 100644 (file)
@@ -46,7 +46,7 @@ def calc_callback(self, context):
         return
 
     # get color info from theme
-    acol = context.user_preferences.themes[0].view_3d.editmesh_active
+    acol = context.preferences.themes[0].view_3d.editmesh_active
     tcol = (acol[0] * 0.85, acol[1] * 0.85, acol[2] * 0.85)
 
     # get screen information
index bf34f99..c1c7fef 100644 (file)
@@ -106,8 +106,8 @@ def node_template_add(context, filepath, node_group, ungroup, report):
 # Node Template Prefs
 
 def node_search_path(context):
-    user_preferences = context.user_preferences
-    addon_prefs = user_preferences.addons[__name__].preferences
+    preferences = context.preferences
+    addon_prefs = preferences.addons[__name__].preferences
     dirpath = addon_prefs.search_path
     return dirpath
 
index 7474844..218b1d1 100644 (file)
@@ -131,7 +131,7 @@ def update_panel(self, context):
                 bpy.utils.unregister_class(panel)
 
         for panel in panels:
-            panel.bl_category = context.user_preferences.addons[__package__].preferences.category
+            panel.bl_category = context.preferences.addons[__package__].preferences.category
             bpy.utils.register_class(panel)
 
     except Exception as e:
index baa7bfc..2d609d6 100644 (file)
@@ -417,7 +417,7 @@ def DRAW_Overlay(self, context):
     np_print('DRAW_Overlay_START',';','NP020FB.flag = ', NP020FB.flag)
 
     '''
-    addon_prefs = context.user_preferences.addons[__package__].preferences
+    addon_prefs = context.preferences.addons[__package__].preferences
     badge = addon_prefs.npfb_badge
     badge_size = addon_prefs.npfb_badge_size
     dist_scale = addon_prefs.npfb_dist_scale
index 81c0190..2f9c70d 100644 (file)
@@ -268,7 +268,7 @@ def draw_callback_px_TRANS(self, context):
 
     np_print('04_callback_TRANS_START')
 
-    addon_prefs = context.user_preferences.addons[__package__].preferences
+    addon_prefs = context.preferences.addons[__package__].preferences
     point_markers = addon_prefs.npfp_point_markers
     point_size = addon_prefs.npfp_point_size
 
@@ -757,7 +757,7 @@ def draw_callback_px_NAV(self, context):
 
     np_print('05_callback_NAV_START')
 
-    addon_prefs = context.user_preferences.addons[__package__].preferences
+    addon_prefs = context.preferences.addons[__package__].preferences
     point_markers = addon_prefs.npfp_point_markers
     point_size = addon_prefs.npfp_point_size
 
@@ -1275,7 +1275,7 @@ class NPFPMakeSegment(bpy.types.Operator):
     bl_options = {'INTERNAL'}
 
     def execute(self, context):
-        addon_prefs = context.user_preferences.addons[__package__].preferences
+        addon_prefs = context.preferences.addons[__package__].preferences
         wire = addon_prefs.npfp_wire
         smooth = addon_prefs.npfp_smooth  # is this used ?
         material = addon_prefs.npfp_material
@@ -1378,7 +1378,7 @@ class NPFPDeletePoints(bpy.types.Operator):
     bl_options = {'INTERNAL'}
 
     def execute(self, context):
-        addon_prefs = context.user_preferences.addons[__package__].preferences  # is this used ?
+        addon_prefs = context.preferences.addons[__package__].preferences  # is this used ?
         dist = NP020FP.dist  # is this used ?
         polyob = NP020FP.polyob
         np_print('07_delete_points_START')
@@ -1426,7 +1426,7 @@ class NPFPMakeSurface(bpy.types.Operator):
     bl_options = {'INTERNAL'}
 
     def execute(self, context):
-        addon_prefs = context.user_preferences.addons[__package__].preferences
+        addon_prefs = context.preferences.addons[__package__].preferences
         smooth = addon_prefs.npfp_smooth
         dist = NP020FP.dist  # is this used ?
         polyob = NP020FP.polyob
@@ -1452,7 +1452,7 @@ def draw_callback_px_NAVEX(self, context):
 
     np_print('08_callback_NAVEX_START')
 
-    addon_prefs = context.user_preferences.addons[__package__].preferences
+    addon_prefs = context.preferences.addons[__package__].preferences
 
     #scale = addon_prefs.npfp_scale  # is this used ?
     #badge = addon_prefs.npfp_badge
@@ -1847,7 +1847,7 @@ def draw_callback_px_EXTRUDE(self, context):
 
     np_print('10_callback_EXTRUDE_START')
 
-    addon_prefs = context.user_preferences.addons[__package__].preferences
+    addon_prefs = context.preferences.addons[__package__].preferences
     #scale = addon_prefs.npfp_scale
     #badge = addon_prefs.npfp_badge  # is this used ?
     #point_size = addon_prefs.npfp_point_size  # is this used ?
@@ -2332,7 +2332,7 @@ class NPFPRunBevel(bpy.types.Operator):
 
     def invoke(self, context, event):
         np_print('11_run_BEVEL_INVOKE_a')
-        addon_prefs = context.user_preferences.addons[__package__].preferences
+        addon_prefs = context.preferences.addons[__package__].preferences
         bevel = addon_prefs.npfp_bevel
         selob = NP020FP.selob
         flag = NP020FP.flag
index 509650c..678884f 100644 (file)
@@ -414,7 +414,7 @@ def DRAW_Overlay(self, context):
     np_print('DRAW_Overlay_START',';','NP020FR.flag = ', NP020FR.flag)
 
     '''
-    addon_prefs = context.user_preferences.addons[__package__].preferences
+    addon_prefs = context.preferences.addons[__package__].preferences
     badge = addon_prefs.npfr_badge
     badge_size = addon_prefs.npfr_badge_size
     dist_scale = addon_prefs.npfr_dist_scale
index da150fc..6cfa3dc 100644 (file)
@@ -428,7 +428,7 @@ def DRAW_RunTranslate(self, context):
 
     np_print('04_DRAW_RunTrans_START',';','flag = ', NP020PA.flag)
 
-    addon_prefs = context.user_preferences.addons[__package__].preferences
+    addon_prefs = context.preferences.addons[__package__].preferences
 
     flag = NP020PA.flag
     takeloc3d = NP020PA.takeloc3d
@@ -896,7 +896,7 @@ def DRAW_ArrayTranslate(self, context):
 
     np_print('06a_DRAW_ArrayTrans_START',';','flag = ', NP020PA.flag)
 
-    addon_prefs = context.user_preferences.addons[__package__].preferences
+    addon_prefs = context.preferences.addons[__package__].preferences
 
 
 
index 741dcb9..7e353d3 100644 (file)
@@ -450,7 +450,7 @@ def DRAW_RunTranslate(self, context):
 
     np_print('04_DRAW_RunTrans_START',';','flag = ', NP020PC.flag)
 
-    addon_prefs = context.user_preferences.addons[__package__].preferences
+    addon_prefs = context.preferences.addons[__package__].preferences
 
     flag = NP020PC.flag
     takeloc3d = NP020PC.takeloc3d
@@ -976,7 +976,7 @@ def DRAW_ArrayTrans(self, context):
 
     np_print('06a_DRAW_ArrayTrans_START',';','flag = ', NP020PC.flag)
 
-    addon_prefs = context.user_preferences.addons[__package__].preferences
+    addon_prefs = context.preferences.addons[__package__].preferences
     badge = addon_prefs.nppc_badge
     badge_size = addon_prefs.nppc_badge_size
 
index 3c22f14..1d85912 100644 (file)
@@ -256,7 +256,7 @@ def draw_callback_px_TRANS(self, context):
 
     np_print('04_callback_TRANS_START')
 
-    addon_prefs = context.user_preferences.addons[__package__].preferences
+    addon_prefs = context.preferences.addons[__package__].preferences
 
     scale = addon_prefs.nppd_scale
     badge = addon_prefs.nppd_badge
@@ -997,7 +997,7 @@ def draw_callback_px_NAV(self, context):
 
     np_print('05_callback_NAV_START')
 
-    addon_prefs = context.user_preferences.addons[__package__].preferences
+    addon_prefs = context.preferences.addons[__package__].preferences
 
     scale = addon_prefs.nppd_scale
     badge = addon_prefs.nppd_badge
@@ -1448,7 +1448,7 @@ class NP020PDHoldResult(bpy.types.Operator):
         flag = NP020PD.flag
         np_print('flag=', flag)
         np_print('07_HOLD_INVOKE_a')
-        addon_prefs = context.user_preferences.addons[__package__].preferences
+        addon_prefs = context.preferences.addons[__package__].preferences
         hold = addon_prefs.nppd_hold
         if hold:
             if context.area.type == 'VIEW_3D':
@@ -1479,7 +1479,7 @@ class NP020PDDeletePoints(bpy.types.Operator):
     bl_options = {'INTERNAL'}
 
     def execute(self, context):
-        addon_prefs = context.user_preferences.addons[__package__].preferences
+        addon_prefs = context.preferences.addons[__package__].preferences
         dist = NP020PD.dist
         step = addon_prefs.nppd_step
         info = addon_prefs.nppd_info
index 710a049..f640ff1 100644 (file)
@@ -461,7 +461,7 @@ def DRAW_RunTranslate(self, context):
 
     np_print('04_DRAW_RunTrans_START',';','flag = ', NP020PI.flag)
 
-    addon_prefs = context.user_preferences.addons[__package__].preferences
+    addon_prefs = context.preferences.addons[__package__].preferences
 
 
     flag = NP020PI.flag
@@ -986,7 +986,7 @@ def DRAW_ArrayTrans(self, context):
 
     np_print('06a_DRAW_ArrayTrans_START',';','flag = ', NP020PI.flag)
 
-    addon_prefs = context.user_preferences.addons[__package__].preferences
+    addon_prefs = context.preferences.addons[__package__].preferences
     badge = addon_prefs.nppi_badge
     badge_size = addon_prefs.nppi_badge_size
 
index 24cae78..185ba82 100644 (file)
@@ -40,7 +40,7 @@ class SettingsStore:
 # Use global SettingsStore class to store dict so it is not recreated each call
 # todo : come up with better way for storing and checking add-on settings
 def addon_settings_graph(key):
-    addon_prefs = bpy.context.user_preferences.addons[__package__].preferences
+    addon_prefs = bpy.context.preferences.addons[__package__].preferences
 
     if SettingsStore.add_set_graph_dict is not None:
         add_set_graph_dict = SettingsStore.add_set_graph_dict
@@ -146,7 +146,7 @@ def addon_settings_graph(key):
 def display_instructions(region, rv3d, instruct, keys_aff, keys_nav, keys_neg):
 
 
-    userpref = bpy.context.user_preferences
+    userpref = bpy.context.preferences
     system = userpref.system
     rwtools = 0
     rwui = 0
index 598b601..097ee5f 100644 (file)
@@ -384,7 +384,7 @@ def update_panel(self, context):
                 bpy.utils.unregister_class(panel)
 
         for panel in panels:
-            panel.bl_category = context.user_preferences.addons[__name__].preferences.category
+            panel.bl_category = context.preferences.addons[__name__].preferences.category
             bpy.utils.register_class(panel)
 
     except Exception as e:
index 6aeadf4..0cd8f5e 100644 (file)
@@ -99,7 +99,7 @@ def ui(self, context):
     row.alignment = 'LEFT'
     try:
         active = bpy.data.images['Render Result'].render_slots.active_index
-        if bpy.context.user_preferences.addons[__name__].preferences.advanced_mode:
+        if bpy.context.preferences.addons[__name__].preferences.advanced_mode:
             row.prop(scn, 'ktx_auto_advance_slot', text='Auto Advance')
         row = layout.row(align=True)
         row.alignment = 'EXPAND'
index f9f24b4..6f8bd56 100644 (file)
@@ -1104,7 +1104,7 @@ def update_panel(self, context):
                 bpy.utils.unregister_class(panel)
 
         for panel in panels:
-            panel.bl_category = context.user_preferences.addons[__name__].preferences.category
+            panel.bl_category = context.preferences.addons[__name__].preferences.category
             bpy.utils.register_class(panel)
 
     except Exception as e:
index 7afa1ad..c7cbe95 100644 (file)
@@ -545,8 +545,8 @@ class EnhancedSetCursor(bpy.types.Operator):
         if use_snap:
             snap_type = tool_settings.snap_element
         else:
-            userprefs_view = context.user_preferences.view
-            if userprefs_view.use_mouse_depth_cursor:
+            userprefs_input = context.preferences.input
+            if userprefs_input.use_mouse_depth_cursor:
                 # Suggested by Lissanro in the forum
                 use_snap = True
                 snap_type = 'FACE'
@@ -1181,7 +1181,7 @@ class EnhancedSetCursor(bpy.types.Operator):
 
         v3d = context.space_data
 
-        userprefs_view = context.user_preferences.view
+        userprefs_view = context.preferences.view
 
         tool_settings = context.tool_settings
 
@@ -1195,7 +1195,7 @@ class EnhancedSetCursor(bpy.types.Operator):
         font_size = 11
         blf.size(font_id, font_size, 72) # font, point size, dpi
 
-        tet = context.user_preferences.themes[0].text_editor
+        tet = context.preferences.themes[0].text_editor
 
         # Prepare the table...
         if self.transform_mode == 'MOVE':
@@ -2943,7 +2943,7 @@ class ToggleObjectMode:
 
     def __enter__(self):
         if self.mode:
-            edit_preferences = bpy.context.user_preferences.edit
+            edit_preferences = bpy.context.preferences.edit
 
             self.global_undo = edit_preferences.use_global_undo
             self.prev_mode = bpy.context.object.mode
@@ -2956,7 +2956,7 @@ class ToggleObjectMode:
 
     def __exit__(self, type, value, traceback):
         if self.mode:
-            edit_preferences = bpy.context.user_preferences.edit
+            edit_preferences = bpy.context.preferences.edit
 
             if self.prev_mode != self.mode:
                 bpy.ops.object.mode_set(mode=self.prev_mode)
@@ -3965,7 +3965,7 @@ class BookmarkLibraryProp(bpy.types.PropertyGroup):
             smooth_prev = gl_get(bgl.GL_SMOOTH)
 
             pixelsize = 1
-            dpi = context.user_preferences.system.dpi
+            dpi = context.preferences.system.dpi
             widget_unit = (pixelsize * dpi * 20.0 + 36.0) / 72.0
 
             bgl.glShadeModel(bgl.GL_SMOOTH)
@@ -5355,7 +5355,7 @@ def draw_callback_view(self, context):
         rv3d = context.region_data
 
         pixelsize = 1
-        dpi = context.user_preferences.system.dpi
+        dpi = context.preferences.system.dpi
         widget_unit = (pixelsize * dpi * 20.0 + 36.0) / 72.0
 
         cursor_w = widget_unit*2
@@ -5563,7 +5563,7 @@ def update_keymap(activate):
     cur_idname = 'view3d.cursor3d'
 
     wm = bpy.context.window_manager
-    userprefs = bpy.context.user_preferences
+    userprefs = bpy.context.preferences
     settings = find_settings()
 
     auto_register_keymaps = settings.auto_register_keymaps
@@ -5615,7 +5615,7 @@ def scene_update_post_kmreg(scene):
 @bpy.app.handlers.persistent
 def scene_load_post(*args):
     wm = bpy.context.window_manager
-    userprefs = bpy.context.user_preferences
+    userprefs = bpy.context.preferences
     addon_prefs = userprefs.addons[__name__].preferences
     wm.cursor_3d_runtime_settings.use_cursor_monitor = \
         addon_prefs.use_cursor_monitor
index 751f9bc..2660e56 100644 (file)
@@ -1924,17 +1924,17 @@ class RotateView3D(Operator):
             return {'FINISHED'}
 
         if event.type == 'MOUSEMOVE':
-            if context.user_preferences.inputs.view_rotate_method == 'TRACKBALL':
+            if context.preferences.inputs.view_rotate_method == 'TRACKBALL':
                 self.tracball(context, event.mouse_region_x, event.mouse_region_y, ob.location)
             else:
                 self.turnable(context, event.mouse_region_x, event.mouse_region_y, ob.location)
             align_to_view(context)
             # to unlock the camera
             if self.first_time:
-                rot_ang = context.user_preferences.view.rotation_angle
-                context.user_preferences.view.rotation_angle = 0
+                rot_ang = context.preferences.view.rotation_angle
+                context.preferences.view.rotation_angle = 0
                 bpy.ops.view3d.view_orbit(type='ORBITLEFT')
-                context.user_preferences.view.rotation_angle = rot_ang
+                context.preferences.view.rotation_angle = rot_ang
                 bpy.ops.view3d.view_persportho()
                 bpy.ops.view3d.view_persportho()
                 self.first_time = False
@@ -2097,11 +2097,11 @@ class PresetView3D(Operator):
         pos_init = sd.region_3d.view_location - origine
         sd.region_3d.view_location = origine
 
-        tmp = context.user_preferences.view.smooth_view
-        context.user_preferences.view.smooth_view = 0
+        tmp = context.preferences.view.smooth_view
+        context.preferences.view.smooth_view = 0
         bpy.ops.view3d.viewnumpad(type=self.view)
         align_to_view(context)
-        context.user_preferences.view.smooth_view = tmp
+        context.preferences.view.smooth_view = tmp
 
         vr_a = sd.region_3d.view_rotation.copy()
         pos_init.rotate(vr_a * vr_b)
index 90a2d2a..4c0b847 100644 (file)
@@ -163,7 +163,7 @@ def gllightpreset_importsingle(filename):
             spec2b=strArray[2]
 
             #set the variables
-            system=bpy.context.user_preferences.system
+            system=bpy.context.preferences.system
             system.solid_lights[0].use=illumination0
             system.solid_lights[1].use=illumination1
             system.solid_lights[2].use=illumination2
@@ -290,7 +290,7 @@ def gllightpreset_exportsingle(index, multiimport):
 
 def gllightpreset_addPresets():
 
-    system=bpy.context.user_preferences.system
+    system=bpy.context.preferences.system
 
     system.solid_lights[0].use=True
     system.solid_lights[1].use=True
@@ -540,42 +540,42 @@ def gllightpreset_save():
     index=bpy.context.scene.quickprefs.gllightpreset_index
     name=bpy.context.scene.quickprefs.gllightpreset[index].name
 
-    bpy.context.scene.quickprefs.gllightpreset[index].illuminated0 = bpy.context.user_preferences.system.solid_lights[0].use
-    bpy.context.scene.quickprefs.gllightpreset[index].illuminated1 = bpy.context.user_preferences.system.solid_lights[1].use
-    bpy.context.scene.quickprefs.gllightpreset[index].illuminated2 = bpy.context.user_preferences.system.solid_lights[2].use
+    bpy.context.scene.quickprefs.gllightpreset[index].illuminated0 = bpy.context.preferences.system.solid_lights[0].use
+    bpy.context.scene.quickprefs.gllightpreset[index].illuminated1 = bpy.context.preferences.system.solid_lights[1].use
+    bpy.context.scene.quickprefs.gllightpreset[index].illuminated2 = bpy.context.preferences.system.solid_lights[2].use
 
-    bpy.context.scene.quickprefs.gllightpreset[index].direction0 = bpy.context.user_preferences.system.solid_lights[0].direction
-    bpy.context.scene.quickprefs.gllightpreset[index].direction1 = bpy.context.user_preferences.system.solid_lights[1].direction
-    bpy.context.scene.quickprefs.gllightpreset[index].direction2 = bpy.context.user_preferences.system.solid_lights[2].direction
+    bpy.context.scene.quickprefs.gllightpreset[index].direction0 = bpy.context.preferences.system.solid_lights[0].direction
+    bpy.context.scene.quickprefs.gllightpreset[index].direction1 = bpy.context.preferences.system.solid_lights[1].direction
+    bpy.context.scene.quickprefs.gllightpreset[index].direction2 = bpy.context.preferences.system.solid_lights[2].direction
 
-    bpy.context.scene.quickprefs.gllightpreset[index].diffuse0 = bpy.context.user_preferences.system.solid_lights[0].diffuse_color
-    bpy.context.scene.quickprefs.gllightpreset[index].diffuse1 = bpy.context.user_preferences.system.solid_lights[1].diffuse_color
-    bpy.context.scene.quickprefs.gllightpreset[index].diffuse2 = bpy.context.user_preferences.system.solid_lights[2].diffuse_color
+    bpy.context.scene.quickprefs.gllightpreset[index].diffuse0 = bpy.context.preferences.system.solid_lights[0].diffuse_color
+    bpy.context.scene.quickprefs.gllightpreset[index].diffuse1 = bpy.context.preferences.system.solid_lights[1].diffuse_color
+    bpy.context.scene.quickprefs.gllightpreset[index].diffuse2 = bpy.context.preferences.system.solid_lights[2].diffuse_color
 
-    bpy.context.scene.quickprefs.gllightpreset[index].specular0 = bpy.context.user_preferences.system.solid_lights[0].specular_color
-    bpy.context.scene.quickprefs.gllightpreset[index].specular1 = bpy.context.user_preferences.system.solid_lights[1].specular_color
-    bpy.context.scene.quickprefs.gllightpreset[index].specular2 = bpy.context.user_preferences.system.solid_lights[2].specular_color
+    bpy.context.scene.quickprefs.gllightpreset[index].specular0 = bpy.context.preferences.system.solid_lights[0].specular_color
+    bpy.context.scene.quickprefs.gllightpreset[index].specular1 = bpy.context.preferences.system.solid_lights[1].specular_color
+    bpy.context.scene.quickprefs.gllightpreset[index].specular2 = bpy.context.preferences.system.solid_lights[2].specular_color
 
 #select the current light
 def gllightpreset_select():
     index=bpy.context.scene.quickprefs.gllightpreset_index
     name=bpy.context.scene.quickprefs.gllightpreset[index].name
 
-    bpy.context.user_preferences.system.solid_lights[0].use=bpy.context.scene.quickprefs.gllightpreset[index].illuminated0
-    bpy.context.user_preferences.system.solid_lights[1].use=bpy.context.scene.quickprefs.gllightpreset[index].illuminated1
-    bpy.context.user_preferences.system.solid_lights[2].use=bpy.context.scene.quickprefs.gllightpreset[index].illuminated2
+    bpy.context.preferences.system.solid_lights[0].use=bpy.context.scene.quickprefs.gllightpreset[index].illuminated0
+    bpy.context.preferences.system.solid_lights[1].use=bpy.context.scene.quickprefs.gllightpreset[index].illuminated1
+    bpy.context.preferences.system.solid_lights[2].use=bpy.context.scene.quickprefs.gllightpreset[index].illuminated2
 
-    bpy.context.user_preferences.system.solid_lights[0].direction=bpy.context.scene.quickprefs.gllightpreset[index].direction0
-    bpy.context.user_preferences.system.solid_lights[1].direction=bpy.context.scene.quickprefs.gllightpreset[index].direction1
-    bpy.context.user_preferences.system.solid_lights[2].direction=bpy.context.scene.quickprefs.gllightpreset[index].direction2
+    bpy.context.preferences.system.solid_lights[0].direction=bpy.context.scene.quickprefs.gllightpreset[index].direction0
+    bpy.context.preferences.system.solid_lights[1].direction=bpy.context.scene.quickprefs.gllightpreset[index].direction1
+    bpy.context.preferences.system.solid_lights[2].direction=bpy.context.scene.quickprefs.gllightpreset[index].direction2
 
-    bpy.context.user_preferences.system.solid_lights[0].diffuse_color=bpy.context.scene.quickprefs.gllightpreset[index].diffuse0
-    bpy.context.user_preferences.system.solid_lights[1].diffuse_color=bpy.context.scene.quickprefs.gllightpreset[index].diffuse1
-    bpy.context.user_preferences.system.solid_lights[2].diffuse_color=bpy.context.scene.quickprefs.gllightpreset[index].diffuse2
+    bpy.context.preferences.system.solid_lights[0].diffuse_color=bpy.context.scene.quickprefs.gllightpreset[index].diffuse0
+    bpy.context.preferences.system.solid_lights[1].diffuse_color=bpy.context.scene.quickprefs.gllightpreset[index].diffuse1
+    bpy.context.preferences.system.solid_lights[2].diffuse_color=bpy.context.scene.quickprefs.gllightpreset[index].diffuse2
 
-    bpy.context.user_preferences.system.solid_lights[0].specular_color=bpy.context.scene.quickprefs.gllightpreset[index].specular0
-    bpy.context.user_preferences.system.solid_lights[1].specular_color=bpy.context.scene.quickprefs.gllightpreset[index].specular1
-    bpy.context.user_preferences.system.solid_lights[2].specular_color=bpy.context.scene.quickprefs.gllightpreset[index].specular2
+    bpy.context.preferences.system.solid_lights[0].specular_color=bpy.context.scene.quickprefs.gllightpreset[index].specular0
+    bpy.context.preferences.system.solid_lights[1].specular_color=bpy.context.scene.quickprefs.gllightpreset[index].specular1
+    bpy.context.preferences.system.solid_lights[2].specular_color=bpy.context.scene.quickprefs.gllightpreset[index].specular2
 
 #sort alphabetically
 def gllightpreset_sort():
@@ -745,9 +745,10 @@ class PANEL(bpy.types.Panel):
 
         #aliases
         scn = bpy.context.scene.quickprefs
-        system = context.user_preferences.system
-        inputs = context.user_preferences.inputs
-        edit = context.user_preferences.edit
+        system = context.preferences.system
+        inputs = context.preferences.inputs
+        edit = context.preferences.edit
+        view = context.preferences.view
         layout = self.layout
         split = layout.split()
 
@@ -846,7 +847,7 @@ class PANEL(bpy.types.Panel):
             boxrow=box.row()
             boxrow.label(text="Color Picker Type")
             boxrow=box.row()
-            boxrow.row().prop(system, "color_picker_type", text="")
+            boxrow.row().prop(view, "color_picker_type", text="")
 
             #Align To
             boxrow=box.row()
index 5361324..c594c93 100644 (file)
@@ -2902,7 +2902,7 @@ class SnapCursSelToCenter2(Operator):
 
 # Draw Separator #
 def UseSeparator(operator, context):
-    useSep = bpy.context.user_preferences.addons[__name__].preferences.use_separators
+    useSep = bpy.context.preferences.addons[__name__].preferences.use_separators
     if useSep:
         operator.layout.separator()
 
@@ -2910,7 +2910,7 @@ def UseSeparator(operator, context):
 # Use compact brushes menus #
 def UseBrushesLists():
     # separate function just for more convience
-    useLists = bpy.context.user_preferences.addons[__name__].preferences.use_brushes_lists
+    useLists = bpy.context.preferences.addons[__name__].preferences.use_brushes_lists
 
     return bool(useLists)
 
@@ -2946,12 +2946,12 @@ def update_panel(self, context):
         bpy.utils.unregister_class(VIEW3D_PT_Toolshelf_menu)
     except:
         pass
-    VIEW3D_PT_Toolshelf_menu.bl_category = context.user_preferences.addons[__name__].preferences.category
+    VIEW3D_PT_Toolshelf_menu.bl_category = context.preferences.addons[__name__].preferences.category
     bpy.utils.register_class(VIEW3D_PT_Toolshelf_menu)
 
 # Draw Separator #
 def UseSeparator(operator, context):
-    useSep = bpy.context.user_preferences.addons[__name__].preferences.use_separators
+    useSep = bpy.context.preferences.addons[__name__].preferences.use_separators
     if useSep:
         operator.layout.separator()
 
@@ -2959,7 +2959,7 @@ def UseSeparator(operator, context):
 # Use compact brushes menus #
 def UseBrushesLists():
     # separate function just for more convience
-    useLists = bpy.context.user_preferences.addons[__name__].preferences.use_brushes_lists
+    useLists = bpy.context.preferences.addons[__name__].preferences.use_brushes_lists
 
     return bool(useLists)
 
index f497d25..383ba24 100644 (file)
@@ -552,7 +552,7 @@ def Hdr_load_callback(self, context):
             else:
                 envTex.texture_mapping.rotation.z = 0.0
                 projection = envTex.projection
-                prefs = bpy.context.user_preferences
+                prefs = bpy.context.preferences
                 fileName = prefs.filepaths.temporary_directory + "tmpSun.png"
 
                 st = envTex.image.copy()
index faa59e7..cfc31e5 100644 (file)
@@ -42,10 +42,10 @@ class SunPos_Panel(bpy.types.Panel):
     def disable(self, context, layout):
         p = context.scene.SunPos_pref_property
         if Map.init_zoom_preference:
-            Map.zoom_preferences(bpy.context.user_preferences.inputs.invert_zoom_wheel,
-                                 bpy.context.user_preferences.inputs.invert_mouse_zoom)
-            Hdr.zoom_preferences(bpy.context.user_preferences.inputs.invert_zoom_wheel,
-                                 bpy.context.user_preferences.inputs.invert_mouse_zoom)
+            Map.zoom_preferences(bpy.context.preferences.inputs.invert_zoom_wheel,
+                                 bpy.context.preferences.inputs.invert_mouse_zoom)
+            Hdr.zoom_preferences(bpy.context.preferences.inputs.invert_zoom_wheel,
+                                 bpy.context.preferences.inputs.invert_mouse_zoom)
         row = self.layout.row()
         if p.UseOneColumn:
             col1 = row.column()