[Bf-extensions-cvs] [28e9eb65] userpref_redesign: Update contrib Add-ons to changed Preference API
Severin
noreply at git.blender.org
Fri Jan 4 01:47:57 CET 2019
Commit: 28e9eb65b555ccc758416081e864c3680c06f7e7
Author: Severin
Date: Fri Jan 4 01:44:03 2019 +0100
Branches: userpref_redesign
https://developer.blender.org/rBAC28e9eb65b555ccc758416081e864c3680c06f7e7
Update contrib Add-ons to changed Preference API
===================================================================
M add_dimension.py
M amaranth/animation/frame_current.py
M amaranth/animation/jump_frames.py
M amaranth/animation/timeline_extra_info.py
M amaranth/node_editor/display_image.py
M amaranth/scene/refresh.py
M amaranth/scene/save_reload.py
M amaranth/scene/stats.py
M animation_motion_trail.py
M cacharanth/util.py
M cmu_mocap_browser/__init__.py
M cmu_mocap_browser/data.py
M cmu_mocap_browser/download.py
M cmu_mocap_browser/makehuman.py
M curve_tools/__init__.py
M data_overrides/util.py
M exact_edit/xedit_free_rotate.py
M exact_edit/xedit_set_meas.py
M io_import_LRO_Lola_MGS_Mola_img.py
M lighting_hdri_shortcut/__init__.py
M mesh_ktools.py
M mesh_show_vgroup_weights.py
M node_presets.py
M np_station/__init__.py
M np_station/np_float_box.py
M np_station/np_float_poly.py
M np_station/np_float_rectangle.py
M np_station/np_point_array.py
M np_station/np_point_copy.py
M np_station/np_point_distance.py
M np_station/np_point_instance.py
M np_station/utils_graphics.py
M oscurart_mesh_cache_tools.py
M render_renderslot.py
M space_view3d_align_tools.py
M space_view3d_enhanced_3d_cursor.py
M space_view3d_paint_bprojection.py
M space_view3d_quickPrefs.py
M space_view3d_toolshelf_menu.py
M sun_position/hdr.py
M sun_position/ui_sun.py
===================================================================
diff --git a/add_dimension.py b/add_dimension.py
index 6468d94d..92b29e8e 100644
--- a/add_dimension.py
+++ b/add_dimension.py
@@ -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'}
diff --git a/amaranth/animation/frame_current.py b/amaranth/animation/frame_current.py
index 24bd3953..8fc7c085 100644
--- a/amaranth/animation/frame_current.py
+++ b/amaranth/animation/frame_current.py
@@ -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")
diff --git a/amaranth/animation/jump_frames.py b/amaranth/animation/jump_frames.py
index 2d93e804..022ba03f 100644
--- a/amaranth/animation/jump_frames.py
+++ b/amaranth/animation/jump_frames.py
@@ -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,
diff --git a/amaranth/animation/timeline_extra_info.py b/amaranth/animation/timeline_extra_info.py
index 8419345d..0e875b43 100644
--- a/amaranth/animation/timeline_extra_info.py
+++ b/amaranth/animation/timeline_extra_info.py
@@ -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
diff --git a/amaranth/node_editor/display_image.py b/amaranth/node_editor/display_image.py
index 5cc2e949..66d2f958 100644
--- a/amaranth/node_editor/display_image.py
+++ b/amaranth/node_editor/display_image.py
@@ -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
diff --git a/amaranth/scene/refresh.py b/amaranth/scene/refresh.py
index 39520789..d50bc199 100644
--- a/amaranth/scene/refresh.py
+++ b/amaranth/scene/refresh.py
@@ -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!",
diff --git a/amaranth/scene/save_reload.py b/amaranth/scene/save_reload.py
index 4f588c3a..7b961b64 100644
--- a/amaranth/scene/save_reload.py
+++ b/amaranth/scene/save_reload.py
@@ -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,
diff --git a/amaranth/scene/stats.py b/amaranth/scene/stats.py
index 602cc23e..10d8be44 100644
--- a/amaranth/scene/stats.py
+++ b/amaranth/scene/stats.py
@@ -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
diff --git a/animation_motion_trail.py b/animation_motion_trail.py
index d5598c2e..3579367e 100644
--- a/animation_motion_trail.py
+++ b/animation_motion_trail.py
@@ -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
diff --git a/cacharanth/util.py b/cacharanth/util.py
index f8386fbd..7a9cd130 100644
--- a/cacharanth/util.py
+++ b/cacharanth/util.py
@@ -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
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list